git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
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: Mon, 24 Feb 2025 08:43:23 -0800	[thread overview]
Message-ID: <xmqqeczn70pg.fsf@gitster.g> (raw)
In-Reply-To: <Z7xQey4S0ewT5rs7@pks.im> (Patrick Steinhardt's message of "Mon, 24 Feb 2025 11:56:59 +0100")

Patrick Steinhardt <ps@pks.im> writes:

> It's a bit funny, but whether or not `git gc --auto` does anything
> solely depends on the state of the object database.

I guess after adding "auto", we haven't been careful enough to
update the triggering condition as we added new kinds of "garbage"
to collect?  Should we make an exhausitive and authoritative list of
gc tasks, document them, and make sure "--auto" pays attention?

Other than objects (packing loose ones, pruning unreferenced loose
ones or packing them into cruft packs), we seem to check reflog,
worktree, and rerere database.

I do not think there is a readily usable API to query how much stale
data is in reflogs that are more than N seconds old, without which
"gc --auto" cannot make decisions.  I am reasonably sure rerere API
does not give you such data, either.  I have no idea about the
triggering condition of "worktree prune".



  reply	other threads:[~2025-02-24 16:43 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 [this message]
2025-02-26 11:39     ` Patrick Steinhardt
2025-02-26 16:10       ` Junio C Hamano

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=xmqqeczn70pg.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).