Thread (1 message) 1 message, 1 author, 2025-07-16

Re: [PATCH v3 3/4] refs: selectively set prefix in the seek functions

From: Junio C Hamano <hidden>
Date: 2025-07-16 15:39:55

Karthik Nayak [off-list ref] 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".
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help