Re: [PATCH v2 0/4] for-each-ref: introduce seeking functionality via '--skip-until'
- From
Karthik Nayak <karthik.188@gmail.com>
- Date
- Jul 7, 2025, 08:52 UTC
- Message-ID
- <CAOLa=ZRSFH7F=cU2owPjhVrupSSubEArak6abmhRcP97wStVyA@mail.gmail.com>
- In-Reply-To
- <87ecuwc5n4.fsf@igel.home>
Andreas Schwab <schwab@linux-m68k.org> writes:
Show 35 quoted lines
> On Jul 04 2025, Karthik Nayak wrote: > >> Andreas Schwab <schwab@linux-m68k.org> writes: >> >>> On Jul 04 2025, Karthik Nayak wrote: >>> >>>> 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. >>> >>> That is even more confusing. What is the first matching ref if none of >>> them match? Doesn't that mean skipping _all_ refs? >>> >> >> Well the idea is it would seek to the offset where the reference would >> fit in. >> >> This is to ensure that seeks to references which were deleted >> concurrently doesn't leave the client hanging with no results while >> paginating over all references. > > Then don't call it a pattern. Pattern matching is a set operation, > independent of sorting. What you really have is a marker that divides > the sorted list in two parts according to how the marker sorts. And > that makes --start-with more descriptive and less ambiguous. >
Fair enough. I'll change the documentation and description in the next version.
> -- > 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."