* [PATCH] Remove all old packfiles when doing "git repack -a -d"
@ 2005-11-18 20:36 Lukas Sandström
2005-11-18 21:15 ` Junio C Hamano
0 siblings, 1 reply; 2+ messages in thread
From: Lukas Sandström @ 2005-11-18 20:36 UTC (permalink / raw)
To: git; +Cc: junio C Hamano, Lukas Sandström
No point in running git-pack-redundant if we already know
which packs are redundant.
Signed-off-by: Lukas Sandström <lukass@etek.chalmers.se>
---
This should be correct. I even tested it.
git-repack.sh | 19 ++++++++++++++++---
1 files changed, 16 insertions(+), 3 deletions(-)
applies-to: 8c987c24bed7f7a30f4e74b12e8acc2cc5eeea93
2f49d2a3a7cf0fc64edfad2febf986252392b667
diff --git a/git-repack.sh b/git-repack.sh
index e58fdd6..55a7b27 100755
--- a/git-repack.sh
+++ b/git-repack.sh
@@ -63,9 +63,22 @@ exit
if test "$remove_redundant" = t
then
sync
- redundant=$(git-pack-redundant --all)
- if test "$redundant" != "" ; then
- echo $redundant | xargs rm
+ if test "$all_into_one" = t
+ then
+ cd "$PACKDIR"
+ existing=`find . -type f \( -name '*.pack' -o -name '*.idx' \) -print`
+ for e in $existing
+ do
+ case "$e" in
+ ./pack-$name.pack | ./pack-$name.idx) ;;
+ *) rm -f $e ;;
+ esac
+ done
+ else
+ redundant=$(git-pack-redundant --all)
+ if test "$redundant" != "" ; then
+ echo $redundant | xargs rm
+ fi
fi
fi
---
0.99.9.GIT
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] Remove all old packfiles when doing "git repack -a -d"
2005-11-18 20:36 [PATCH] Remove all old packfiles when doing "git repack -a -d" Lukas Sandström
@ 2005-11-18 21:15 ` Junio C Hamano
0 siblings, 0 replies; 2+ messages in thread
From: Junio C Hamano @ 2005-11-18 21:15 UTC (permalink / raw)
To: Lukas Sandström; +Cc: git
Lukas Sandström <lukass@etek.chalmers.se> writes:
> No point in running git-pack-redundant if we already know
> which packs are redundant.
>
> Signed-off-by: Lukas Sandström <lukass@etek.chalmers.se>
This makes sense and makes me feel safer somehow. Thanks.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2005-11-18 21:15 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-11-18 20:36 [PATCH] Remove all old packfiles when doing "git repack -a -d" Lukas Sandström
2005-11-18 21:15 ` Junio C Hamano
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).