threads / patch / 64439

patchperl: also mark git-contacts executable

Subject: [PATCH] perl: also mark git-contacts executable

## tl;dr

8 messages between Nov 4, 2025 and Nov 11, 2025. Diffs are folded; open one to read it.

replies: 7people: 3as markdown or json

D. Ben Knoble· Nov 4, 2025, 18:14 UTC · lore

When install git-contacts with Meson via -Dcontrib=contacts, the default Perl generation fails to mark it executable. As a result, "git contacts" reports "'contacts' is not a git command."

Unlike generate-script.sh, we aren't testing the basename here; so, glob the script name in the case arm to match wherever the input comes from.

Signed-off-by: D. Ben Knoble <ben.knoble+github@gmail.com>
---

Tested like [1]. I was surprised to find my packager didn't have contacts installed, despite it being requested. But the issue is upstream (here): the installer doesn't mark the program as executable. I wrote this on top of the patch in [1], but it should be independent. A quick test says the prerequisite-patch-id shouldn't bother application?

[1]: https://lore.kernel.org/git/0423F0C4-D0AD-471D-9315-FB208A8171B4@gmail.com/T/#t
 generate-perl.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Show changes to generate-perl.sh +1 −1
diff --git a/generate-perl.sh b/generate-perl.sh
index 65f122ebfc..796d835932 100755
--- a/generate-perl.sh
+++ b/generate-perl.sh
@@ -30,7 +30,7 @@
     "$INPUT" >"$OUTPUT"
 
 case "$INPUT" in
-*.perl)
+*.perl|*git-contacts)
 	chmod a+x "$OUTPUT";;
 *)
 	;;

base-commit: 7f278e958afbf9b7e0727631b4c26dcfa1c63d6e
prerequisite-patch-id: 664e4667d11a226a89da52814505a0c8d31b9fba
-- 
2.48.1
Patrick Steinhardt· Nov 6, 2025, 07:22 UTC · re: D. Ben Knoble · lore

Re: [PATCH] perl: also mark git-contacts executable

On Tue, Nov 04, 2025 at 01:14:57PM -0500, D. Ben Knoble wrote:
> When install git-contacts with Meson via -Dcontrib=contacts, the default
s/install/installing/
Show 5 quoted lines
> Perl generation fails to mark it executable. As a result, "git contacts"
> reports "'contacts' is not a git command."
> 
> Unlike generate-script.sh, we aren't testing the basename here; so, glob
> the script name in the case arm to match wherever the input comes from.
Yeah, that feels sensibel to me.
Show 13 quoted lines
> diff --git a/generate-perl.sh b/generate-perl.sh
> index 65f122ebfc..796d835932 100755
> --- a/generate-perl.sh
> +++ b/generate-perl.sh
> @@ -30,7 +30,7 @@
>      "$INPUT" >"$OUTPUT"
>  
>  case "$INPUT" in
> -*.perl)
> +*.perl|*git-contacts)
>  	chmod a+x "$OUTPUT";;
>  *)
>  	;;

And the change looks as expected. An alternative could of course be to rename the file in-tree to "git-contacts.perl". In that case we wouldn't require this special case at all. But I guess that this here is good enough, and there might be other consequences if we renamed the script.

Thanks!
Patrick
Ben Knoble· Nov 6, 2025, 14:07 UTC · re: Patrick Steinhardt · lore

Re: [PATCH] perl: also mark git-contacts executable

Show 6 quoted lines
> Le 6 nov. 2025 à 02:22, Patrick Steinhardt <ps@pks.im> a écrit :
> 
> On Tue, Nov 04, 2025 at 01:14:57PM -0500, D. Ben Knoble wrote:
>> When install git-contacts with Meson via -Dcontrib=contacts, the default
> 
> s/install/installing/
Thanks. If Junio doesn’t mind the trivial fix, I’ll avoid sending v2 for now :)
Show 27 quoted lines
> 
>> Perl generation fails to mark it executable. As a result, "git contacts"
>> reports "'contacts' is not a git command."
>> 
>> Unlike generate-script.sh, we aren't testing the basename here; so, glob
>> the script name in the case arm to match wherever the input comes from.
> 
> Yeah, that feels sensibel to me.
> 
>> diff --git a/generate-perl.sh b/generate-perl.sh
>> index 65f122ebfc..796d835932 100755
>> --- a/generate-perl.sh
>> +++ b/generate-perl.sh
>> @@ -30,7 +30,7 @@
>>     "$INPUT" >"$OUTPUT"
>> 
>> case "$INPUT" in
>> -*.perl)
>> +*.perl|*git-contacts)
>>    chmod a+x "$OUTPUT";;
>> *)
>>    ;;
> 
> And the change looks as expected. An alternative could of course be to
> rename the file in-tree to "git-contacts.perl". In that case we wouldn't
> require this special case at all. But I guess that this here is good
> enough, and there might be other consequences if we renamed the script.
My worry too. 
> Thanks!
> 
> Patrick
Thanks for the review!
Junio C Hamano· Nov 6, 2025, 15:28 UTC · re: Ben Knoble · lore

Re: [PATCH] perl: also mark git-contacts executable

Ben Knoble <ben.knoble@gmail.com> writes:
Show 8 quoted lines
>> Le 6 nov. 2025 à 02:22, Patrick Steinhardt <ps@pks.im> a écrit :
>> 
>> On Tue, Nov 04, 2025 at 01:14:57PM -0500, D. Ben Knoble wrote:
>>> When install git-contacts with Meson via -Dcontrib=contacts, the default
>> 
>> s/install/installing/
>
> Thanks. If Junio doesn’t mind the trivial fix, I’ll avoid sending v2 for now :)
We'd be in pre-release freeze starting with -rc1, so no need to hurry.
>> And the change looks as expected. An alternative could of course be to
>> rename the file in-tree to "git-contacts.perl". In that case we wouldn't
>> require this special case at all. But I guess that this here is good
>> enough, and there might be other consequences if we renamed the script.

Heh, I tend to thnik that consistently naming any Perl source to end in .perl (and Shell .sh) is the right fix, but anything in contrib/ is allowed to be sloppy ;-)

D. Ben Knoble· Nov 11, 2025, 00:19 UTC · re: D. Ben Knoble · lore

[PATCH v2] perl: also mark git-contacts executable

When installing git-contacts with Meson via -Dcontrib=contacts, the default Perl generation fails to mark it executable. As a result, "git contacts" reports "'contacts' is not a git command."

Unlike generate-script.sh, we aren't testing the basename here; so, glob the script name in the case arm to match wherever the input comes from.

Signed-off-by: D. Ben Knoble <ben.knoble+github@gmail.com>
---
A small typo fix for the commit message, thanks to Patrick.
v1: https://lore.kernel.org/git/7fbb341e8f05fcde3a1543e3bb4e5a3ec1101692.1762280097.git.ben.knoble+github@gmail.com/
 generate-perl.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Show changes to generate-perl.sh +1 −1
diff --git a/generate-perl.sh b/generate-perl.sh
index 65f122ebfc..796d835932 100755
--- a/generate-perl.sh
+++ b/generate-perl.sh
@@ -30,7 +30,7 @@
     "$INPUT" >"$OUTPUT"
 
 case "$INPUT" in
-*.perl)
+*.perl|*git-contacts)
 	chmod a+x "$OUTPUT";;
 *)
 	;;

Diff-intervalle contre v1 :
1:  7fbb341e8f ! 1:  15f07afcb6 perl: also mark git-contacts executable
    @@ Metadata
      ## Commit message ##
         perl: also mark git-contacts executable
     
    -    When install git-contacts with Meson via -Dcontrib=contacts, the default
    -    Perl generation fails to mark it executable. As a result, "git contacts"
    -    reports "'contacts' is not a git command."
    +    When installing git-contacts with Meson via -Dcontrib=contacts, the
    +    default Perl generation fails to mark it executable. As a result, "git
    +    contacts" reports "'contacts' is not a git command."
     
         Unlike generate-script.sh, we aren't testing the basename here; so, glob
         the script name in the case arm to match wherever the input comes from.

base-commit: 7f278e958afbf9b7e0727631b4c26dcfa1c63d6e
prerequisite-patch-id: 664e4667d11a226a89da52814505a0c8d31b9fba
-- 
2.52.0.rc0.71.g03eda12af0.dirty
Junio C Hamano· Nov 11, 2025, 18:59 UTC · re: D. Ben Knoble · lore

Re: [PATCH v2] perl: also mark git-contacts executable

"D. Ben Knoble" <ben.knoble+github@gmail.com> writes:
Show 13 quoted lines
> When installing git-contacts with Meson via -Dcontrib=contacts, the
> default Perl generation fails to mark it executable. As a result, "git
> contacts" reports "'contacts' is not a git command."
>
> Unlike generate-script.sh, we aren't testing the basename here; so, glob
> the script name in the case arm to match wherever the input comes from.
>
> Signed-off-by: D. Ben Knoble <ben.knoble+github@gmail.com>
> ---
>
> A small typo fix for the commit message, thanks to Patrick.
>
> v1: https://lore.kernel.org/git/7fbb341e8f05fcde3a1543e3bb4e5a3ec1101692.1762280097.git.ben.knoble+github@gmail.com/

Together with the html one, these patches match what I have already queued with local tweaks, so I won't replace them (they are in 'next' now).

Thanks.  
D. Ben Knoble· Nov 11, 2025, 19:00 UTC · re: Junio C Hamano · lore

Re: [PATCH v2] perl: also mark git-contacts executable

On Tue, Nov 11, 2025 at 1:59 PM Junio C Hamano <gitster@pobox.com> wrote:
Show 22 quoted lines
>
> "D. Ben Knoble" <ben.knoble+github@gmail.com> writes:
>
> > When installing git-contacts with Meson via -Dcontrib=contacts, the
> > default Perl generation fails to mark it executable. As a result, "git
> > contacts" reports "'contacts' is not a git command."
> >
> > Unlike generate-script.sh, we aren't testing the basename here; so, glob
> > the script name in the case arm to match wherever the input comes from.
> >
> > Signed-off-by: D. Ben Knoble <ben.knoble+github@gmail.com>
> > ---
> >
> > A small typo fix for the commit message, thanks to Patrick.
> >
> > v1: https://lore.kernel.org/git/7fbb341e8f05fcde3a1543e3bb4e5a3ec1101692.1762280097.git.ben.knoble+github@gmail.com/
>
> Together with the html one, these patches match what I have already
> queued with local tweaks, so I won't replace them (they are in
> 'next' now).
>
> Thanks.

Ah, sounds good. That was one of the things I wanted to ask by "shall I send v2 or does Junio mind the trivial fix," and I should have been more direct.

Thanks.
Junio C Hamano· Nov 11, 2025, 20:18 UTC · re: D. Ben Knoble · lore

Re: [PATCH v2] perl: also mark git-contacts executable

"D. Ben Knoble" <ben.knoble+github@gmail.com> writes:
Show 27 quoted lines
> On Tue, Nov 11, 2025 at 1:59 PM Junio C Hamano <gitster@pobox.com> wrote:
>>
>> "D. Ben Knoble" <ben.knoble+github@gmail.com> writes:
>>
>> > When installing git-contacts with Meson via -Dcontrib=contacts, the
>> > default Perl generation fails to mark it executable. As a result, "git
>> > contacts" reports "'contacts' is not a git command."
>> >
>> > Unlike generate-script.sh, we aren't testing the basename here; so, glob
>> > the script name in the case arm to match wherever the input comes from.
>> >
>> > Signed-off-by: D. Ben Knoble <ben.knoble+github@gmail.com>
>> > ---
>> >
>> > A small typo fix for the commit message, thanks to Patrick.
>> >
>> > v1: https://lore.kernel.org/git/7fbb341e8f05fcde3a1543e3bb4e5a3ec1101692.1762280097.git.ben.knoble+github@gmail.com/
>>
>> Together with the html one, these patches match what I have already
>> queued with local tweaks, so I won't replace them (they are in
>> 'next' now).
>>
>> Thanks.
>
> Ah, sounds good. That was one of the things I wanted to ask by "shall
> I send v2 or does Junio mind the trivial fix," and I should have been
> more direct.
No, your question did reach me loud and clear.

← back to recent threads