fsck: test & document {fetch,receive}.fsck.* config fallback

Test and document that the {fetch,receive}.fsck.* family of variables doesn't fall back on the corresponding .fsck.* variables. This was alluded to in the existing documentation by saying that "receive" looks at receive.fsck.* and "fsck" looks at fsck.* etc., but it wasn't explicitly stated that there was no fallback, and if you'd e.g. like to configure the skipList you need to do that for all three. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Ævar Arnfjörð Bjarmason committed Jul 27, 2018 at 14:37 UTC d786da1cd9c43b6747c78811a4b6ab2028dfaf50
2 files changed +36 -2
Documentation/config.txt
+12
@@ -1619,6 +1619,12 @@ The rest of the documentation discusses `fsck.*` for brevity, but the
1619 same applies for the corresponding `receive.fsck.*` and
1620 `fetch.<msg-id>.*`. variables.
1621 +
1622 +Unlike variables like `color.ui` and `core.editor` the
1623 +`receive.fsck.<msg-id>` and `fetch.fsck.<msg-id>` variables will not
1624 +fall back on the `fsck.<msg-id>` configuration if they aren't set. To
1625 +uniformly configure the same fsck settings in different circumstances
1626 +all three of them they must all set to the same values.
1627 ++
1628 When `fsck.<msg-id>` is set, errors can be switched to warnings and
1629 vice versa by configuring the `fsck.<msg-id>` setting where the
1630 `<msg-id>` is the fsck message ID and the value is one of `error`,
@@ -1642,6 +1648,12 @@ fsck.skipList::
1648 +
1649 Like `fsck.<msg-id>` this variable has corresponding
1650 `receive.fsck.skipList` and `fetch.fsck.skipList` variants.
1651 ++
1652 +Unlike variables like `color.ui` and `core.editor` the
1653 +`receive.fsck.skipList` and `fetch.fsck.skipList` variables will not
1654 +fall back on the `fsck.skipList` configuration if they aren't set. To
1655 +uniformly configure the same fsck settings in different circumstances
1656 +all three of them they must all set to the same values.
1657
1658 gc.aggressiveDepth::
1659 The depth parameter used in the delta compression
t/t5504-fetch-receive-strict.sh
+24 -2
@@ -140,8 +140,13 @@ test_expect_success 'push with receive.fsck.skipList' '
140 git init dst &&
141 git --git-dir=dst/.git config receive.fsckObjects true &&
142 test_must_fail git push --porcelain dst bogus &&
143 - git --git-dir=dst/.git config receive.fsck.skipList SKIP &&
143 echo $commit >dst/.git/SKIP &&
144 +
145 + # receive.fsck.* does not fall back on fsck.*
146 + git --git-dir=dst/.git config fsck.skipList SKIP &&
147 + test_must_fail git push --porcelain dst bogus &&
148 +
149 + git --git-dir=dst/.git config receive.fsck.skipList SKIP &&
150 git push --porcelain dst bogus
151 '
152
@@ -153,8 +158,15 @@ test_expect_success 'fetch with fetch.fsck.skipList' '
158 git init dst &&
159 git --git-dir=dst/.git config fetch.fsckObjects true &&
160 test_must_fail git --git-dir=dst/.git fetch "file://$(pwd)" $refspec &&
156 - git --git-dir=dst/.git config fetch.fsck.skipList dst/.git/SKIP &&
161 + git --git-dir=dst/.git config fetch.fsck.skipList /dev/null &&
162 + test_must_fail git --git-dir=dst/.git fetch "file://$(pwd)" $refspec &&
163 echo $commit >dst/.git/SKIP &&
164 +
165 + # fetch.fsck.* does not fall back on fsck.*
166 + git --git-dir=dst/.git config fsck.skipList dst/.git/SKIP &&
167 + test_must_fail git --git-dir=dst/.git fetch "file://$(pwd)" $refspec &&
168 +
169 + git --git-dir=dst/.git config fetch.fsck.skipList dst/.git/SKIP &&
170 git --git-dir=dst/.git fetch "file://$(pwd)" $refspec
171 '
172
@@ -166,6 +178,11 @@ test_expect_success 'push with receive.fsck.missingEmail=warn' '
178 git init dst &&
179 git --git-dir=dst/.git config receive.fsckobjects true &&
180 test_must_fail git push --porcelain dst bogus &&
181 +
182 + # receive.fsck.<msg-id> does not fall back on fsck.<msg-id>
183 + git --git-dir=dst/.git config fsck.missingEmail warn &&
184 + test_must_fail git push --porcelain dst bogus &&
185 +
186 git --git-dir=dst/.git config \
187 receive.fsck.missingEmail warn &&
188 git push --porcelain dst bogus >act 2>&1 &&
@@ -185,6 +202,11 @@ test_expect_success 'fetch with fetch.fsck.missingEmail=warn' '
202 git init dst &&
203 git --git-dir=dst/.git config fetch.fsckobjects true &&
204 test_must_fail git --git-dir=dst/.git fetch "file://$(pwd)" $refspec &&
205 +
206 + # fetch.fsck.<msg-id> does not fall back on fsck.<msg-id>
207 + git --git-dir=dst/.git config fsck.missingEmail warn &&
208 + test_must_fail git --git-dir=dst/.git fetch "file://$(pwd)" $refspec &&
209 +
210 git --git-dir=dst/.git config \
211 fetch.fsck.missingEmail warn &&
212 git --git-dir=dst/.git fetch "file://$(pwd)" $refspec >act 2>&1 &&