Re: [PATCH] builtin/reflog: expire --all and named refs in one loop
- From
Patrick Steinhardt <ps@pks.im>
- Date
- Nov 10, 2026, 07:09 UTC
- Message-ID
- <avLDE1gGsjjy2ryd@pks.im>
- In-Reply-To
- <20261109161313.54630-1-laveeshb@laveeshbansal.com>
On Mon, Nov 09, 2026 at 08:13:13AM -0800, Laveesh Bansal wrote:
Show 11 quoted lines
> Patrick Steinhardt <ps@pks.im> writes: > > > 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". > > I want this patch to change no behavior, and deduplicating would change > the output: with "--verbose", a name given twice lists its entries > twice today, and sorting would reorder them. It could be done in the > loop, by skipping a name already seen, but that is a separate change.
You could add it as a second commit to this patch series. Like that, the refactoring and the change in behaviour would still be separate from one another. And that second commit would be a good point in case vouching for why the refactoring is a good idea.
Show 11 quoted lines
> > Okay, we only apply per-reflog options in the case where the reflog name > > was explicitly specified by the user, becaues only in that case do we > > call `repo_dwim_log()`. > > reflog_expire_options_set_refname() is called for every entry in the > loop, as it was in both loops before, so the per-reflog options apply > to the --all entries too. Only repo_dwim_log() is conditional: the > names from --all come straight from the ref store and need no lookup. > > I'll reword the commit message as you suggest and send a v2 once others > have had a chance to comment.
Thanks!
Patrick