Re: [PATCH 1/3] repack: modify behavior of -A option to leave unreferenced objects unpacked
- From
Jeff King <peff@peff.net>
- Date
- May 10, 2008, 06:03 UTC
- Message-ID
- <20080510060345.GC11556@sigill.intra.peff.net>
- In-Reply-To
- <3927888.1210392047922.JavaMail.teamon@b303.teamon.com>
On Fri, May 09, 2008 at 11:01:55PM -0500, drafnel@gmail.com wrote:
> - keep_unreachable=--keep-unreachable ;; > + keep_unreachable=t ;;
Can we call this something else (like unpack_unreachable) since it now has nothing to do with the --keep-unreachable flag?
Also, should --keep-unreachable be deprecated / removed?
Show 10 quoted lines
> + *)
> + rm -f "$e.idx" "$e.keep"
> + if test -n "$keep_unreachable" &&
> + test -f "$e.pack"
> + then
> + git unpack-objects < "$e.pack" || {
> + echo >&2 "Failed unpacking unreachable objects from redundant pack file $e.pack"
> + exit 1
> + }
> + fiI still like Geert's suggestion of unpacking them to a _different_ place. That helps to avoid spurious "gc --auto" invocations caused by too many prunable objects. Though it certainly doesn't solve it, and maybe that just needs to be fixed separately.
Possibly the "gc --auto" test should be:
- count objects; if too few, exit - count unreachable loose objects; if too few, exit - run gc
That means having a lot of unreachable objects will still incur some extra processing, but not as much as a full repack. And it won't bug the user with a "you need to repack" message.
-Peff