Subject: Re: [bug#61246] [PATCH v3 2/3] doc: Explain how to use local guix repositories.

From: Maxim Cournoyer <[email-masked]>
Date: Sat, 18 Feb 2023 12:35:32 -0500

Hi André,

André Batista <[email-masked]> writes:

> Hi,
>
> sex 17 fev 2023 às 14:58:12 (1676656692), [email-masked] enviou:
>> Hello,
>>
>> André Batista <[email-masked]> writes:
>> > +Note that you can specify a local directory on the @code{url} field above if
>> > +the channel that you intend to use resides on a local file system.  However,
>> > +in this case @command{guix} checks said directory for ownership before any
>> > +further processing.  This means that if the user is not the directory owner,
>> > +but wants to use it as their default, they will then need to set it as a safe
>> > +directory in their global git configuration file.  Otherwise, @command{guix}
>> > +will refuse to even read it.  Supposing your system-wide local directory is at
>> > +@code{/src/guix.git}, you would then create a git configuration file at
>> > +@code{~/.gitconfig} with the following contents:
>> > +
>> > +@example
>> > +[safe]
>> > +        directory = /src/guix.git
>> > +@end example
>>
>> Perhaps you meant to use @command{git} in the above instead of
>> @command{guix}, since it's specific to Git (and the configure snippet is
>> for Git) ?
>
> Not really. It's guix itself and its subcommands which will fail in
> this scenario, not git, even though it's because guix is using git
> configuration through libgit2. To me it would be misleading to use
> @command{git} there. I could come up with a more detailed
> description, however, I don't think this would be the place to be
> diving on a detailed discussion of guix internals. I'm up to
> suggestions though if you think this patch would make people wonder
> if it is a typo.

I understand.  How about a very subtle nudge at the fact that Guix uses
git (via libgit2) under the hood?  Something like the following, where
I've used a footnote (untested):

--8<---------------cut here---------------start------------->8---
Note that you can specify a local directory on the @code{url} field
above if the channel that you intend to use resides on a local file
system.  However, in this case @command{guix}@footnote{More accurately,
@command{git}, which Guix utilizes via the @code{libgit2} library.}
checks said directory for ownership before any further processing.  This
means that if the user is not the directory owner, but wants to use it
as their default, they will then need to set it as a safe directory in
their global git configuration file.  Otherwise, @command{guix} will
refuse to even read it.  Supposing your system-wide local directory is
at @code{/src/guix.git}, you would then create a git configuration file
at @code{~/.gitconfig} with the following contents:
--8<---------------cut here---------------end--------------->8---

-- 
Thanks,
Maxim