git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Patrick Steinhardt <ps@pks.im>
Cc: git@vger.kernel.org,  Heghedus Razvan <heghedus.razvan@protonmail.com>
Subject: [rPATCH v2] setup: fix bug with "includeIf.onbranch" when initializing dir
Date: Wed, 22 May 2024 17:56:53 -0700	[thread overview]
Message-ID: <xmqqjzjlz6p6.fsf_-_@gitster.g> (raw)
In-Reply-To: <xmqqwmnlz7bf.fsf_-_@gitster.g> (Junio C. Hamano's message of "Wed, 22 May 2024 17:43:32 -0700")

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,

  reply	other threads:[~2024-05-23  0:56 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-21  7:54 git init BUG when gitconfig has includeIf Heghedus Razvan
2024-05-21 16:36 ` Junio C Hamano
2024-05-21 16:46   ` Heghedus Razvan
2024-05-22  8:06     ` Patrick Steinhardt
2024-05-22  8:21       ` Heghedus Razvan
2024-05-22  8:27         ` Patrick Steinhardt
2024-05-22 10:38 ` [PATCH] setup: fix bug with "includeIf.onbranch" when initializing dir Patrick Steinhardt
2024-05-22 10:58   ` Heghedus Razvan
2024-05-22 19:06     ` Junio C Hamano
2024-05-23  0:41   ` Junio C Hamano
2024-05-23  5:26     ` Patrick Steinhardt
2024-05-23  0:43   ` [PATCH v2] " Junio C Hamano
2024-05-23  0:56     ` Junio C Hamano [this message]
2024-05-23  5:26     ` Patrick Steinhardt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqqjzjlz6p6.fsf_-_@gitster.g \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=heghedus.razvan@protonmail.com \
    --cc=ps@pks.im \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).