From: "Johannes Schindelin via GitGitGadget" <gitgitgadget@gmail.com>
To: git@vger.kernel.org
Cc: Patrick Steinhardt <ps@pks.im>,
Johannes Schindelin <johannes.schindelin@gmx.de>,
Johannes Schindelin <johannes.schindelin@gmx.de>
Subject: [PATCH v2 2/5] init: do parse _all_ core.* settings early
Date: Fri, 09 Jan 2026 20:05:06 +0000 [thread overview]
Message-ID: <9fee7bd16f52590c497124e81af495f76b162baf.1767989109.git.gitgitgadget@gmail.com> (raw)
In-Reply-To: <pull.2017.v2.git.1767989109.gitgitgadget@gmail.com>
From: Johannes Schindelin <johannes.schindelin@gmx.de>
In Git for Windows, `has_symlinks` is set to 0 by default. Therefore, we
need to parse the config setting `core.symlinks` to know if it has been
set to `true`. In `git init`, we must do that before copying the
templates because they might contain symbolic links.
Even if the support for symbolic links on Windows has not made it to
upstream Git yet, we really should make sure that all the `core.*`
settings are parsed before proceeding, as they might very well change
the behavior of `git init` in a way the user intended.
This fixes https://github.com/git-for-windows/git/issues/3414
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
environment.c | 4 ++--
environment.h | 2 ++
setup.c | 2 +-
3 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/environment.c b/environment.c
index a770b5921d..b65b85a01f 100644
--- a/environment.c
+++ b/environment.c
@@ -324,8 +324,8 @@ next_name:
return (current & ~negative) | positive;
}
-static int git_default_core_config(const char *var, const char *value,
- const struct config_context *ctx, void *cb)
+int git_default_core_config(const char *var, const char *value,
+ const struct config_context *ctx, void *cb)
{
/* This needs a better name */
if (!strcmp(var, "core.filemode")) {
diff --git a/environment.h b/environment.h
index 51898c99cd..e61f843fdb 100644
--- a/environment.h
+++ b/environment.h
@@ -106,6 +106,8 @@ const char *strip_namespace(const char *namespaced_ref);
int git_default_config(const char *, const char *,
const struct config_context *, void *);
+int git_default_core_config(const char *var, const char *value,
+ const struct config_context *ctx, void *cb);
/*
* TODO: All the below state either explicitly or implicitly relies on
diff --git a/setup.c b/setup.c
index 7086741e6c..42e4e7a690 100644
--- a/setup.c
+++ b/setup.c
@@ -2611,7 +2611,7 @@ int init_db(const char *git_dir, const char *real_git_dir,
* have set up the repository format such that we can evaluate
* includeIf conditions correctly in the case of re-initialization.
*/
- repo_config(the_repository, platform_core_config, NULL);
+ repo_config(the_repository, git_default_core_config, NULL);
safe_create_dir(the_repository, git_dir, 0);
--
gitgitgadget
next prev parent reply other threads:[~2026-01-09 20:05 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-16 15:33 [PATCH 0/5] Last preparations before upstreaming Git for Windows' symlink support Johannes Schindelin via GitGitGadget
2025-12-16 15:33 ` [PATCH 1/5] mingw: do resolve symlinks in `getcwd()` Johannes Schindelin via GitGitGadget
2025-12-17 14:44 ` Patrick Steinhardt
2025-12-16 15:33 ` [PATCH 2/5] init: do parse _all_ core.* settings early Johannes Schindelin via GitGitGadget
2025-12-17 14:44 ` Patrick Steinhardt
2025-12-16 15:33 ` [PATCH 3/5] strbuf_readlink(): avoid calling `readlink()` twice in corner-cases Karsten Blees via GitGitGadget
2025-12-16 15:33 ` [PATCH 4/5] strbuf_readlink(): support link targets that exceed PATH_MAX Karsten Blees via GitGitGadget
2025-12-17 14:44 ` Patrick Steinhardt
2025-12-19 8:50 ` Johannes Schindelin
2025-12-19 11:51 ` Patrick Steinhardt
2025-12-30 5:00 ` Junio C Hamano
2025-12-17 23:39 ` Junio C Hamano
2025-12-16 15:33 ` [PATCH 5/5] trim_last_path_component(): avoid hard-coding the directory separator Karsten Blees via GitGitGadget
2026-01-09 20:05 ` [PATCH v2 0/5] Last preparations before upstreaming Git for Windows' symlink support Johannes Schindelin via GitGitGadget
2026-01-09 20:05 ` [PATCH v2 1/5] mingw: do resolve symlinks in `getcwd()` Johannes Schindelin via GitGitGadget
2026-01-09 20:05 ` Johannes Schindelin via GitGitGadget [this message]
2026-01-09 20:05 ` [PATCH v2 3/5] strbuf_readlink(): avoid calling `readlink()` twice in corner-cases Karsten Blees via GitGitGadget
2026-01-09 20:05 ` [PATCH v2 4/5] strbuf_readlink(): support link targets that exceed 2*PATH_MAX Johannes Schindelin via GitGitGadget
2026-01-09 20:05 ` [PATCH v2 5/5] trim_last_path_component(): avoid hard-coding the directory separator Karsten Blees via GitGitGadget
2026-01-11 4:04 ` [PATCH v2 0/5] Last preparations before upstreaming Git for Windows' symlink support Junio C Hamano
2026-01-12 8:35 ` 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=9fee7bd16f52590c497124e81af495f76b162baf.1767989109.git.gitgitgadget@gmail.com \
--to=gitgitgadget@gmail.com \
--cc=git@vger.kernel.org \
--cc=johannes.schindelin@gmx.de \
--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