Re: [PATCH] builtin/reflog: expire --all and named refs in one loop
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Nov 9, 2026, 20:04 UTC
- Message-ID
- <xmqqwlqlydo2.fsf@gitster.g>
- In-Reply-To
- <avGU-Wjkd821PLc0@pks.im>
Patrick Steinhardt <ps@pks.im> writes:
2 Okay, so instead of carrying the logic around `refs_reflog_expire()`
Show 10 quoted lines
> twice you instead now first gather all reflog names that we want to > expire, and then we do that in a single step. That seems like a useful > simplification to me. > > One thing I wonder though: now that we first gather reflog names, can't > we also easily deduplicate them? For example if the same reflog name was > given multiple times on the command line, or in case the reflog is > included both via a command line argument and via "--all". > > So I wonder whether we should both sort and deduplicate entries here.
Very good point. I cannot think of a reason why we should not consider it a bug that the current two-loop model processes and reports about the same thing twice, and the collect-then-process model allows deduplication almost for free to address that bug.
Thanks.