git/list[1] front-page[2] threads[3] people[4] search[5] about
 

BUG: Various "advice.*" config doesn't work

From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Date
Jan 28, 2022, 09:33 UTC
Message-ID
<220128.867dakcgj0.gmgdl@evledraar.gmail.com>

$subject, which I started looking at because in 4f3e57ef13d (submodule--helper: advise on fatal alternate error, 2019-12-02) the scaffolding was set up to read config, but nothing actually did so. So "advice.submoduleAlternateErrorStrategyDie=false" has never worked. That can be tested with:

diff --git a/t/t7408-submodule-reference.sh b/t/t7408-submodule-reference.sh
index a3892f494b6..8918be9ef5c 100755
--- a/t/t7408-submodule-reference.sh
+++ b/t/t7408-submodule-reference.sh
@@ -193,7 +193,7 @@ test_expect_success 'missing nested submodule alternate fails clone and submodul
 		cd supersuper-clone &&
 		check_that_two_of_three_alternates_are_used &&
 		# update of the submodule fails
-		test_must_fail git submodule update --init --recursive
+		git -c advice.submoduleAlternateErrorStrategyDie=false submodule update --init --recursive
 	)
 '
 
More generally, the advice API should be made to panic in
advice_if_enabled() if nothing has read the advice config, which would
turns up a lot of other such issues. I can't think of an easy way to
check for that. We could add a BUG() on:

    if (!the_repository->config && !the_repository->config->hash_initialized)

In advice_enabled(), but that wouldn't catch things that have read the
config, but which aren't actually using it to check the advice config.

Probably the inverse would be a good approach, adding a
advice.default=false to turn them all off by default, and then BUG() if
we ever end up emitting advice anywhere (except if other specific config
told us to enable it).
Next: Taylor Blau
Message 1 of 5 in “BUG: Various "advice.*" config doesn't work”
  1. Ævar Arnfjörð BjarmasonJan 28, 2022
  2. Taylor BlauJan 31, 2022
  3. Junio C HamanoJan 31, 2022
  4. Taylor BlauJan 31, 2022
  5. Junio C HamanoJan 31, 2022

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.