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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, May 30, 2025 at 4:55 PM Junio C Hamano <gitster@xxxxxxxxx> wrote:
>
> Patrik Weiskircher <patrik.weiskircher@xxxxxxxxxxx> 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' --
```





[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux