Subject: [bug#75981] [PATCH (WIP) v1 0/4] Add 'guix fork'.

From: Ludovic Courtès <[email-masked]>
Date: Sat, 15 Feb 2025 00:51:45 +0100

Hello,

One quick comment…

45mg <[email-masked]> skribis:

> +      (info (G_ "Adding key to keyring branch...~%"))
> +      (invoke-git "switch" "keyring")
> +      (invoke "gpg"
> +              "--armor" "--export"
> +              "-o" (string-append directory "/" key-file-name)
> +              signing-key)
> +      (invoke-git "add" "--" key-file-name)
> +      (invoke-git "commit" "-m" "Add key for fork introduction.")
> +
> +      (info (G_ "Setting up fork branch...~%"))
> +      (invoke-git "switch" "--create" "fork" "master")
> +      (when channel-url
> +        (update-channel-url (string-append directory "/.guix-channel")
> +                            channel-url))
> +      (rewrite-authorizations (string-append directory "/.guix-authorizations")
> +                              introduction-name signing-key)
> +      (invoke-git "add" "--"
> +                  (string-append directory "/.guix-authorizations")
> +                  (string-append directory "/.guix-channel"))
> +      (invoke-git "commit"
> +                  (string-append "--gpg-sign=" signing-key)
> +                  "-m"
> +                  (string-append
> +                   "Initial fork commit.\n\n"
> +                   ".guix-authorizations: Allow only " introduction-name "'s key."
> +                   (if channel-url
> +                       "\n.guix-channels: Update channel URL."
> +                       "")))

Apologies for not following the initial discussions that led to this
design.  To make sure I understand, what this does is create
‘.guix-authorizations’ with a single key and then makes that commit the
introduction of the fork, right?

The idea being that one would keep rebasing their fork and ‘guix fork’
would take care of updating the introduction in ‘.git/config’ so you can
keep authenticating it, right?

This looks interesting and a much needed improvement.  There’s quite a
bit to discuss about the implementation; in particular, it would be cool
if we could avoid duplicating most of (guix scripts git authenticate)
and if we could avoid shelling out to various commands, as in the
snippet above, to the extent possible (for instance using Guile-Git).

Thanks for your work!

Ludo’.