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
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.
Previous: Patrick SteinhardtNext: Laveesh Bansal
Message 5 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.