From: Junio C Hamano <gitster@pobox.com>
To: Patrick Steinhardt <ps@pks.im>
Cc: Markus Gerstel <2025@uxp.de>, git@vger.kernel.org
Subject: Re: 'git gc auto' didn't trigger on large reflog
Date: Wed, 26 Feb 2025 08:10:22 -0800 [thread overview]
Message-ID: <xmqq4j0gg00h.fsf@gitster.g> (raw)
In-Reply-To: <Z779d7SnW5j8XcOb@pks.im> (Patrick Steinhardt's message of "Wed, 26 Feb 2025 12:39:35 +0100")
Patrick Steinhardt <ps@pks.im> writes:
> No, there isn't, and computing it is also potentially expensive. You
> basically have to iterate through each reflog and then also iterate
> through all of its reflog entries to figure out whether anything needs
> cleaning or not.
>
> But probably we can come up with clever heuristics instead that don't
> require us to be this thorough. We could for example just read the
> "HEAD" reflog and figure out whether it contains reflog entries that
> would be pruned.
As we should be able to "seek" to implement HEAD@{2.months.ago}, I'd
imagine that we should be able to ask "give me the oldest entry in
your log" to a ref. Ask that question to a handful of refs that
have been most recently modified (with the theory that a ref that is
more often modified is also likely to have been touched in the
recent past---your HEAD heuristics is a good approximation), and we
learn fairly cheaply if it is likely that we have entries to be
expired.
prev parent reply other threads:[~2025-02-26 16:10 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-22 22:50 'git gc auto' didn't trigger on large reflog Markus Gerstel
2025-02-24 10:56 ` Patrick Steinhardt
2025-02-24 16:43 ` Junio C Hamano
2025-02-26 11:39 ` Patrick Steinhardt
2025-02-26 16:10 ` Junio C Hamano [this message]
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=xmqq4j0gg00h.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=2025@uxp.de \
--cc=git@vger.kernel.org \
--cc=ps@pks.im \
/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;
as well as URLs for NNTP newsgroup(s).