git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] builtin/reflog: expire --all and named refs in one loop

From
LBLaveesh Bansal <laveeshb@laveeshbansal.com>
Date
Nov 9, 2026, 16:13 UTC
Message-ID
<20261109161313.54630-1-laveeshb@laveeshbansal.com>
In-Reply-To
<avGU-Wjkd821PLc0@pks.im>
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.

> 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.

Previous: Patrick SteinhardtNext: Patrick Steinhardt
Message 3 of 9 in “builtin/reflog: expire --all and named refs in one loop”
  1. builtin/reflog: expire --all and named refs in one loopLaveesh Bansal, Nov 8, 2026
  2. Patrick SteinhardtNov 9, 2026
  3. Laveesh BansalNov 9, 2026
  4. Patrick SteinhardtNov 10, 2026
  5. Junio C HamanoNov 9, 2026
  6. 0/2 builtin/reflog: expire each reflog only onceLaveesh Bansal, Nov 10, 2026
  7. 1/2 builtin/reflog: expire --all and named refs in one loopLaveesh Bansal, Nov 10, 2026
  8. 2/2 builtin/reflog: expire each reflog only onceLaveesh Bansal, Nov 10, 2026
  9. Patrick SteinhardtNov 11, 2026

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.