From: Junio C Hamano Date: Fri, 09 May 2008 03:21:57 GMT Subject: Re: git gc & deleted branches Message-ID: <7vabj0b1re.fsf@gitster.siamese.dyndns.org> In-Reply-To: Brandon Casey writes: > @@ -116,7 +113,15 @@ for name in $names ; do > echo >&2 "old-pack-$name.{pack,idx} in $PACKDIR." > exit 1 > } > - rm -f "$PACKDIR/old-pack-$name.pack" "$PACKDIR/old-pack-$name.idx" > + rm -f "$PACKDIR/old-pack-$name.idx" > + test -z "$keep_unreachable" || > + ! test -f "$PACKDIR/old-pack-$name.pack" || > + git unpack-objects < "$PACKDIR/old-pack-$name.pack" || { > + echo >&2 "Failed unpacking unreachable objects from old pack" > + echo >&2 "saved as old-pack-$name.pack in $PACKDIR." > + exit 1 > + } Neat trick. Unreachable objects that are only in this pack will get current timestamp and gets a new lease of life for two weeks and then will disappear.