Re: [PATCH v3 3/4] refs: selectively set prefix in the seek functions
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jul 16, 2025, 15:39 UTC
- Message-ID
- <xmqqjz48cfg7.fsf@gitster.g>
- In-Reply-To
- <CAOLa=ZTc2_g3+8MM8whW+eZAj-+36HNsnUFDoLgnN42ytFLwAw@mail.gmail.com>
Karthik Nayak <karthik.188@gmail.com> writes:
> Let's say a user is iterating with a prefix set to 'refs/heads/', this > would iterate over all the refs with that prefix. But mid-way the user > realizes that they only care about 'refs/heads/feature/' prefix and they > ask the iterator to set that as the prefix.
But is that user who changes their mind in the middle "seeking"?
It is more like "I am abandoning the enumeration I started earlier over refs/heads/, and I want a different enumeration over refs/heads/feature/, but because I know the implementation detail that abandoning an iterator and creating another is more expensive, let me reuse the one in use to repurpose it".
I wouldn't call it "seeking"; it sounds more like "resetting".