From: Patrick Steinhardt Date: Thu, 19 Nov 2026 11:59:45 GMT Subject: Re: [PATCH 1/4] refs/reftable: don't write new table on dry-run expire Message-ID: In-Reply-To: On Wed, Nov 18, 2026 at 08:51:41AM -0800, Junio C Hamano wrote: > Patrick Steinhardt 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