Git fork

setup: use "reftable" format when experimental features are enabled

With the preceding commit we have announced the switch to the "reftable"
format in Git 3.0 for newly created repositories. The format is being
battle tested by GitLab and a couple of other developers, and except for
a small handful of issues exposed early after it has been merged it has
been rock solid. Regardless of that though the test user base is still
comparatively small, which increases the risk that we miss critical
bugs.

Address this by enabling the reftable format when experimental features
are enabled. This should increase the test user base by some margin and
thus give us more input before making the format the default.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

authored by

Patrick Steinhardt and committed by
Junio C Hamano
793b14e1 d0b94577

+52
+6
Documentation/config/feature.adoc
··· 24 24 * `pack.usePathWalk` may speed up packfile creation and make the packfiles be 25 25 significantly smaller in the presence of certain filename collisions with Git's 26 26 default name-hash. 27 + + 28 + * `init.defaultRefFormat=reftable` causes newly initialized repositories to use 29 + the reftable format for storing references. This new format solves issues with 30 + case-insensitive filesystems, compresses better and performs significantly 31 + better with many use cases. Refer to Documentation/technical/reftable.adoc for 32 + more information on this new storage format. 27 33 28 34 feature.manyFiles:: 29 35 Enable config options that optimize for repos with many files in the
+12
setup.c
··· 2481 2481 goto out; 2482 2482 } 2483 2483 2484 + /* 2485 + * Enable the reftable format when "features.experimental" is enabled. 2486 + * "init.defaultRefFormat" takes precedence over this setting. 2487 + */ 2488 + if (!strcmp(key, "feature.experimental") && 2489 + cfg->ref_format == REF_STORAGE_FORMAT_UNKNOWN && 2490 + git_config_bool(key, value)) { 2491 + cfg->ref_format = REF_STORAGE_FORMAT_REFTABLE; 2492 + ret = 0; 2493 + goto out; 2494 + } 2495 + 2484 2496 ret = 0; 2485 2497 out: 2486 2498 free(str);
+34
t/t0001-init.sh
··· 749 749 test_cmp expect actual 750 750 ' 751 751 752 + test_expect_success "init with feature.experimental=true" ' 753 + test_when_finished "rm -rf refformat" && 754 + test_config_global feature.experimental true && 755 + ( 756 + sane_unset GIT_DEFAULT_REF_FORMAT && 757 + git init refformat 758 + ) && 759 + echo reftable >expect && 760 + git -C refformat rev-parse --show-ref-format >actual && 761 + test_cmp expect actual 762 + ' 763 + 764 + test_expect_success "init.defaultRefFormat overrides feature.experimental=true" ' 765 + test_when_finished "rm -rf refformat" && 766 + test_config_global feature.experimental true && 767 + test_config_global init.defaultRefFormat files && 768 + ( 769 + sane_unset GIT_DEFAULT_REF_FORMAT && 770 + git init refformat 771 + ) && 772 + echo files >expect && 773 + git -C refformat rev-parse --show-ref-format >actual && 774 + test_cmp expect actual 775 + ' 776 + 777 + test_expect_success "GIT_DEFAULT_REF_FORMAT= overrides feature.experimental=true" ' 778 + test_when_finished "rm -rf refformat" && 779 + test_config_global feature.experimental true && 780 + GIT_DEFAULT_REF_FORMAT=files git init refformat && 781 + echo files >expect && 782 + git -C refformat rev-parse --show-ref-format >actual && 783 + test_cmp expect actual 784 + ' 785 + 752 786 for from_format in $backends 753 787 do 754 788 test_expect_success "re-init with same format ($from_format)" '