git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: Johannes Sixt <j6t@kdbg.org>
Cc: Git Mailing List <git@vger.kernel.org>
Subject: Re: How to cut extra liftime of expired loose objects
Date: Mon, 30 May 2016 14:24:06 -0400	[thread overview]
Message-ID: <20160530182405.GA17253@sigill.intra.peff.net> (raw)
In-Reply-To: <574C6D9B.1080200@kdbg.org>

On Mon, May 30, 2016 at 06:43:07PM +0200, Johannes Sixt wrote:

> I think there is logic somewhere in git gc or its minions that gives expired
> objects that have been packed a two weeks extra life time as loose objects.
> 
> That is, reachable loose objects are moved to a pack, but those objects that
> were packed, but become unreachable due to expired reflogs, are evicted from
> the pack and live for another two weeks or so as loose objects.

Sort of. The loose objects should get the mtime of the pack, which is
likely newer than 2 weeks. So it's not a 2-week extension, but it may
take up to 2 weeks for them to go away (and if the pack is already more
than 2 weeks old, the objects are dropped without even loosening).

> As a consequence of this, I always have a few thousand loose objects in my
> busy repositories, no matter how often I collect garbage. Is there a knob
> that removes the extra lease of life of objects without reducing the usual
> expiration times of reflogs etc?

gc.pruneExpire should do this.

I have run into this, too, and it interacts annoyingly with the
background-gc (which complains "you have too many objects; run
git-prune", leaves that in a .lock file, and then every subsequent
auto-gc spews it at me).

I think we should consider dropping the default time to something more
like 1 day. The 2-week period predates reflogs, I believe (OTOH, it does
save objects which you might have used with "git add" but never actually
committed).

-Peff

  reply	other threads:[~2016-05-30 18:24 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-30 16:43 How to cut extra liftime of expired loose objects Johannes Sixt
2016-05-30 18:24 ` Jeff King [this message]
2016-05-30 18:53   ` 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=20160530182405.GA17253@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=git@vger.kernel.org \
    --cc=j6t@kdbg.org \
    /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).