Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2020-08-26 01:45:52 +0300
committerJunio C Hamano <gitster@pobox.com>2020-12-16 01:30:11 +0300
commitc3b58472be2c647cd0c5af328980b15bd3f43b69 (patch)
tree129c35f4cf2e05f70f60e19021c41ed692cbd71a /t/t5323-pack-redundant.sh
parent1c52ecf4ba0f4f7af72775695fee653f50737c71 (diff)
pack-redundant: gauge the usage before proposing its removal
The subcommand is unusably slow and the reason why nobody reports it as a performance bug is suspected to be the absense of users. Let's show a big message that asks the user to tell us that they still care about the command when an attempt is made to run the command, with an escape hatch to override it with a command line option. In a few releases, we may turn it into an error and keep it for a few more releases before finally removing it (during the whole time, the plan to remove it would be interrupted by end user raising hand). Reviewed-by: Taylor Blau <me@ttaylorr.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t5323-pack-redundant.sh')
-rwxr-xr-xt/t5323-pack-redundant.sh28
1 files changed, 15 insertions, 13 deletions
diff --git a/t/t5323-pack-redundant.sh b/t/t5323-pack-redundant.sh
index 6b4d1ca353..2dd2d67b9e 100755
--- a/t/t5323-pack-redundant.sh
+++ b/t/t5323-pack-redundant.sh
@@ -39,6 +39,8 @@ relationship between packs and objects is as follows:
master_repo=master.git
shared_repo=shared.git
+git_pack_redundant='git pack-redundant --i-still-use-this'
+
# Create commits in <repo> and assign each commit's oid to shell variables
# given in the arguments (A, B, and C). E.g.:
#
@@ -154,7 +156,7 @@ test_expect_success 'master: no redundant for pack 1, 2, 3' '
EOF
(
cd "$master_repo" &&
- git pack-redundant --all >out &&
+ $git_pack_redundant --all >out &&
test_must_be_empty out
)
'
@@ -192,7 +194,7 @@ test_expect_success 'master: one of pack-2/pack-3 is redundant' '
cat >expect <<-EOF &&
P3:$P3
EOF
- git pack-redundant --all >out &&
+ $git_pack_redundant --all >out &&
format_packfiles <out >actual &&
test_cmp expect actual
)
@@ -231,7 +233,7 @@ test_expect_success 'master: pack 2, 4, and 6 are redundant' '
P4:$P4
P6:$P6
EOF
- git pack-redundant --all >out &&
+ $git_pack_redundant --all >out &&
format_packfiles <out >actual &&
test_cmp expect actual
)
@@ -266,7 +268,7 @@ test_expect_success 'master: pack-8 (subset of pack-1) is also redundant' '
P6:$P6
P8:$P8
EOF
- git pack-redundant --all >out &&
+ $git_pack_redundant --all >out &&
format_packfiles <out >actual &&
test_cmp expect actual
)
@@ -284,9 +286,9 @@ test_expect_success 'master: clean loose objects' '
test_expect_success 'master: remove redundant packs and pass fsck' '
(
cd "$master_repo" &&
- git pack-redundant --all | xargs rm &&
+ $git_pack_redundant --all | xargs rm &&
git fsck &&
- git pack-redundant --all >out &&
+ $git_pack_redundant --all >out &&
test_must_be_empty out
)
'
@@ -304,7 +306,7 @@ test_expect_success 'setup shared.git' '
test_expect_success 'shared: all packs are redundant, but no output without --alt-odb' '
(
cd "$shared_repo" &&
- git pack-redundant --all >out &&
+ $git_pack_redundant --all >out &&
test_must_be_empty out
)
'
@@ -343,7 +345,7 @@ test_expect_success 'shared: show redundant packs in stderr for verbose mode' '
P5:$P5
P7:$P7
EOF
- git pack-redundant --all --verbose >out 2>out.err &&
+ $git_pack_redundant --all --verbose >out 2>out.err &&
test_must_be_empty out &&
grep "pack$" out.err | format_packfiles >actual &&
test_cmp expect actual
@@ -356,9 +358,9 @@ test_expect_success 'shared: remove redundant packs, no packs left' '
cat >expect <<-EOF &&
fatal: Zero packs found!
EOF
- git pack-redundant --all --alt-odb | xargs rm &&
+ $git_pack_redundant --all --alt-odb | xargs rm &&
git fsck &&
- test_must_fail git pack-redundant --all --alt-odb >actual 2>&1 &&
+ test_must_fail $git_pack_redundant --all --alt-odb >actual 2>&1 &&
test_cmp expect actual
)
'
@@ -386,7 +388,7 @@ test_expect_success 'shared: create new objects and packs' '
test_expect_success 'shared: no redundant without --alt-odb' '
(
cd "$shared_repo" &&
- git pack-redundant --all >out &&
+ $git_pack_redundant --all >out &&
test_must_be_empty out
)
'
@@ -417,7 +419,7 @@ test_expect_success 'shared: no redundant without --alt-odb' '
test_expect_success 'shared: one pack is redundant with --alt-odb' '
(
cd "$shared_repo" &&
- git pack-redundant --all --alt-odb >out &&
+ $git_pack_redundant --all --alt-odb >out &&
format_packfiles <out >actual &&
test_line_count = 1 actual
)
@@ -454,7 +456,7 @@ test_expect_success 'shared: ignore unique objects and all two packs are redunda
Px1:$Px1
Px2:$Px2
EOF
- git pack-redundant --all --alt-odb >out <<-EOF &&
+ $git_pack_redundant --all --alt-odb >out <<-EOF &&
$X
$Y
$Z