Thread (6 messages) flat view 6 messages, 3 authors, 2016-06-15

Re: Remove unneeded packs

From: Sergey Vlasov <hidden>
Date: 2016-06-15 22:42:11

Possibly related (same subject, not in this thread)

On Sun, Nov 13, 2005 at 01:07:50PM +0100, Lukas Sandstr?m wrote:
Sergey Vlasov wrote:
quoted
On Sun, 13 Nov 2005 11:58:11 +0100 Lukas Sandstr?m wrote:
quoted
quoted
-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.

(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.

Attachments

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help