Re: Remove unneeded packs
- From
Lukas Sandström <lukass@etek.chalmers.se>
- Date
- Nov 13, 2005, 12:31 UTC
- Message-ID
- <4377323B.4000203@etek.chalmers.se>
- In-Reply-To
- <20051113122017.GA9996@procyon.home>
Sergey Vlasov wrote:
Show 45 quoted lines
> On Sun, Nov 13, 2005 at 01:07:50PM +0100, Lukas Sandstr?m wrote: > >>Sergey Vlasov wrote: >> >>>On Sun, 13 Nov 2005 11:58:11 +0100 Lukas Sandstr?m wrote: > > >>>>-if test "$remove_redandant" = t >>>>+if test "$all_into_one" = t >>> >>> >>>This should be >>> >>>if test "$all_into_one$remove_redandant" = tt >>> >>>(otherwise "git repack -a" becomes the same as "git repack -a -d"). >>> >>> >> >>This was the behaviour before git-pack-redundant, I just restored it. > > > But the old code was: > > if test "$remove_redandant" = t > then > # We know $existing are all redandant only when > # all-into-one is used. > if test "$all_into_one" != '' && test "$existing" != '' > then > sync > ( cd "$PACKDIR" && > for e in $existing > do > case "$e" in > ./pack-$name.pack | ./pack-$name.idx) ;; > *) rm -f $e ;; > esac > done > ) > fi > fi > > So without the -d option nothing was removed, even with -a. >
True. I forgot to look at the context around the changed lines... Btw, remove_redundant is misspellt.
Show 9 quoted lines
> (And test "$existing" != '' might also be needed for some shells which > are confused by the empty list in the for statement.) > > >>Someone else gets to decide if git repack -a implies "remove all old packs". > > > If there is a separate -d option for this, just using -a probably > should not remove anything.
True, but you will have trouble removing stale packfiles if they contain unreachable objects unless you remove them when you create the -a pack.
Anyway, ignore the patch above.