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

Re: [PATCH 1/4] refs/reftable: don't write new table on dry-run expire

From
Patrick Steinhardt <ps@pks.im>
Date
Nov 19, 2026, 11:59 UTC
Message-ID
<av7ksRi3bQtx3pGf@pks.im>
In-Reply-To
<xmqq1p8i84ma.fsf@gitster.g>
On Wed, Nov 18, 2026 at 08:51:41AM -0800, Junio C Hamano wrote:
Show 16 quoted lines
> Patrick Steinhardt <ps@pks.im> writes:
> 
> > The `git reflog expire` subcommand supports a dry-run flag. When set, we
> > print what would be pruned without actually pruning anything on disk.
> >
> > But even though the expectation is that the on-disk state won't change,
> > the reftable backend still ends up writing a new reftable to disk that
> > contains the changes. This is of course rather pointless, as we would
> > have already printed the entries that we're about to prune at that point
> > in time.
> 
> I hope I am right in assuming that the current code already has
> provisions to discard (or "not to use") this data written to the
> disk.  If so, that means --dry-run is working correctly, and this
> change is a performance-only improvement.  Is that the untold piece
> of information here?

Yes. We write everything to disk, but instead of committing we then call `reftable_addition_destroy()`, which calls `reftable_addition_close()`, and that function in turn unlinks the table from disk again.

I'll adapt the commit message to make that explicit.
Patrick
Previous: Junio C HamanoNext: Patrick Steinhardt
Message 6 of 18 in “Improve performance of reflog expiration”
  1. 0/4 Improve performance of reflog expirationPatrick Steinhardt, Nov 18, 2026
  2. 1/4 refs/reftable: don't write new table on dry-run expirePatrick Steinhardt, Nov 18, 2026
  3. Karthik NayakNov 18, 2026
  4. Patrick SteinhardtNov 18, 2026
  5. Junio C HamanoNov 18, 2026
  6. Patrick SteinhardtNov 19, 2026
  7. 2/4 refs/reftable: don't write new table when expire is a no-opPatrick Steinhardt, Nov 18, 2026
  8. Karthik NayakNov 18, 2026
  9. Patrick SteinhardtNov 18, 2026
  10. Toon ClaesNov 18, 2026
  11. Patrick SteinhardtNov 19, 2026
  12. 3/4 builtin/maintenance: only consider `gc.reflogExpire` for "--auto"Patrick Steinhardt, Nov 18, 2026
  13. Toon ClaesNov 18, 2026
  14. Patrick SteinhardtNov 19, 2026
  15. 4/4 Documentation/config: fix typo in "maintenance.reflog-expire.auto"Patrick Steinhardt, Nov 18, 2026
  16. Toon ClaesNov 18, 2026
  17. Toon ClaesNov 18, 2026
  18. Patrick SteinhardtNov 19, 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.