From: Patrick Steinhardt <ps@pks.im>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH 1/4] refs/reftable: don't write new table on dry-run expire
Date: Thu, 19 Nov 2026 12:59:45 +0100 [thread overview]
Message-ID: <av7ksRi3bQtx3pGf@pks.im> (raw)
In-Reply-To: <xmqq1p8i84ma.fsf@gitster.g>
On Wed, Nov 18, 2026 at 08:51:41AM -0800, Junio C Hamano wrote:
> 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
next prev parent reply other threads:[~2026-11-19 11:59 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-18 9:30 [PATCH 0/4] Improve performance of reflog expiration Patrick Steinhardt
2026-11-18 9:31 ` [PATCH 1/4] refs/reftable: don't write new table on dry-run expire Patrick Steinhardt
2026-11-18 11:28 ` Karthik Nayak
2026-11-18 12:05 ` Patrick Steinhardt
2026-11-18 16:51 ` Junio C Hamano
2026-11-19 11:59 ` Patrick Steinhardt [this message]
2026-11-18 9:31 ` [PATCH 2/4] refs/reftable: don't write new table when expire is a no-op Patrick Steinhardt
2026-11-18 11:33 ` Karthik Nayak
2026-11-18 12:05 ` Patrick Steinhardt
2026-11-18 15:34 ` Toon Claes
2026-11-19 11:57 ` Patrick Steinhardt
2026-11-18 9:31 ` [PATCH 3/4] builtin/maintenance: only consider `gc.reflogExpire` for "--auto" Patrick Steinhardt
2026-11-18 15:52 ` Toon Claes
2026-11-19 11:58 ` Patrick Steinhardt
2026-11-18 9:31 ` [PATCH 4/4] Documentation/config: fix typo in "maintenance.reflog-expire.auto" Patrick Steinhardt
2026-11-18 15:54 ` Toon Claes
2026-11-18 15:56 ` [PATCH 0/4] Improve performance of reflog expiration Toon Claes
2026-11-19 11:58 ` Patrick Steinhardt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=av7ksRi3bQtx3pGf@pks.im \
--to=ps@pks.im \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox