Re: [PATCH] gc --auto: warn garbage collection happens soon
- From
Nguyen Thai Ngoc Duy <pclouds@gmail.com>
- Date
- Dec 28, 2011, 22:09 UTC
- Message-ID
- <CACsJy8BSewZuk-aoorqXRtD=nhPV=TY8YgjFj9uGMivv_GTQSA@mail.gmail.com>
- In-Reply-To
- <20111228213018.GA22811@sigill.intra.peff.net>
2011/12/29 Jeff King <peff@peff.net>:
Show 12 quoted lines
> Especially now that prune has learned about progress reporting, it's > easy to see in "git gc" that the "Counting objects" phase of the repack > and the connectivity search in prune are counting the same objects. It > would obviously be easy to just dump the set of sha1s in packed binary > format, and let git-prune reference that. > > But it doesn't work in the general case. Running "git gc" will repack > everything, and so it looks at all reachable objects. But "git gc > --auto" will typically do an incremental pack (unless you have too many > packs), which means its counting objects phase only looks at part of > the graph. So that result can't be used for object reachability, since > many objects won't be marked[1].
Hmm.. I was thinking of sharing this "counting objects" part when repack is rewritten in C. I guess I can drop the idea now.
-- Duy