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' -- ```