From b4ad3552de8b3231b55f5ee32ee2178202708118 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=5FSandstr=C3=B6m?= Date: Wed, 9 Nov 2005 02:25:48 +0100 Subject: Make git-repack use git-pack-intersect. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Lukas Sandström Signed-off-by: Junio C Hamano --- git-repack.sh | 30 ++++++++++++------------------ 1 file changed, 12 insertions(+), 18 deletions(-) (limited to 'git-repack.sh') diff --git a/git-repack.sh b/git-repack.sh index d341966ef..3f2830056 100755 --- a/git-repack.sh +++ b/git-repack.sh @@ -32,10 +32,6 @@ case ",$all_into_one," in rev_list= rev_parse='--all' pack_objects= - # This part is a stop-gap until we have proper pack redundancy - # checker. - existing=`cd "$PACKDIR" && \ - find . -type f \( -name '*.pack' -o -name '*.idx' \) -print` ;; esac if [ "$local" ]; then @@ -46,6 +42,14 @@ name=$(git-rev-list --objects $rev_list $(git-rev-parse $rev_parse) | exit 1 if [ -z "$name" ]; then echo Nothing new to pack. + if test "$remove_redandant" = t ; then + echo "Removing redundant packs." + sync + redundant=$(git-pack-intersect -a) + if test "$redundant" != "" ; then + echo $redundant | xargs rm + fi + fi exit 0 fi echo "Pack pack-$name created." @@ -58,20 +62,10 @@ exit 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 - ) + sync + redundant=$(git-pack-intersect -a) + if test "$redundant" != "" ; then + echo $redundant | xargs rm fi fi -- cgit v1.2.1 From 9bc0f32c77b755b8d77d215cc47fafff53cad6f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=5FSandstr=C3=B6m?= Date: Thu, 10 Nov 2005 00:16:13 +0100 Subject: Rename git-pack-intersect to git-pack-redundant MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This patch renames git-pack-intersect to git-pack-redundant as suggested by Petr Baudis. The new name reflects what the program does, rather than how it does it. Also fix a small argument parsing bug. Signed-off-by: Lukas Sandström Signed-off-by: Junio C Hamano --- git-repack.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'git-repack.sh') diff --git a/git-repack.sh b/git-repack.sh index 3f2830056..4ce00225d 100755 --- a/git-repack.sh +++ b/git-repack.sh @@ -45,7 +45,7 @@ if [ -z "$name" ]; then if test "$remove_redandant" = t ; then echo "Removing redundant packs." sync - redundant=$(git-pack-intersect -a) + redundant=$(git-pack-redundant -a) if test "$redundant" != "" ; then echo $redundant | xargs rm fi @@ -63,7 +63,7 @@ exit if test "$remove_redandant" = t then sync - redundant=$(git-pack-intersect -a) + redundant=$(git-pack-redundant -a) if test "$redundant" != "" ; then echo $redundant | xargs rm fi -- cgit v1.2.1 From 1c3039e8f1eb01766cff976793c8f439095967f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=5FSandstr=C3=B6m?= Date: Fri, 11 Nov 2005 01:25:04 +0100 Subject: Make git-pack-redundant consider alt-odbs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This patch changes git-pack-redundant so that packfiles in alternate object directories also are considered when deciding which objects are redundant. This functionality is controlled by the flag '--alt-odb'. Also convert the other flags to the long form, and update docs and git-repack accordingly. Signed-off-by: Lukas Sandström Signed-off-by: Junio C Hamano --- git-repack.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'git-repack.sh') diff --git a/git-repack.sh b/git-repack.sh index 4ce00225d..f34720701 100755 --- a/git-repack.sh +++ b/git-repack.sh @@ -45,7 +45,7 @@ if [ -z "$name" ]; then if test "$remove_redandant" = t ; then echo "Removing redundant packs." sync - redundant=$(git-pack-redundant -a) + redundant=$(git-pack-redundant --all) if test "$redundant" != "" ; then echo $redundant | xargs rm fi @@ -63,7 +63,7 @@ exit if test "$remove_redandant" = t then sync - redundant=$(git-pack-redundant -a) + redundant=$(git-pack-redundant --all) if test "$redundant" != "" ; then echo $redundant | xargs rm fi -- cgit v1.2.1