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:
authorEmily Shaffer <emilyshaffer@google.com>2022-10-27 00:32:45 +0300
committerJunio C Hamano <gitster@pobox.com>2022-10-27 00:39:31 +0300
commitc695592850a3b4b7857fc11721cbc7d2b332f41e (patch)
tree0f7e96252408d31f378be37b421060810773ada3 /t/t6500-gc.sh
parent12253ab6d0033aa8214c8a15bc2ea37ff052ff1c (diff)
config: let feature.experimental imply gc.cruftPacks=true
We are interested in exploring whether gc.cruftPacks=true should become the default value. To determine whether it is safe to do so, let's encourage more users to try it out. Users who have set feature.experimental=true have already volunteered to try new and possibly-breaking config changes, so let's try this new default with that set of users. Signed-off-by: Emily Shaffer <emilyshaffer@google.com> Signed-off-by: Taylor Blau <me@ttaylorr.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t6500-gc.sh')
-rwxr-xr-xt/t6500-gc.sh53
1 files changed, 53 insertions, 0 deletions
diff --git a/t/t6500-gc.sh b/t/t6500-gc.sh
index 928a522194..d9acb63951 100755
--- a/t/t6500-gc.sh
+++ b/t/t6500-gc.sh
@@ -221,6 +221,11 @@ assert_cruft_packs () {
done <packs
}
+assert_no_cruft_packs () {
+ find .git/objects/pack -name "*.mtimes" >mtimes &&
+ test_must_be_empty mtimes
+}
+
test_expect_success 'gc --cruft generates a cruft pack' '
test_when_finished "rm -fr crufts" &&
git init crufts &&
@@ -245,6 +250,54 @@ test_expect_success 'gc.cruftPacks=true generates a cruft pack' '
)
'
+test_expect_success 'feature.experimental=true generates a cruft pack' '
+ git init crufts &&
+ test_when_finished "rm -fr crufts" &&
+ (
+ cd crufts &&
+
+ prepare_cruft_history &&
+ git -c feature.experimental=true gc &&
+ assert_cruft_packs
+ )
+'
+
+test_expect_success 'feature.experimental=false allows explicit cruft packs' '
+ git init crufts &&
+ test_when_finished "rm -fr crufts" &&
+ (
+ cd crufts &&
+
+ prepare_cruft_history &&
+ git -c gc.cruftPacks=true -c feature.experimental=false gc &&
+ assert_cruft_packs
+ )
+'
+
+test_expect_success 'feature.experimental=true can be overridden' '
+ git init crufts &&
+ test_when_finished "rm -fr crufts" &&
+ (
+ cd crufts &&
+
+ prepare_cruft_history &&
+ git -c feature.expiremental=true -c gc.cruftPacks=false gc &&
+ assert_no_cruft_packs
+ )
+'
+
+test_expect_success 'feature.experimental=false avoids cruft packs by default' '
+ git init crufts &&
+ test_when_finished "rm -fr crufts" &&
+ (
+ cd crufts &&
+
+ prepare_cruft_history &&
+ git -c feature.experimental=false gc &&
+ assert_no_cruft_packs
+ )
+'
+
run_and_wait_for_auto_gc () {
# We read stdout from gc for the side effect of waiting until the
# background gc process exits, closing its fd 9. Furthermore, the