diff mbox series

[bug#66605,v2] etc: gitconfig: Run etc/teams.scm from correct environment.

Message ID d409fe3f12ae15b9f663a81221f5bbf254c995ee.1697665843.git.clement@lassieur.org
State New
Headers show
Series [bug#66605,v2] etc: gitconfig: Run etc/teams.scm from correct environment. | expand

Commit Message

Clément Lassieur Oct. 18, 2023, 9:50 p.m. UTC
* etc/git/gitconfig: Prepend "guix repl" to the etc/teams.scm script so that
any user that has git:send-email installed can use it in the Guix checkout
without changing their environment.  (teams.scm uses (git) and (guix ui).)
---
 etc/git/gitconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)


base-commit: 5498835bb38c0de57f284f0fa6b1178ecdcaf678
prerequisite-patch-id: d95e49e4fc059972fc5a7b2c92816df2228a0af1
prerequisite-patch-id: a0dca8c3175d6ce71c77e220c4ac98b6e97cef56

Comments

Maxim Cournoyer Oct. 19, 2023, 1:39 a.m. UTC | #1
Hi,

Clément Lassieur <clement@lassieur.org> writes:

> * etc/git/gitconfig: Prepend "guix repl" to the etc/teams.scm script so that
> any user that has git:send-email installed can use it in the Guix checkout
> without changing their environment.  (teams.scm uses (git) and (guix ui).)
> ---
>  etc/git/gitconfig | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/etc/git/gitconfig b/etc/git/gitconfig
> index 907ad0180454..abcd494d62e8 100644
> --- a/etc/git/gitconfig
> +++ b/etc/git/gitconfig
> @@ -14,5 +14,5 @@
>  
>  [sendemail]
>          to = guix-patches@gnu.org
> -        headerCmd = etc/teams.scm cc-members-header-cmd
> +        headerCmd = guix repl etc/teams.scm cc-members-header-cmd

I had noticed as well that since Guix depends on 'git', we now have to
include git:send-email to the profile to be able to use it, like:

'guix shell -D guix git:send-email'.

I think on foreign distributions, you also need to use mumi or git
send-email in ./pre-inst-env, which is what your patch solves, I
believe.  This is not needed on a Guix System because the guix-daemon
used by it adds the Guix modules to the GUILE_LOAD_PATH.
Maxim Cournoyer Oct. 19, 2023, 1:47 a.m. UTC | #2
Hello,

Clément Lassieur <clement@lassieur.org> writes:

> * etc/git/gitconfig: Prepend "guix repl" to the etc/teams.scm script so that
> any user that has git:send-email installed can use it in the Guix checkout
> without changing their environment.  (teams.scm uses (git) and (guix ui).)
> ---
>  etc/git/gitconfig | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/etc/git/gitconfig b/etc/git/gitconfig
> index 907ad0180454..abcd494d62e8 100644
> --- a/etc/git/gitconfig
> +++ b/etc/git/gitconfig
> @@ -14,5 +14,5 @@
>  
>  [sendemail]
>          to = guix-patches@gnu.org
> -        headerCmd = etc/teams.scm cc-members-header-cmd
> +        headerCmd = guix repl etc/teams.scm cc-members-header-cmd

Even nicer could be using 'guix repl' in the teams.scm script shebang.
This way even for those using it outside of 'git send-email', it'd
always work.
Clément Lassieur Oct. 19, 2023, 10:05 a.m. UTC | #3
> Even nicer could be using 'guix repl' in the teams.scm script shebang.
> This way even for those using it outside of 'git send-email', it'd
> always work.

I can't find a nice solution to do that.  And I think people who run teams.scm directly will expect a guile crash and make sure to get the correct environment, so it's not really a problem at that point.

This is not the case for people who run `git send-email`.  Those people don't expect a guile crash.

So if you have a clean solution that works in a shebang (without the file being detected as a shell script by most editors), please show it :-)
diff mbox series

Patch

diff --git a/etc/git/gitconfig b/etc/git/gitconfig
index 907ad0180454..abcd494d62e8 100644
--- a/etc/git/gitconfig
+++ b/etc/git/gitconfig
@@ -14,5 +14,5 @@ 
 
 [sendemail]
         to = guix-patches@gnu.org
-        headerCmd = etc/teams.scm cc-members-header-cmd
+        headerCmd = guix repl etc/teams.scm cc-members-header-cmd
         thread = no