From: Jeff King <peff@peff.net>
To: Junio C Hamano <gitster@pobox.com>
Cc: "Linus Torvalds" <torvalds@linux-foundation.org>,
"Ævar Arnfjörð Bjarmason" <avarab@gmail.com>,
"Git Mailing List" <git@vger.kernel.org>
Subject: Re: git auto-repack is broken...
Date: Fri, 2 Dec 2011 12:45:46 -0500 [thread overview]
Message-ID: <20111202174546.GA24093@sigill.intra.peff.net> (raw)
In-Reply-To: <7vobvqoozr.fsf@alter.siamese.dyndns.org>
On Fri, Dec 02, 2011 at 09:35:52AM -0800, Junio C Hamano wrote:
> Jeff King <peff@peff.net> writes:
>
> > When the objects become unreferenced, we eject them from the pack into
> > loose form again. If they don't become referenced in the 2-week window,
> > they get pruned then. So yes, you drop the age information, but they do
> > eventually go away.
>
> If you update gc/repack -A to put them in a separate pack, then you would
> never be able to get rid of them, no? You pack, then eject (which gives
> them a fresher timestamp), then notice that you are within the 2-week window
> and pack them again,...
But we shouldn't be packing totally unreferenced objects. Barring bugs,
the life cycle of such an object should be something like:
1. Object X is created on branch 'foo'.
2. Branch 'foo' is deleted, but its commits are still in the HEAD
reflog, referencing X.
3. 90 days pass (actually, I think this might be the 30-day
expire-unreachable time)
4. "git gc" runs "git repack -Ad", which will eject X from the pack
into a loose form (because it is not becoming part of the new pack
we are writing).
5. Two weeks pass.
6. "git gc" runs "git prune --expire=2.weeks.ago", which removes the
object.
"gc" runs between (4) and (6) will not re-pack the object, because it
remains unreferenced.
I think things might be slowed somewhat by "gc --auto", which will not
do a "repack -A" until we have too many packs. So steps (3) and (4) are
really more like "gc runs git-repack without -A" 50 times, and then we
finally run "git repack -A".
-Peff
next prev parent reply other threads:[~2011-12-02 17:45 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-12-02 16:22 git auto-repack is broken Linus Torvalds
2011-12-02 16:27 ` Ævar Arnfjörð Bjarmason
2011-12-02 16:56 ` Linus Torvalds
2011-12-02 17:10 ` Jeff King
2011-12-02 17:35 ` Junio C Hamano
2011-12-02 17:45 ` Jeff King [this message]
2011-12-02 18:08 ` Junio C Hamano
2011-12-02 18:13 ` Jeff King
2011-12-03 19:42 ` Brandon Casey
2011-12-07 22:12 ` Nicolas Pitre
2011-12-07 22:53 ` Jeff King
2011-12-08 0:18 ` Nicolas Pitre
2011-12-08 0:45 ` Jeff King
2011-12-08 3:35 ` Nicolas Pitre
2011-12-08 3:40 ` Jeff King
2011-12-09 17:35 ` Junio C Hamano
2011-12-09 18:34 ` Nicolas Pitre
2011-12-08 0:49 ` Jeff King
-- strict thread matches above, loose matches on Subject: below --
2011-12-03 6:55 George Spelvin
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=20111202174546.GA24093@sigill.intra.peff.net \
--to=peff@peff.net \
--cc=avarab@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=torvalds@linux-foundation.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).