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

Re: What's cooking in git.git (Apr 2017, #03; Tue, 18)

From
Duy Nguyen <pclouds@gmail.com>
Date
Apr 19, 2017, 09:41 UTC
Message-ID
<20170419094145.GA9051@ash>
In-Reply-To
<xmqqwpah9ci5.fsf@gitster.mtv.corp.google.com>
On Tue, Apr 18, 2017 at 10:45:22PM -0700, Junio C Hamano wrote:
Show 9 quoted lines
> * nd/conditional-config-in-early-config (2017-04-17) 3 commits
>  - config: correct file reading order in read_early_config()
>  - config: handle conditional include when $GIT_DIR is not set up
>  - config: prepare to pass more info in git_config_with_options()
> 
>  The recently introduced conditional inclusion of configuration did
>  not work well when early-config mechanism was involved.
> 
>  Will merge to 'next'.

You may want to squash this in before merging to 'next'. I think this is the last comment from Jeff.

-- 8< --
Subject: [PATCH] fixup! config: correct file reading order in read_early_config()
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
---
 t/helper/test-config.c  | 4 ----
 t/t1309-early-config.sh | 3 ++-
 2 files changed, 2 insertions(+), 5 deletions(-)
diff --git a/t/helper/test-config.c b/t/helper/test-config.c
index 696d0a52fd..8e3ed6a76c 100644
--- a/t/helper/test-config.c
+++ b/t/helper/test-config.c
@@ -84,10 +84,6 @@ int cmd_main(int argc, const char **argv)
 	struct config_set cs;
 
 	if (argc == 3 && !strcmp(argv[1], "read_early_config")) {
-		const char *cmdline_config = getenv("CMDL_CFG");
-
-		if (cmdline_config)
-			git_config_push_parameter(cmdline_config);
 		read_early_config(early_config_cb, (void *)argv[2]);
 		return 0;
 	}
diff --git a/t/t1309-early-config.sh b/t/t1309-early-config.sh
index c15f18dd96..1af8c454cf 100755
--- a/t/t1309-early-config.sh
+++ b/t/t1309-early-config.sh
@@ -47,13 +47,14 @@ test_expect_success 'ceiling #2' '
 	test xdg = "$(cat output)"
 '
 
+cmdline_config="'test.source=cmdline'"
 test_expect_success 'read config file in right order' '
 	echo "[test]source = home" >>.gitconfig &&
 	git init foo &&
 	(
 		cd foo &&
 		echo "[test]source = repo" >>.git/config &&
-		CMDL_CFG=test.source=cmdline test-config \
+		GIT_CONFIG_PARAMETERS=$cmdline_config test-config \
 			read_early_config test.source >actual &&
 		cat >expected <<-\EOF &&
 		home
-- 
2.11.0.157.gd943d85
-- 8< --
Previous: Junio C HamanoNext: Stefan Beller
Message 2 of 3 in “What's cooking in git.git (Apr 2017, #03; Tue, 18)”
  1. Junio C HamanoApr 19, 2017
  2. Duy NguyenApr 19, 2017
  3. Stefan BellerApr 19, 2017

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.