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
Jun 2, 2025, 13:12 UTC
Message-ID
<CANMzfzgggS0T9=5FtTdDi0PmVyfQJSp3_nyhj8FxUCj1wSpnZw@mail.gmail.com>
In-Reply-To
<xmqqo6v9es3s.fsf@gitster.g>
On Fri, May 30, 2025 at 4:55 PM Junio C Hamano <gitster@pobox.com> wrote:
Show 11 quoted lines
>
> Patrik Weiskircher <patrik.weiskircher@nutrient.io> writes:
>
> > This means my options become:
> > 1. use --stuck-long or
> > 2. make -S not take any parameter or
> > 3. make -S require a parameter
>
> 4. accept "-S[<key-id>]" in stuck form, and --gpg-sign[=<key-id>]
>
> which is a variant of #1 may be an option?

Not with git rev-parse, unfortunately. Either `-Sabc` or `--gpg-sign=abc` would get transformed into `-S 'abc'` after rev-parse, where we run into the ambiguity of what is an optional argument again. I *could* parse this manually without git rev-parse beforehand, but that seems like just adding yet-another difficult to maintain thing.

``` $ echo $OPTS_SPEC | git rev-parse --parseopt -- "--gpg-sign=abcd" set -- -S 'abcd' --

$ echo $OPTS_SPEC | git rev-parse --parseopt -- "-Sabcd" set -- -S 'abcd' -- ```

Previous: Junio C Hamano
Message 8 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.