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

[rPATCH v2] setup: fix bug with "includeIf.onbranch" when initializing dir

From
Junio C Hamano <gitster@pobox.com>
Date
May 23, 2024, 00:56 UTC
Message-ID
<xmqqjzjlz6p6.fsf_-_@gitster.g>
In-Reply-To
<xmqqwmnlz7bf.fsf_-_@gitster.g>

And this is "git show --remerge-diff" output for the merge that merges the result of applying the previous patch to v2.44.0 into v2.45.0-rc0~112 (which removed the 'prev_bare_repository' thing).

The resolution of conflicts in setup.c is trivial. The change to t/t0001-init.sh is an evil one.

diff --git a/t/t0001-init.sh b/t/t0001-init.sh
index 319ed81631..49e9bf77c6 100755
--- a/t/t0001-init.sh
+++ b/t/t0001-init.sh
@@ -584,7 +584,7 @@ test_expect_success 'init with --ref-format=files' '
 	test_cmp expect actual
 '
 
-backends="files"
+backends="files reftable"
 for from_format in $backends
 do
 	test_expect_success "re-init with same format ($from_format)" '
diff --git a/setup.c b/setup.c
remerge CONFLICT (content): Merge conflict in setup.c
index 2f23ab6efa..e01462863b 100644
--- a/setup.c
+++ b/setup.c
@@ -2175,23 +2175,6 @@ int init_db(const char *git_dir, const char *real_git_dir,
 	}
 	startup_info->have_repository = 1;
 
-<<<<<<< 272fd9125a (Merge branch 'gt/core-bare-in-templates')
-	/* Ensure `core.hidedotfiles` is processed */
-	git_config(platform_core_config, NULL);
-
-	safe_create_dir(git_dir, 0);
-
-
-||||||| 3c2a3fdc38
-	/* Ensure `core.hidedotfiles` is processed */
-	git_config(platform_core_config, NULL);
-
-	safe_create_dir(git_dir, 0);
-
-	prev_bare_repository = is_bare_repository();
-
-=======
->>>>>>> 7a998665dd (setup: fix bug with "includeIf.onbranch" when initializing dir)
 	/* Check to see if the repository version is right.
 	 * Note that a newly created repository does not have
 	 * config file, so this will not fail.  What we are catching
@@ -2202,17 +2185,6 @@ int init_db(const char *git_dir, const char *real_git_dir,
 	validate_hash_algorithm(&repo_fmt, hash);
 	validate_ref_storage_format(&repo_fmt, ref_storage_format);
 
-<<<<<<< 272fd9125a (Merge branch 'gt/core-bare-in-templates')
-	reinit = create_default_files(template_dir, original_git_dir,
-				      &repo_fmt, init_shared_repository);
-
-||||||| 3c2a3fdc38
-	reinit = create_default_files(template_dir, original_git_dir,
-				      &repo_fmt, prev_bare_repository,
-				      init_shared_repository);
-
-=======
->>>>>>> 7a998665dd (setup: fix bug with "includeIf.onbranch" when initializing dir)
 	/*
 	 * Now that we have set up both the hash algorithm and the ref storage
 	 * format we can update the repository's settings accordingly.
@@ -2229,11 +2201,8 @@ int init_db(const char *git_dir, const char *real_git_dir,
 
 	safe_create_dir(git_dir, 0);
 
-	prev_bare_repository = is_bare_repository();
-
 	reinit = create_default_files(template_dir, original_git_dir,
-				      &repo_fmt, prev_bare_repository,
-				      init_shared_repository);
+				      &repo_fmt, init_shared_repository);
 
 	if (!(flags & INIT_DB_SKIP_REFDB))
 		create_reference_database(repo_fmt.ref_storage_format,
Previous: Junio C HamanoNext: Patrick Steinhardt
Message 13 of 14 in “git init BUG when gitconfig has includeIf”
  1. Heghedus RazvanMay 21, 2024
  2. Junio C HamanoMay 21, 2024
  3. Heghedus RazvanMay 21, 2024
  4. Patrick SteinhardtMay 22, 2024
  5. Heghedus RazvanMay 22, 2024
  6. Patrick SteinhardtMay 22, 2024
  7. setup: fix bug with "includeIf.onbranch" when initializing dirPatrick Steinhardt, May 22, 2024
  8. Heghedus RazvanMay 22, 2024
  9. Junio C HamanoMay 22, 2024
  10. Junio C HamanoMay 23, 2024
  11. Patrick SteinhardtMay 23, 2024
  12. setup: fix bug with "includeIf.onbranch" when initializing dirJunio C Hamano, May 23, 2024
  13. [rPATCH v2] setup: fix bug with "includeIf.onbranch" when initializing dirJunio C Hamano, May 23, 2024
  14. Patrick SteinhardtMay 23, 2024

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.