git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 0/2] contrib/subtree: Add -S/--gpg-sign option

From
PWPatrik Weiskircher <patrik.weiskircher@nutrient.io>
Date
May 30, 2025, 14:33 UTC
Message-ID
<CANMzfzhhHX1J_vPH-DMD2kPmQ6G_6YUV=7aZ5JojGy-LU6guAQ@mail.gmail.com>
In-Reply-To
<xmqqfrgnhuuw.fsf@gitster.g>
On Thu, May 29, 2025 at 7:15 PM Junio C Hamano <gitster@pobox.com> wrote:
Show 11 quoted lines
>
> Patrik Weiskircher <patrik@pspdfkit.com> writes:
>
> > Hi!
> >
> > We use git subtree a lot to manage our dependencies, but recently started
> > requiring signed commits. This patch adds support for signing commits to
> > git subtree.
> >
> > This is my first submission to the Git project - you don't have to be gentle,
> > but please let me know if I can improve anything.

Apologies, Junio. I replied only to you and with HTML emails. I'm very new here and I'm very much used to different workflows. I'll be better. Please disregard my previous emails.

Show 8 quoted lines
>
> A few things ;-) starting from the log message where you didn't
> quite add why we would want to do these changes.
>
> Also, I think these two should be combined into a single patch.  We
> add a feature and make sure the feature works correctly and we also
> make sure that the feature does not misfire when the user does not
> ask it to trigger, all in the same commit.

I looked at your review, and I agree with everything you said. My patch wasn't very well thought out.

I'm also at a crossroads here. I'm not sure if the optional argument parsing will work out nicely in bash. Let me explain:

git-subtree uses `git rev-parse --parseopt`. This *does* have support for optional arguments, but highly recommends using `--stuck-long`, otherwise unambiguously parsing arguments becomes impossible.

This is true. There's no way to differentiate between the optional argument or the next positional parameter. Therefore, I would have to use `--stuck-long`.

This in itself isn't overly difficult. There's only a couple of parameters in the script that that would affect. The problem I have with it is that I don't see a single user of `--stuck-long` in the whole repo. I don't necessarily want to become the first one. Seems like something destined to be cleaned up at some point.

This means my options become:
1. use --stuck-long or
2. make -S not take any parameter or
3. make -S require a parameter

I'm not happy with any of these options, but considering I really would like to make this work, I would probably go with 1.

Any opinions on this?

Thanks! Patrik

Previous: Junio C HamanoNext: Junio C Hamano
Message 6 of 8 in “contrib/subtree: Add -S/--gpg-sign option”
  1. 0/2 contrib/subtree: Add -S/--gpg-sign optionPatrik Weiskircher, May 28, 2025
  2. 1/2 contrib/subtree: Add -S/--gpg-sign optionPatrik Weiskircher, May 28, 2025
  3. Junio C HamanoMay 29, 2025
  4. 2/2 contrib/subtree: Add tests for -S/--gpg-signPatrik Weiskircher, May 28, 2025
  5. Junio C HamanoMay 29, 2025
  6. Patrik WeiskircherMay 30, 2025
  7. Junio C HamanoMay 30, 2025
  8. Patrik WeiskircherJun 2, 2025

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.