GNU bug report logs - #78437
[PATCH] gnu: git-minimal: Fix ugly output of git submodule -h.

Previous Next

Package: guix-patches;

Reported by: Nicolas Graves <ngraves <at> ngraves.fr>

Date: Thu, 15 May 2025 07:38:02 UTC

Severity: normal

Tags: patch

Done: Maxim Cournoyer <maxim <at> guixotic.coop>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 78437 in the body.
You can then email your comments to 78437 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#78437; Package guix-patches. (Thu, 15 May 2025 07:38:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Nicolas Graves <ngraves <at> ngraves.fr>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Thu, 15 May 2025 07:38:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Nicolas Graves <ngraves <at> ngraves.fr>
To: guix-patches <at> gnu.org
Subject: [PATCH] gnu: git-minimal: Fix ugly output of git submodule -h.
Date: Thu, 15 May 2025 09:21:18 +0200
* gnu/packages/version-control.scm (git-minimal)[arguments]<phases>:
Adjust the snippet patching git-submodule.sh to avoid the ugly
".git submodule-real" from git submodule -h.
---
 gnu/packages/version-control.scm | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/gnu/packages/version-control.scm b/gnu/packages/version-control.scm
index ed96b524f83..f4bae91906d 100644
--- a/gnu/packages/version-control.scm
+++ b/gnu/packages/version-control.scm
@@ -437,13 +437,11 @@ (define PATH-variable-definition
                      "GNU")))           ;matched against '*'
 
               ;; git-submodule sources 'git-sh-setup.sh', but not before
-              ;; invoking the basename and sed commands... patch them to their
-              ;; absolute location.
+              ;; invoking the basename and sed commands...  Using those
+              ;; leads to some ugly .git submodule-real, hardcode instead.
               (substitute* "git-submodule.sh"
-                (("\\$\\(basename")
-                 (string-append "$(" (search-input-file inputs "bin/basename")))
-                (("sed -e")
-                 (string-append (search-input-file inputs "bin/sed") " -e")))))
+                (("^dashless=.*")
+                 "dashless=\"git submodule\"\n"))))
           (add-after 'configure 'patch-makefiles
             (lambda _
               (substitute* "Makefile"
-- 
2.49.0



-- 
Best regards,
Nicolas Graves




Information forwarded to guix-patches <at> gnu.org:
bug#78437; Package guix-patches. (Fri, 23 May 2025 04:37:02 GMT) Full text and rfc822 format available.

Message #8 received at 78437 <at> debbugs.gnu.org (full text, mbox):

From: Ian Eure <ian <at> retrospec.tv>
To: Nicolas Graves <ngraves <at> ngraves.fr>
Cc: 78437 <at> debbugs.gnu.org
Subject: Re: [bug#78437] [PATCH] gnu: git-minimal: Fix ugly output of git
 submodule -h.
Date: Thu, 22 May 2025 21:36:13 -0700
Hi Nicolas,

Nicolas Graves <ngraves <at> ngraves.fr> writes:

> * gnu/packages/version-control.scm 
> (git-minimal)[arguments]<phases>:
> Adjust the snippet patching git-submodule.sh to avoid the ugly
> ".git submodule-real" from git submodule -h.
> ---
>  gnu/packages/version-control.scm | 10 ++++------
>  1 file changed, 4 insertions(+), 6 deletions(-)
>
> diff --git a/gnu/packages/version-control.scm 
> b/gnu/packages/version-control.scm
> index ed96b524f83..f4bae91906d 100644
> --- a/gnu/packages/version-control.scm
> +++ b/gnu/packages/version-control.scm
> @@ -437,13 +437,11 @@ (define PATH-variable-definition
>                       "GNU")))           ;matched against '*'
>  
>                ;; git-submodule sources 'git-sh-setup.sh', but 
>                not before
> -              ;; invoking the basename and sed 
> commands... patch them to their
> -              ;; absolute location.
> +              ;; invoking the basename and sed commands... 
> Using those
> +              ;; leads to some ugly .git submodule-real, 
> hardcode instead.

The ".real" in the output is caused by the git package (which 
inherits from git-minimal) using `wrap-program' (which is what 
creates the ".real" files):

     ;; Tell 'git-submodule' where Perl is.
     (wrap-program git-sm
       `("PATH" ":" prefix
         (,(dirname (search-input-file inputs "bin/perl")))))

The git-minimal package has normal output:

   meson!ieure:~$ guix shell --pure git-minimal -- git submodule 
   -h
   usage: git submodule [--quiet] [--cached]

Since the problem is created by the git package, I think that’s 
were the fix should go.  WDYT?

Adding, the git-submodule script doesn’t call perl directly, so 
this must be due to it calling another git plumbing command which 
does -- `git-filter-branch' seems a likely suspect.  Though if 
that’s the case, git-minimal’s `git-filter-branch' is broken.  I’m 
not sure what the rationale is for doing it this way, but it might 
be worth checking if the wrapper can be eliminated altogether.

Thanks,

 -- Ian




Reply sent to Maxim Cournoyer <maxim <at> guixotic.coop>:
You have taken responsibility. (Wed, 25 Jun 2025 14:05:03 GMT) Full text and rfc822 format available.

Notification sent to Nicolas Graves <ngraves <at> ngraves.fr>:
bug acknowledged by developer. (Wed, 25 Jun 2025 14:05:07 GMT) Full text and rfc822 format available.

Message #13 received at 78437-done <at> debbugs.gnu.org (full text, mbox):

From: Maxim Cournoyer <maxim <at> guixotic.coop>
To: Ian Eure <ian <at> retrospec.tv>
Cc: Nicolas Graves <ngraves <at> ngraves.fr>, 78437-done <at> debbugs.gnu.org
Subject: Re: [bug#78437] [PATCH] gnu: git-minimal: Fix ugly output of git
 submodule -h.
Date: Wed, 25 Jun 2025 23:04:06 +0900
Hi,

Ian Eure <ian <at> retrospec.tv> writes:

> Hi Nicolas,
>
> Nicolas Graves <ngraves <at> ngraves.fr> writes:
>
>> * gnu/packages/version-control.scm (git-minimal)[arguments]<phases>:
>> Adjust the snippet patching git-submodule.sh to avoid the ugly
>> ".git submodule-real" from git submodule -h.
>> ---
>>  gnu/packages/version-control.scm | 10 ++++------
>>  1 file changed, 4 insertions(+), 6 deletions(-)
>>
>> diff --git a/gnu/packages/version-control.scm
>> b/gnu/packages/version-control.scm
>> index ed96b524f83..f4bae91906d 100644
>> --- a/gnu/packages/version-control.scm
>> +++ b/gnu/packages/version-control.scm
>> @@ -437,13 +437,11 @@ (define PATH-variable-definition
>>                       "GNU")))           ;matched against '*'
>>                 ;; git-submodule sources 'git-sh-setup.sh', but
>> not before
>> -              ;; invoking the basename and sed commands... patch
>> them to their
>> -              ;; absolute location.
>> +              ;; invoking the basename and sed commands... Using
>> those
>> +              ;; leads to some ugly .git submodule-real, hardcode
>> instead.
>
> The ".real" in the output is caused by the git package (which inherits
> from git-minimal) using `wrap-program' (which is what creates the
> ".real" files):
>
>      ;; Tell 'git-submodule' where Perl is.
>      (wrap-program git-sm
>        `("PATH" ":" prefix
>          (,(dirname (search-input-file inputs "bin/perl")))))
>
> The git-minimal package has normal output:
>
>    meson!ieure:~$ guix shell --pure git-minimal -- git submodule
>    -h
>    usage: git submodule [--quiet] [--cached]
>
> Since the problem is created by the git package, I think that’s were
> the fix should go.  WDYT?
>
> Adding, the git-submodule script doesn’t call perl directly, so this
> must be due to it calling another git plumbing command which does --
> `git-filter-branch' seems a likely suspect.  Though if that’s the
> case, git-minimal’s `git-filter-branch' is broken.  I’m not sure what
> the rationale is for doing it this way, but it might be worth checking
> if the wrapper can be eliminated altogether.

I investigated a bit, and git submodules seems to work fine without this
2014 perl wrapping thing, even in a container.  So, I've pushed

45ec6e0e0a gnu: git: Remove extraneous git-submodule wrapper.

which should fix that, along a git update and related commits.

-- 
Thanks,
Maxim




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 24 Jul 2025 11:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 7 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.