From 6b94b1a09af9cf877f0bc43d6097bce56f856866 Mon Sep 17 00:00:00 2001 From: "Dana L. How" Date: Sun, 13 May 2007 12:47:09 -0700 Subject: git-repack --max-pack-size: add option parsing to enable feature Add --max-pack-size parsing and usage messages. Upgrade git-repack.sh to handle multiple packfile names, and build packfiles in GIT_OBJECT_DIRECTORY not GIT_DIR. Update documentation. Signed-off-by: Dana L. How Signed-off-by: Junio C Hamano --- git-repack.sh | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'git-repack.sh') diff --git a/git-repack.sh b/git-repack.sh index 8bf66a4fe8..4ea6e5b9e5 100755 --- a/git-repack.sh +++ b/git-repack.sh @@ -3,7 +3,7 @@ # Copyright (c) 2005 Linus Torvalds # -USAGE='[-a] [-d] [-f] [-l] [-n] [-q] [--window=N] [--depth=N]' +USAGE='[-a] [-d] [-f] [-l] [-n] [-q] [--max-pack-size=N] [--window=N] [--depth=N]' SUBDIRECTORY_OK='Yes' . git-sh-setup @@ -18,6 +18,7 @@ do -q) quiet=-q ;; -f) no_reuse=--no-reuse-object ;; -l) local=--local ;; + --max-pack-size=*) extra="$extra $1" ;; --window=*) extra="$extra $1" ;; --depth=*) extra="$extra $1" ;; *) usage ;; @@ -35,7 +36,7 @@ true) esac PACKDIR="$GIT_OBJECT_DIRECTORY/pack" -PACKTMP="$GIT_DIR/.tmp-$$-pack" +PACKTMP="$GIT_OBJECT_DIRECTORY/.tmp-$$-pack" rm -f "$PACKTMP"-* trap 'rm -f "$PACKTMP"-*' 0 1 2 3 15 @@ -62,11 +63,12 @@ case ",$all_into_one," in esac args="$args $local $quiet $no_reuse$extra" -name=$(git-pack-objects --non-empty --all --reflog $args Date: Thu, 24 May 2007 19:06:42 -0700 Subject: Ensure git-repack -a -d --max-pack-size=N deletes correct packs The packfile portion of the "remove redundant" code near the bottom of git-repack.sh is broken when pack splitting occurs. Particularly since this is the only place where we automatically delete packfiles, make sure it works properly for all cases, old or new. Signed-off-by: Dana L. How Signed-off-by: Junio C Hamano --- git-repack.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'git-repack.sh') diff --git a/git-repack.sh b/git-repack.sh index 4ea6e5b9e5..8c32724be7 100755 --- a/git-repack.sh +++ b/git-repack.sh @@ -69,6 +69,7 @@ if [ -z "$names" ]; then echo Nothing new to pack. fi for name in $names ; do + fullbases="$fullbases pack-$name" chmod a-w "$PACKTMP-$name.pack" chmod a-w "$PACKTMP-$name.idx" if test "$quiet" != '-q'; then @@ -105,8 +106,8 @@ then ( cd "$PACKDIR" && for e in $existing do - case "$e" in - pack-$name) ;; + case " $fullbases " in + *" $e "*) ;; *) rm -f "$e.pack" "$e.idx" "$e.keep" ;; esac done -- cgit v1.3-5-g9baa