Re: [PATCH v2 0/4] for-each-ref: introduce seeking functionality via '--skip-until'
- From
Karthik Nayak <karthik.188@gmail.com>
- Date
- Jul 4, 2025, 14:02 UTC
- Message-ID
- <CAOLa=ZS0uP+5xso_SEG2GJZHeac-0F2_wMJKtvbFj_wROKbBkw@mail.gmail.com>
- In-Reply-To
- <87ms9kcbtq.fsf@igel.home>
Andreas Schwab <schwab@linux-m68k.org> writes:
Show 9 quoted lines
> On Jul 04 2025, Karthik Nayak wrote: > >> This series adds a '--skip-until' option in 'git-for-each-ref(1)'. When >> used, the reference iteration seeks to the first matching reference and >> iterates from there onward. > > I would have named the option --start-with. It has the advantage that > it is clear whether the matched ref is included. >
We did discuss this internally, some other names we thought of: --skip-to --start-after --start-from --seek --skip-before --start-at
I think I was a bit against '--start-from' and '--start-at', because they imply that the reference provided must exist.
Consider the example
$ git for-each-ref refs/heads/bar refs/heads/foo refs/heads/main
$ git for-each-ref --seek=refs/heads/cat refs/heads/foo refs/heads/main
You can see that the reference doesn't have to exist. So implying that it should can be a bit confusing.
But I'm open to changing this, if we can conclude on any flag name...
> -- > Andreas Schwab, schwab@linux-m68k.org > GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510 2552 DF73 E780 A9DA AEC1 > "And now for something completely different."