Skip to content

Rebase shears/seen: 2 conflict(s) (0 skipped, 2 resolved) (#23828537881)#77

Open
gitforwindowshelper[bot] wants to merge 282 commits intobase/shears/seen-23828537881from
shears/seen-23828537881
Open

Rebase shears/seen: 2 conflict(s) (0 skipped, 2 resolved) (#23828537881)#77
gitforwindowshelper[bot] wants to merge 282 commits intobase/shears/seen-23828537881from
shears/seen-23828537881

Conversation

@gitforwindowshelper
Copy link
Copy Markdown

Workflow run

Rebase Summary: seen

From: c42e0fd0ff (Don't traverse mount points in remove_dir_recurse() (git-for-windows#6151), 2026-03-31) (ed9f3f1a8b..c42e0fd0ff)

Resolved: 7653bf6 (Merge branch 'disallow-ntlm-auth-by-default', 2026-02-12)

kept both sides: retry env vars + NTLM auth disabling in http.c, both install_script lines in t/lib-httpd.sh

Range-diff
  • 1: 7653bf6 ! 1: a40e688 Merge branch 'disallow-ntlm-auth-by-default'

    @@ Commit message
     
         Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
     
    - ## Documentation/config/http.adoc ##
    -@@ Documentation/config/http.adoc: http.sslKeyType::
    - 	See also libcurl `CURLOPT_SSLKEYTYPE`. Can be overridden by the
    - 	`GIT_SSL_KEY_TYPE` environment variable.
    - 
    -+http.allowNTLMAuth::
    -+	Whether or not to allow NTLM authentication. While very convenient to set
    -+	up, and therefore still used in many on-prem scenarios, NTLM is a weak
    -+	authentication method and therefore deprecated. Defaults to "false".
    -+
    - http.schannelCheckRevoke::
    - 	Used to enforce or disable certificate revocation checks in cURL
    - 	when http.sslBackend is set to "schannel" via "true" and "false",
    -
    - ## credential.c ##
    -@@ credential.c: int credential_read(struct credential *c, FILE *fp,
    - 				credential_set_capability(&c->capa_authtype, op_type);
    - 			else if (!strcmp(value, "state"))
    - 				credential_set_capability(&c->capa_state, op_type);
    -+		} else if (!strcmp(key, "ntlm")) {
    -+			if (!strcmp(value, "allow"))
    -+				c->ntlm_allow = 1;
    - 		} else if (!strcmp(key, "continue")) {
    - 			c->multistage = !!git_config_bool("continue", value);
    - 		} else if (!strcmp(key, "password_expiry_utc")) {
    -@@ credential.c: void credential_write(const struct credential *c, FILE *fp,
    - 		if (c->ephemeral)
    - 			credential_write_item(c, fp, "ephemeral", "1", 0);
    - 	}
    -+	if (c->ntlm_suppressed)
    -+		credential_write_item(c, fp, "ntlm", "suppressed", 0);
    - 	credential_write_item(c, fp, "protocol", c->protocol, 1);
    - 	credential_write_item(c, fp, "host", c->host, 1);
    - 	credential_write_item(c, fp, "path", c->path, 0);
    -
    - ## credential.h ##
    -@@ credential.h: struct credential {
    - 	struct credential_capability capa_authtype;
    - 	struct credential_capability capa_state;
    - 
    -+	unsigned ntlm_suppressed:1,
    -+		 ntlm_allow:1;
    -+
    - 	char *username;
    - 	char *password;
    - 	char *credential;
    -
      ## http.c ##
    -@@ http.c: enum http_follow_config http_follow_config = HTTP_FOLLOW_INITIAL;
    - 
    - static struct credential cert_auth = CREDENTIAL_INIT;
    - static int ssl_cert_password_required;
    --static unsigned long http_auth_methods = CURLAUTH_ANY;
    -+static unsigned long http_auth_any = CURLAUTH_ANY & ~CURLAUTH_NTLM;
    -+static unsigned long http_auth_methods;
    - static int http_auth_methods_restricted;
    - /* Modes for which empty_auth cannot actually help us. */
    - static unsigned long empty_auth_useless =
    -@@ http.c: static int http_options(const char *var, const char *value,
    - 		return 0;
    - 	}
    - 
    -+	if (!strcmp("http.allowntlmauth", var)) {
    -+		if (git_config_bool(var, value)) {
    -+			http_auth_any |= CURLAUTH_NTLM;
    -+		} else {
    -+			http_auth_any &= ~CURLAUTH_NTLM;
    -+		}
    -+		return 0;
    -+	}
    -+
    - 	if (!strcmp("http.schannelcheckrevoke", var)) {
    - 		if (value && !strcmp(value, "best-effort")) {
    - 			http_schannel_check_revoke_mode =
    -@@ http.c: static void init_curl_http_auth(CURL *result)
    - 
    - 	credential_fill(the_repository, &http_auth, 1);
    - 
    -+	if (http_auth.ntlm_allow && !(http_auth_methods & CURLAUTH_NTLM)) {
    -+		http_auth_methods |= CURLAUTH_NTLM;
    -+		curl_easy_setopt(result, CURLOPT_HTTPAUTH, http_auth_methods);
    -+	}
    -+
    - 	if (http_auth.password) {
    - 		if (always_auth_proactively()) {
    - 			/*
    -@@ http.c: static void init_curl_proxy_auth(CURL *result)
    - 		if (i == ARRAY_SIZE(proxy_authmethods)) {
    - 			warning("unsupported proxy authentication method %s: using anyauth",
    - 					http_proxy_authmethod);
    --			curl_easy_setopt(result, CURLOPT_PROXYAUTH, CURLAUTH_ANY);
    -+			curl_easy_setopt(result, CURLOPT_PROXYAUTH, http_auth_any);
    - 		}
    - 	}
    - 	else
    --		curl_easy_setopt(result, CURLOPT_PROXYAUTH, CURLAUTH_ANY);
    -+		curl_easy_setopt(result, CURLOPT_PROXYAUTH, http_auth_any);
    - }
    - 
    - static int has_cert_password(void)
    -@@ http.c: static CURL *get_curl_handle(void)
    -     }
    - 
    - 	curl_easy_setopt(result, CURLOPT_NETRC, CURL_NETRC_OPTIONAL);
    --	curl_easy_setopt(result, CURLOPT_HTTPAUTH, CURLAUTH_ANY);
    -+	curl_easy_setopt(result, CURLOPT_HTTPAUTH, http_auth_any);
    - 
    - #ifdef CURLGSSAPI_DELEGATION_FLAG
    - 	if (curl_deleg) {
    + remerge CONFLICT (content): Merge conflict in http.c
    + index 7b4a2b5b8f..d568abd13b 100644
    + --- http.c
    + +++ http.c
     @@ http.c: void http_init(struct remote *remote, const char *url, int proactive_auth)
    + 	set_long_from_env(&curl_tcp_keepintvl, "GIT_TCP_KEEPINTVL");
    + 	set_long_from_env(&curl_tcp_keepcnt, "GIT_TCP_KEEPCNT");
    + 
    +-<<<<<<< b9cd4bf27d (Merge 'readme' into HEAD)
    + 	set_long_from_env(&http_retry_after, "GIT_HTTP_RETRY_AFTER");
      	set_long_from_env(&http_max_retries, "GIT_HTTP_MAX_RETRIES");
      	set_long_from_env(&http_max_retry_time, "GIT_HTTP_MAX_RETRY_TIME");
    - 
    -+	http_auth_methods = http_auth_any;
    +-=======
     +
    + 	http_auth_methods = http_auth_any;
    +->>>>>>> 816db62d10 (credential: advertise NTLM suppression and allow helpers to re-enable)
    + 
      	curl_default = get_curl_handle();
      }
    - 
    -@@ http.c: static int handle_curl_result(struct slot_results *results)
    - 	} else if (missing_target(results))
    - 		return HTTP_MISSING_TARGET;
    - 	else if (results->http_code == 401) {
    -+		http_auth.ntlm_suppressed = (results->auth_avail & CURLAUTH_NTLM) &&
    -+					    !(http_auth_any & CURLAUTH_NTLM);
    -+		if (http_auth.ntlm_suppressed && http_auth.ntlm_allow) {
    -+			http_auth_methods |= CURLAUTH_NTLM;
    -+			return HTTP_REAUTH;
    -+		}
    - 		if ((http_auth.username && http_auth.password) ||\
    - 		    (http_auth.authtype && http_auth.credential)) {
    - 			if (http_auth.multistage) {
    -@@ http.c: static int handle_curl_result(struct slot_results *results)
    - 			credential_reject(the_repository, &http_auth);
    - 			if (always_auth_proactively())
    - 				http_proactive_auth = PROACTIVE_AUTH_NONE;
    -+			if (http_auth.ntlm_suppressed) {
    -+				warning(_("Due to its cryptographic weaknesses, "
    -+					  "NTLM authentication has been\n"
    -+					  "disabled in Git by default. You can "
    -+					  "re-enable it for trusted servers\n"
    -+					  "by running:\n\n"
    -+					  "git config set "
    -+					  "http.%s://%s.allowNTLMAuth true"),
    -+					http_auth.protocol, http_auth.host);
    -+			}
    - 			return HTTP_NOAUTH;
    - 		} else {
    - 			http_auth_methods &= ~CURLAUTH_GSSNEGOTIATE;
     
      ## t/lib-httpd.sh ##
    + remerge CONFLICT (content): Merge conflict in t/lib-httpd.sh
    + index d7e992dc28..7150a2a2f2 100644
    + --- t/lib-httpd.sh
    + +++ t/lib-httpd.sh
     @@ t/lib-httpd.sh: prepare_httpd() {
    + 	install_script error.sh
      	install_script apply-one-time-script.sh
      	install_script nph-custom-auth.sh
    +-<<<<<<< b9cd4bf27d (Merge 'readme' into HEAD)
      	install_script http-429.sh
    -+	install_script ntlm-handshake.sh
    +-=======
    + 	install_script ntlm-handshake.sh
    +->>>>>>> 816db62d10 (credential: advertise NTLM suppression and allow helpers to re-enable)
      
      	ln -s "$LIB_HTTPD_MODULE_PATH" "$HTTPD_ROOT_PATH/modules"
      
    -
    - ## t/lib-httpd/apache.conf ##
    -@@ t/lib-httpd/apache.conf: SetEnv PERL_PATH ${PERL_PATH}
    - 	CGIPassAuth on
    - 	</IfDefine>
    - </LocationMatch>
    -+<LocationMatch /ntlm_auth/>
    -+	SetEnv GIT_EXEC_PATH ${GIT_EXEC_PATH}
    -+	SetEnv GIT_HTTP_EXPORT_ALL
    -+	<IfDefine USE_CGIPASSAUTH>
    -+	CGIPassAuth on
    -+	</IfDefine>
    -+</LocationMatch>
    - ScriptAlias /smart/incomplete_length/git-upload-pack incomplete-length-upload-pack-v2-http.sh/
    - ScriptAlias /smart/incomplete_body/git-upload-pack incomplete-body-upload-pack-v2-http.sh/
    - ScriptAlias /smart/no_report/git-receive-pack error-no-report.sh/
    -@@ t/lib-httpd/apache.conf: ScriptAlias /error/ error.sh/
    - ScriptAliasMatch /one_time_script/(.*) apply-one-time-script.sh/$1
    - ScriptAliasMatch /http_429/(.*) http-429.sh/$1
    - ScriptAliasMatch /custom_auth/(.*) nph-custom-auth.sh/$1
    -+ScriptAliasMatch /ntlm_auth/(.*) ntlm-handshake.sh/$1
    - <Directory ${GIT_EXEC_PATH}>
    - 	Options FollowSymlinks
    - </Directory>
    -
    - ## t/lib-httpd/ntlm-handshake.sh (new) ##
    -@@
    -+#!/bin/sh
    -+
    -+case "$HTTP_AUTHORIZATION" in
    -+'')
    -+	# No Authorization header -> send NTLM challenge
    -+	echo "Status: 401 Unauthorized"
    -+	echo "WWW-Authenticate: NTLM"
    -+	echo
    -+	;;
    -+"NTLM TlRMTVNTUAAB"*)
    -+	# Type 1 -> respond with Type 2 challenge (hardcoded)
    -+	echo "Status: 401 Unauthorized"
    -+	# Base64-encoded version of the Type 2 challenge:
    -+	# signature: 'NTLMSSP\0'
    -+	# message_type: 2
    -+	# target_name: 'NTLM-GIT-SERVER'
    -+	# flags: 0xa2898205 =
    -+	#   NEGOTIATE_UNICODE, REQUEST_TARGET, NEGOTIATE_NT_ONLY,
    -+	#   TARGET_TYPE_SERVER, TARGET_TYPE_SHARE, REQUEST_NON_NT_SESSION_KEY,
    -+	#   NEGOTIATE_VERSION, NEGOTIATE_128, NEGOTIATE_56
    -+	# challenge: 0xfa3dec518896295b
    -+	# context: '0000000000000000'
    -+	# target_info_present: true
    -+	# target_info_len: 128
    -+	# version: '10.0 (build 19041)'
    -+	echo "WWW-Authenticate: NTLM TlRMTVNTUAACAAAAHgAeADgAAAAFgomi+j3sUYiWKVsAAAAAAAAAAIAAgABWAAAACgBhSgAAAA9OAFQATABNAC0ARwBJAFQALQBTAEUAUgBWAEUAUgACABIAVwBPAFIASwBHAFIATwBVAFAAAQAeAE4AVABMAE0ALQBHAEkAVAAtAFMARQBSAFYARQBSAAQAEgBXAE8AUgBLAEcAUgBPAFUAUAADAB4ATgBUAEwATQAtAEcASQBUAC0AUwBFAFIAVgBFAFIABwAIAACfOcZKYNwBAAAAAA=="
    -+	echo
    -+	;;
    -+"NTLM TlRMTVNTUAAD"*)
    -+	# Type 3 -> accept without validation
    -+	exec "$GIT_EXEC_PATH"/git-http-backend
    -+	;;
    -+*)
    -+	echo "Status: 500 Unrecognized"
    -+	echo
    -+	echo "Unhandled auth: '$HTTP_AUTHORIZATION'"
    -+	;;
    -+esac
    -
    - ## t/t5563-simple-http-auth.sh ##
    -@@ t/t5563-simple-http-auth.sh: test_expect_success 'access using three-legged auth' '
    - 	EOF
    - '
    - 
    -+test_lazy_prereq NTLM 'curl --version | grep -q NTLM'
    -+
    -+test_expect_success NTLM 'access using NTLM auth' '
    -+	test_when_finished "per_test_cleanup" &&
    -+
    -+	set_credential_reply get <<-EOF &&
    -+	username=user
    -+	password=pwd
    -+	EOF
    -+
    -+	test_config_global credential.helper test-helper &&
    -+	test_must_fail env GIT_TRACE_CURL=1 git \
    -+		ls-remote "$HTTPD_URL/ntlm_auth/repo.git" 2>err &&
    -+	test_grep "allowNTLMAuth" err &&
    -+
    -+	# Can be enabled via config
    -+	GIT_TRACE_CURL=1 git -c http.$HTTPD_URL.allowNTLMAuth=true \
    -+		ls-remote "$HTTPD_URL/ntlm_auth/repo.git" &&
    -+
    -+	# Or via credential helper responding with ntlm=allow
    -+	set_credential_reply get <<-EOF &&
    -+	username=user
    -+	password=pwd
    -+	ntlm=allow
    -+	EOF
    -+
    -+	git ls-remote "$HTTPD_URL/ntlm_auth/repo.git"
    -+'
    -+
    - test_done

Resolved: cb6326f (mingw: use strftime() directly in UCRT builds (git-for-windows#6130), 2026-03-25)

Resolved merge replay conflicts by keeping HEAD (ours) for all 8 conflicting files; the merge commit only changes git-svn/mingw files and has no modifications to the conflicting files

Range-diff
  • 1: cb6326f ! 1: 820cdfe mingw: use strftime() directly in UCRT builds (mingw: use strftime() directly in UCRT builds git#6130)

    @@ Commit message
         since ec47a33fd2c3b679c3d8cbd440752414adb56ce9, i.e. for a _really_ long
         time.
     
    - ## Documentation/git-svn.adoc ##
    -@@ Documentation/git-svn.adoc: SYNOPSIS
    - --------
    - [verse]
    - 'git svn' <command> [<options>] [<arguments>]
    -+(UNSUPPORTED!)
    - 
    - DESCRIPTION
    - -----------
    + ## Documentation/config/sideband.adoc ##
    + remerge CONFLICT (add/add): Merge conflict in Documentation/config/sideband.adoc
    + index 0f479eca76..ddba93393c 100644
    + --- Documentation/config/sideband.adoc
    + +++ Documentation/config/sideband.adoc
    +@@
    + sideband.allowControlCharacters::
    +-<<<<<<< c54cba66a9 (`git svn`: remove deprecation note (since it is no longer included in Git for Windows, anyway) (#6142))
    + ifdef::with-breaking-changes[]
    + 	By default, control characters that are delivered via the sideband
    + 	are masked, except ANSI color sequences. This prevents potentially
    +@@ Documentation/config/sideband.adoc: endif::with-breaking-changes[]
    + sideband.<url>.*::
    + 	Apply the `sideband.*` option selectively to specific URLs. The
    + 	same URL matching logic applies as for `http.<url>.*` settings.
    +-=======
    +-	By default, control characters that are delivered via the sideband
    +-	are masked, except ANSI color sequences. This prevents potentially
    +-	unwanted ANSI escape sequences from being sent to the terminal. Use
    +-	this config setting to override this behavior:
    +-+
    +---
    +-	color::
    +-		Allow ANSI color sequences, line feeds and horizontal tabs,
    +-		but mask all other control characters. This is the default.
    +-	false::
    +-		Mask all control characters other than line feeds and
    +-		horizontal tabs.
    +-	true::
    +-		Allow all control characters to be sent to the terminal.
    +---
    +->>>>>>> 1253fdbf0c (mingw: use strftime() directly in UCRT builds)
     
    - ## compat/mingw.c ##
    -@@ compat/mingw.c: int mingw_utime (const char *file_name, const struct utimbuf *times)
    - size_t mingw_strftime(char *s, size_t max,
    - 		      const char *format, const struct tm *tm)
    - {
    -+#ifdef _UCRT
    -+	size_t ret = strftime(s, max, format, tm);
    -+#else
    - 	/* a pointer to the original strftime in case we can't find the UCRT version */
    - 	static size_t (*fallback)(char *, size_t, const char *, const struct tm *) = strftime;
    - 	size_t ret;
    -@@ compat/mingw.c: size_t mingw_strftime(char *s, size_t max,
    - 		ret = strftime(s, max, format, tm);
    - 	else
    - 		ret = fallback(s, max, format, tm);
    -+#endif
    - 
    - 	if (!ret && errno == EINVAL)
    - 		die("invalid strftime format: '%s'", format);
    + ## builtin/reset.c ##
    + remerge CONFLICT (content): Merge conflict in builtin/reset.c
    + index 792458b9fc..8e3c8509d7 100644
    + --- builtin/reset.c
    + +++ builtin/reset.c
    +@@ builtin/reset.c: int cmd_reset(int argc,
    + 	struct object_id oid;
    + 	struct pathspec pathspec;
    + 	int intent_to_add = 0;
    +-<<<<<<< c54cba66a9 (`git svn`: remove deprecation note (since it is no longer included in Git for Windows, anyway) (#6142))
    + 	struct interactive_options interactive_opts = INTERACTIVE_OPTIONS_INIT;
    +-=======
    +-	struct add_p_opt add_p_opt = ADD_P_OPT_INIT;
    +->>>>>>> 1253fdbf0c (mingw: use strftime() directly in UCRT builds)
    + 	int nul_term_line = 0, read_from_stdin = 0;
    + 	const struct option options[] = {
    + 		OPT__QUIET(&quiet, N_("be quiet, only report errors")),
     
    - ## git-svn.perl ##
    -@@ git-svn.perl: sub term_init {
    - 			: new Term::ReadLine 'git-svn';
    - }
    + ## git-curl-compat.h ##
    + remerge CONFLICT (content): Merge conflict in git-curl-compat.h
    + index 79ee560c80..5c8ceb076a 100644
    + --- git-curl-compat.h
    + +++ git-curl-compat.h
    +@@
    + #endif
      
    -+sub deprecated_warning {
    -+    my @lines = @_;
    -+    if (-t STDERR) {
    -+        @lines = map { "\e[33m$_\e[0m" } @lines;
    -+    }
    -+    warn join("\n", @lines), "\n";
    -+}
    -+
    -+deprecated_warning(
    -+	"WARNING: \`git svn\` is no longer supported by the Git for Windows project.",
    -+	"See https://github.com/git-for-windows/git/issues/5405 for details."
    -+);
    -+
    - my $cmd;
    - for (my $i = 0; $i < @ARGV; $i++) {
    - 	if (defined $cmd{$ARGV[$i]}) {
    + /**
    +-<<<<<<< c54cba66a9 (`git svn`: remove deprecation note (since it is no longer included in Git for Windows, anyway) (#6142))
    +  * CURLINFO_RETRY_AFTER was added in 7.66.0, released in September 2019.
    +  * It allows curl to automatically parse Retry-After headers.
    +  */
    +@@
    + #endif
    + 
    + /**
    +-=======
    +->>>>>>> 1253fdbf0c (mingw: use strftime() directly in UCRT builds)
    +  * CURLSSLOPT_AUTO_CLIENT_CERT was added in 7.77.0, released in May
    +  * 2021.
    +  */
     
    - ## t/t9108-git-svn-glob.sh ##
    -@@ t/t9108-git-svn-glob.sh: test_expect_success 'test disallow multi-globs' '
    - 		svn_cmd commit -m "try to try"
    - 	) &&
    - 	test_must_fail git svn fetch three 2> stderr.three &&
    --	test_cmp expect.three stderr.three
    -+	sed "/^WARNING.*no.* supported/{N;d}" <stderr.three >stderr.three.clean &&
    -+	test_cmp expect.three stderr.three.clean
    - 	'
    + ## http.c ##
    + remerge CONFLICT (content): Merge conflict in http.c
    + index 9af8641f58..5bc2ad8b87 100644
    + --- http.c
    + +++ http.c
    +@@ http.c: static long http_schannel_check_revoke_mode =
    + 	CURLSSLOPT_NO_REVOKE;
    + #endif
      
    - test_done
    +-<<<<<<< c54cba66a9 (`git svn`: remove deprecation note (since it is no longer included in Git for Windows, anyway) (#6142))
    + static long http_retry_after = 0;
    + static long http_max_retries = 0;
    + static long http_max_retry_time = 300;
    + 
    +-=======
    +->>>>>>> 1253fdbf0c (mingw: use strftime() directly in UCRT builds)
    + /*
    +  * With the backend being set to `schannel`, setting sslCAinfo would override
    +  * the Certificate Store in cURL v7.60.0 and later, which is not what we want
     
    - ## t/t9109-git-svn-multi-glob.sh ##
    -@@ t/t9109-git-svn-multi-glob.sh: test_expect_success 'test disallow multiple globs' '
    - 		svn_cmd commit -m "try to try"
    - 	) &&
    - 	test_must_fail git svn fetch three 2> stderr.three &&
    --	test_cmp expect.three stderr.three
    -+	sed "/^WARNING.*no.* supported/{N;d}" <stderr.three >stderr.three.clean &&
    -+	test_cmp expect.three stderr.three.clean
    - 	'
    + ## refs/reftable-backend.c ##
    + remerge CONFLICT (content): Merge conflict in refs/reftable-backend.c
    + index 4357063190..23b18837c8 100644
    + --- refs/reftable-backend.c
    + +++ refs/reftable-backend.c
    +@@ refs/reftable-backend.c: static struct ref_store *reftable_be_init(struct repository *repo,
    + 	mask = umask(0);
    + 	umask(mask);
      
    - test_done
    +-<<<<<<< c54cba66a9 (`git svn`: remove deprecation note (since it is no longer included in Git for Windows, anyway) (#6142))
    + 	refs_compute_filesystem_location(gitdir, payload, &is_worktree, &refdir,
    + 					 &ref_common_dir);
    + 
    + 	reftable_set_alloc(malloc, realloc, free);
    + 	base_ref_store_init(&refs->base, repo, refdir.buf, &refs_be_reftable);
    +-=======
    +-	reftable_set_alloc(malloc, realloc, free);
    +-	base_ref_store_init(&refs->base, repo, gitdir, &refs_be_reftable);
    +->>>>>>> 1253fdbf0c (mingw: use strftime() directly in UCRT builds)
    + 	strmap_init(&refs->worktree_backends);
    + 	refs->store_flags = store_flags;
    + 	refs->log_all_ref_updates = repo_settings_get_log_all_ref_updates(repo);
     
    - ## t/t9168-git-svn-partially-globbed-names.sh ##
    -@@ t/t9168-git-svn-partially-globbed-names.sh: test_expect_success 'test disallow prefixed multi-globs' '
    - 		svn_cmd commit -m "try to try"
    - 	) &&
    - 	test_must_fail git svn fetch four 2>stderr.four &&
    --	test_cmp expect.four stderr.four &&
    -+	sed "/^WARNING.*no.* supported/{N;d}" <stderr.four >stderr.four.clean &&
    -+	test_cmp expect.four stderr.four.clean &&
    - 	git config --unset svn-remote.four.branches &&
    - 	git config --unset svn-remote.four.tags
    - 	'
    -@@ t/t9168-git-svn-partially-globbed-names.sh: test_expect_success 'test disallow multiple asterisks in one word' '
    - 		svn_cmd commit -m "try to try"
    - 	) &&
    - 	test_must_fail git svn fetch six 2>stderr.six &&
    --	test_cmp expect.six stderr.six
    -+	sed "/^WARNING.*no.* supported/{N;d}" <stderr.six >stderr.six.clean &&
    -+	test_cmp expect.six stderr.six.clean
    - 	'
    + ## sideband.c ##
    + remerge CONFLICT (content): Merge conflict in sideband.c
    + index 9a0c6bd1e0..26e5bbd4b5 100644
    + --- sideband.c
    + +++ sideband.c
    +@@ sideband.c: static struct keyword_entry keywords[] = {
    + };
    + 
    + static enum {
    +-<<<<<<< c54cba66a9 (`git svn`: remove deprecation note (since it is no longer included in Git for Windows, anyway) (#6142))
    + 	ALLOW_CONTROL_SEQUENCES_UNSET = -1,
    + 	ALLOW_NO_CONTROL_CHARACTERS   = 0,
    + 	ALLOW_ANSI_COLOR_SEQUENCES    = 1<<0,
    +@@ sideband.c: void sideband_apply_url_config(const char *url)
    + 	string_list_clear(&config.vars, 1);
    + 	urlmatch_config_release(&config);
    + }
    +-=======
    +-	ALLOW_NO_CONTROL_CHARACTERS = 0,
    +-	ALLOW_ALL_CONTROL_CHARACTERS = 1,
    +-	ALLOW_ANSI_COLOR_SEQUENCES = 2
    +-} allow_control_characters = ALLOW_ANSI_COLOR_SEQUENCES;
    +->>>>>>> 1253fdbf0c (mingw: use strftime() directly in UCRT builds)
    + 
    + /* Returns a color setting (GIT_COLOR_NEVER, etc). */
    + static enum git_colorbool use_sideband_colors(void)
    +@@ sideband.c: static enum git_colorbool use_sideband_colors(void)
    + 	if (use_sideband_colors_cached != GIT_COLOR_UNKNOWN)
    + 		return use_sideband_colors_cached;
    + 
    +-<<<<<<< c54cba66a9 (`git svn`: remove deprecation note (since it is no longer included in Git for Windows, anyway) (#6142))
    + 	if (allow_control_characters == ALLOW_CONTROL_SEQUENCES_UNSET) {
    + 		if (!repo_config_get_value(the_repository, "sideband.allowcontrolcharacters", &value))
    + 			sideband_allow_control_characters_config("sideband.allowcontrolcharacters", value);
    + 
    + 		if (allow_control_characters == ALLOW_CONTROL_SEQUENCES_UNSET)
    + 			allow_control_characters = ALLOW_DEFAULT_ANSI_SEQUENCES;
    +-=======
    +-	switch (repo_config_get_maybe_bool(the_repository, "sideband.allowcontrolcharacters", &i)) {
    +-	case 0: /* Boolean value */
    +-		allow_control_characters = i ? ALLOW_ALL_CONTROL_CHARACTERS :
    +-			ALLOW_NO_CONTROL_CHARACTERS;
    +-		break;
    +-	case -1: /* non-Boolean value */
    +-		if (repo_config_get_string_tmp(the_repository, "sideband.allowcontrolcharacters",
    +-					      &value))
    +-			; /* huh? `get_maybe_bool()` returned -1 */
    +-		else if (!strcmp(value, "color"))
    +-			allow_control_characters = ALLOW_ANSI_COLOR_SEQUENCES;
    +-		else
    +-			warning(_("unrecognized value for `sideband."
    +-				  "allowControlCharacters`: '%s'"), value);
    +-		break;
    +-	default:
    +-		break; /* not configured */
    +->>>>>>> 1253fdbf0c (mingw: use strftime() directly in UCRT builds)
    + 	}
    + 
    + 	if (!repo_config_get_string_tmp(the_repository, key, &value))
    +@@ sideband.c: void list_config_color_sideband_slots(struct string_list *list, const char *pref
    + 		list_config_item(list, prefix, keywords[i].keyword);
    + }
    + 
    +-<<<<<<< c54cba66a9 (`git svn`: remove deprecation note (since it is no longer included in Git for Windows, anyway) (#6142))
    + static int handle_ansi_sequence(struct strbuf *dest, const char *src, int n)
    +-=======
    +-static int handle_ansi_color_sequence(struct strbuf *dest, const char *src, int n)
    +->>>>>>> 1253fdbf0c (mingw: use strftime() directly in UCRT builds)
    + {
    + 	int i;
    + 
    +@@ sideband.c: static int handle_ansi_color_sequence(struct strbuf *dest, const char *src, int
    + 	 * Valid ANSI color sequences are of the form
    + 	 *
    + 	 * ESC [ [<n> [; <n>]*] m
    +-<<<<<<< c54cba66a9 (`git svn`: remove deprecation note (since it is no longer included in Git for Windows, anyway) (#6142))
    + 	 *
    + 	 * These are part of the Select Graphic Rendition sequences which
    + 	 * contain more than just color sequences, for more details see
    +@@ sideband.c: static int handle_ansi_color_sequence(struct strbuf *dest, const char *src, int
    + 		     strchr("ABCDEFGHf", src[i])) ||
    + 		    ((allow_control_characters & ALLOW_ANSI_ERASE) &&
    + 		     strchr("JKMPX", src[i]))) {
    +-=======
    +-	 */
    +-
    +-	if (allow_control_characters != ALLOW_ANSI_COLOR_SEQUENCES ||
    +-	    n < 3 || src[0] != '\x1b' || src[1] != '[')
    +-		return 0;
    +-
    +-	for (i = 2; i < n; i++) {
    +-		if (src[i] == 'm') {
    +->>>>>>> 1253fdbf0c (mingw: use strftime() directly in UCRT builds)
    + 			strbuf_add(dest, src, i + 1);
    + 			return i;
    + 		}
    +@@ sideband.c: static void strbuf_add_sanitized(struct strbuf *dest, const char *src, int n)
    + {
    + 	int i;
    + 
    +-<<<<<<< c54cba66a9 (`git svn`: remove deprecation note (since it is no longer included in Git for Windows, anyway) (#6142))
    + 	if ((allow_control_characters & ALLOW_ALL_CONTROL_CHARACTERS)) {
    +-=======
    +-	if (allow_control_characters == ALLOW_ALL_CONTROL_CHARACTERS) {
    +->>>>>>> 1253fdbf0c (mingw: use strftime() directly in UCRT builds)
    + 		strbuf_add(dest, src, n);
    + 		return;
    + 	}
    + 
    + 	strbuf_grow(dest, n);
    + 	for (; n && *src; src++, n--) {
    +-<<<<<<< c54cba66a9 (`git svn`: remove deprecation note (since it is no longer included in Git for Windows, anyway) (#6142))
    + 		if (!iscntrl(*src) || *src == '\t' || *src == '\n') {
    + 			strbuf_addch(dest, *src);
    + 		} else if (allow_control_characters != ALLOW_NO_CONTROL_CHARACTERS &&
    + 			   (i = handle_ansi_sequence(dest, src, n))) {
    +-=======
    +-		if (!iscntrl(*src) || *src == '\t' || *src == '\n')
    +-			strbuf_addch(dest, *src);
    +-		else if ((i = handle_ansi_color_sequence(dest, src, n))) {
    +->>>>>>> 1253fdbf0c (mingw: use strftime() directly in UCRT builds)
    + 			src += i;
    + 			n -= i;
    + 		} else {
    + 			strbuf_addch(dest, '^');
    +-<<<<<<< c54cba66a9 (`git svn`: remove deprecation note (since it is no longer included in Git for Windows, anyway) (#6142))
    + 			strbuf_addch(dest, *src == 0x7f ? '?' : 0x40 + *src);
    +-=======
    +-			strbuf_addch(dest, 0x40 + *src);
    +->>>>>>> 1253fdbf0c (mingw: use strftime() directly in UCRT builds)
    + 		}
    + 	}
    + }
    +
    + ## t/meson.build ##
    + remerge CONFLICT (content): Merge conflict in t/meson.build
    + index 78542cec7e..25272d7ae4 100644
    + --- t/meson.build
    + +++ t/meson.build
    +@@ t/meson.build: integration_tests = [
    +   't7422-submodule-output.sh',
    +   't7423-submodule-symlinks.sh',
    +   't7424-submodule-mixed-ref-formats.sh',
    +-<<<<<<< c54cba66a9 (`git svn`: remove deprecation note (since it is no longer included in Git for Windows, anyway) (#6142))
    +   't7425-submodule-gitdir-path-extension.sh',
    +   't7426-submodule-get-default-remote.sh',
    +-=======
    +->>>>>>> 1253fdbf0c (mingw: use strftime() directly in UCRT builds)
    +   't7429-submodule-long-path.sh',
    +   't7450-bad-git-dotfiles.sh',
    +   't7500-commit-template-squash-signoff.sh',
    +
    + ## t/t5409-colorize-remote-messages.sh ##
    + remerge CONFLICT (content): Merge conflict in t/t5409-colorize-remote-messages.sh
    + index 31ae4430ec..07cbc62736 100755
    + --- t/t5409-colorize-remote-messages.sh
    + +++ t/t5409-colorize-remote-messages.sh
    +@@ t/t5409-colorize-remote-messages.sh: test_expect_success 'fallback to color.ui' '
    + 	grep "<BOLD;RED>error<RESET>: error" decoded
    + '
    + 
    +-<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< c54cba66a9 (`git svn`: remove deprecation note (since it is no longer included in Git for Windows, anyway) (#6142))
    + if test_have_prereq WITH_BREAKING_CHANGES
    + then
    + 	TURN_ON_SANITIZING=already.turned=on
    +@@ t/t5409-colorize-remote-messages.sh: else
    + 	TURN_ON_SANITIZING=sideband.allowControlCharacters=color
    + fi
    + 
    +-================================
    +->>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 1253fdbf0c (mingw: use strftime() directly in UCRT builds)
    + test_expect_success 'disallow (color) control sequences in sideband' '
    + 	write_script .git/color-me-surprised <<-\EOF &&
    + 	printf "error: Have you \\033[31mread\\033[m this?\\a\\n" >&2
    + 	exec "$@"
    + 	EOF
    +-<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< c54cba66a9 (`git svn`: remove deprecation note (since it is no longer included in Git for Windows, anyway) (#6142))
    + 	test_config_global uploadPack.packObjectsHook ./color-me-surprised &&
    + 	test_commit need-at-least-one-commit &&
    + 
    + 	git -c $TURN_ON_SANITIZING clone --no-local . throw-away 2>stderr &&
    +-================================
    +-	test_config_global uploadPack.packObjectshook ./color-me-surprised &&
    +-	test_commit need-at-least-one-commit &&
    +-
    +-	git clone --no-local . throw-away 2>stderr &&
    +->>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 1253fdbf0c (mingw: use strftime() directly in UCRT builds)
    + 	test_decode_color <stderr >decoded &&
    + 	test_grep RED decoded &&
    + 	test_grep "\\^G" stderr &&
    +@@ t/t5409-colorize-remote-messages.sh: test_expect_success 'disallow (color) control sequences in sideband' '
    + 	test_file_not_empty actual
    + '
    + 
    +-<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< c54cba66a9 (`git svn`: remove deprecation note (since it is no longer included in Git for Windows, anyway) (#6142))
    + test_decode_csi() {
    + 	awk '{
    + 		while (match($0, /\033/) != 0) {
    +@@ t/t5409-colorize-remote-messages.sh: test_expect_success 'allow all control sequences for a specific URL' '
    + 	test_grep ! "\\^\\[\\[K" decoded
    + '
      
    +-================================
    +->>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 1253fdbf0c (mingw: use strftime() directly in UCRT builds)
      test_done

To: 24c3da7b70 (Don't traverse mount points in remove_dir_recurse() (git-for-windows#6151), 2026-03-31) (68992a01ba..24c3da7b70)

Statistics

Metric Count
Total conflicts 2
Skipped (upstreamed) 0
Resolved surgically 2
Range-diff (click to expand)

dennisameling and others added 30 commits April 1, 2026 02:11
Signed-off-by: Dennis Ameling <dennis@dennisameling.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
The CMakeSettings.json file is tool generated. Developers may track it
should they provide additional settings.

Signed-off-by: Philip Oakley <philipoakley@iee.email>
Just like the `hash-object --literally` code path, the `--stdin` code
path also needs to use `size_t` instead of `unsigned long` to represent
memory sizes, otherwise it would cause problems on platforms using the
LLP64 data model (such as Windows).

To limit the scope of the test case, the object is explicitly not
written to the object store, nor are any filters applied.

The `big` file from the previous test case is reused to save setup time;
To avoid relying on that side effect, it is generated if it does not
exist (e.g. when running via `sh t1007-*.sh --long --run=1,41`).

Signed-off-by: Philip Oakley <philipoakley@iee.email>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
MSYS2 defines some helpful environment variables, e.g. `MSYSTEM`. There
is code in Git for Windows to ensure that that `MSYSTEM` variable is
set, hard-coding a default.

However, the existing solution jumps through hoops to reconstruct the
proper default, and is even incomplete doing so, as we found out when we
extended it to support CLANGARM64.

This is absolutely unnecessary because there is already a perfectly
valid `MSYSTEM` value we can use at build time. This is even true when
building the MINGW32 variant on a MINGW64 system because `makepkg-mingw`
will override the `MSYSTEM` value as per the `MINGW_ARCH` array.

The same is equally true for the `/mingw64`, `/mingw32` and
`/clangarm64` prefix: those values are already available via the
`MINGW_PREFIX` environment variable, and we just need to pass that
setting through.

Only when `MINGW_PREFIX` is not set (as is the case in Git for Windows'
minimal SDK, where only `MSYSTEM` is guaranteed to be set correctly), we
use as fall-back the top-level directory whose name is the down-cased
value of the `MSYSTEM` variable.

Incidentally, this also broadens the support to all the configurations
supported by the MSYS2 project, i.e. clang64 & ucrt64, too.

Note: This keeps the same, hard-coded MSYSTEM platform support for CMake
as before, but drops it for Meson (because it is unclear how Meson could
do this in a more flexible manner).

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Some platforms (e.g. Windows) provide API functions to resolve paths
much quicker. Let's offer a way to short-cut `strbuf_realpath()` on
those platforms.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
When we commit the template directory as part of `make vcxproj`, the
`branches/` directory is not actually commited, as it is empty.

Two tests were not prepared for that situation.

This developer tried to get rid of the support for `.git/branches/` a
long time ago, but that effort did not bear fruit, so the best we can do
is work around in these here tests.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
The vcpkg_install batch file depends on the availability of a
working Git on the CMD path. This may not be present if the user
has selected the 'bash only' option during Git-for-Windows install.

Detect and tell the user about their lack of a working Git in the CMD
window.

Fixes git-for-windows#2348.
A separate PR git-for-windows/build-extra#258
now highlights the recommended path setting during install.

Signed-off-by: Philip Oakley <philipoakley@iee.email>
There are no Windows/ARM64 agents in GitHub Actions yet, therefore we
just skip adjusting the `vs-test` job for now.

Signed-off-by: Dennis Ameling <dennis@dennisameling.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
The intention of this change is to align with how the top-level git
`Makefile` defines its own test target (which also internally calls
`$(MAKE) -C t/ all`). This change also ensures the consistency of
`make -C contrib/subtree test` with other testing in CI executions
(which rely on `$DEFAULT_TEST_TARGET` being defined as `prove`).

Signed-off-by: Victoria Dye <vdye@github.com>
In Git-for-Windows, work on using ARM64 has progressed. The
commit 2d94b77 (cmake: allow building for Windows/ARM64, 2020-12-04)
failed to notice that /compat/vcbuild/vcpkg_install.bat will default to
using the "x64-windows" architecture for the vcpkg installation if not set,
but CMake is not told of this default. Commit 635b6d9 (vcbuild: install
ARM64 dependencies when building ARM64 binaries, 2020-01-31) later updated
vcpkg_install.bat to accept an arch (%1) parameter, but retained the default.

This default is neccessary for the use case where the project directory is
opened directly in Visual Studio, which will find and build a CMakeLists.txt
file without any parameters, thus expecting use of the default setting.

Also Visual studio will generate internal .sln solution and .vcxproj project
files needed for some extension tools. Inform users of the additional
.sln/.vcxproj generation.

** How to test:
 rm -rf '.vs' # remove old visual studio settings
 rm -rf 'compat/vcbuild/vcpkg' # remove any vcpkg downloads
 rm -rf 'contrib/buildsystems/out' # remove builds & CMake artifacts
 with a fresh Visual Studio Community Edition, File>>Open>>(git *folder*)
   to load the project (which will take some time!).
 check for successful compilation.
The implicit .sln (etc.) are in the hidden .vs directory created by
Visual Studio.

Signed-off-by: Philip Oakley <philipoakley@iee.email>
To complement the `--stdin` and `--literally` test cases that verify
that we can hash files larger than 4GB on 64-bit platforms using the
LLP64 data model, here is a test case that exercises `hash-object`
_without_ any options.

Just as before, we use the `big` file from the previous test case if it
exists to save on setup time, otherwise generate it.

Signed-off-by: Philip Oakley <philipoakley@iee.email>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Derrick Stolee <derrickstolee@github.com>
Special-casing even more configurations simply does not make sense.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Update clink.pl to link with either libcurl.lib or libcurl-d.lib
depending on whether DEBUG=1 is set.

Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
There is a Win32 API function to resolve symbolic links, and we can use
that instead of resolving them manually. Even better, this function also
resolves NTFS junction points (which are somewhat similar to bind
mounts).

This fixes git-for-windows#2481.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
The native Windows HTTPS backend is based on Secure Channel which lets
the caller decide how to handle revocation checking problems caused by
missing information in the certificate or offline CRL distribution
points.

Unfortunately, cURL chose to handle these problems differently than
OpenSSL by default: while OpenSSL happily ignores those problems
(essentially saying "¯\_(ツ)_/¯"), the Secure Channel backend will error
out instead.

As a remedy, the "no revoke" mode was introduced, which turns off
revocation checking altogether. This is a bit heavy-handed. We support
this via the `http.schannelCheckRevoke` setting.

In curl/curl#4981, we contributed an opt-in
"best effort" strategy that emulates what OpenSSL seems to do.

In Git for Windows, we actually want this to be the default. This patch
makes it so, introducing it as a new value for the
`http.schannelCheckRevoke" setting, which now becmes a tristate: it
accepts the values "false", "true" or "best-effort" (defaulting to the
last one).

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
The convention in Git project's shell scripts is to have white-space
_before_, but not _after_ the `>` (or `<`).

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
This change enhances `git commit --cleanup=scissors` by detecting
scissors lines ending in either LF (UNIX-style) or CR/LF (DOS-style).

Regression tests are included to specifically test for trailing
comments after a CR/LF-terminated scissors line.

Signed-off-by: Luke Bonanomi <lbonanomi@gmail.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
For some reason, this test case was indented with 4 spaces instead of 1
horizontal tab. The other test cases in the same test script are fine.

Signed-off-by: Jens Glathe <jens.glathe@oldschoolsolutions.biz>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
As of Git v2.28.0, the diff for files staged via `git add -N` marks them
as new files. Git GUI was ill-prepared for that, and this patch teaches
Git GUI about them.

Please note that this will not even fix things with v2.28.0, as the
`rp/apply-cached-with-i-t-a` patches are required on Git's side, too.

This fixes git-for-windows#2779

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Pratyush Yadav <me@yadavpratyush.com>
The vcpkg downloads may not succeed. Warn careful readers of the time out.

A simple retry will usually resolve the issue.

Signed-off-by: Philip Oakley <philipoakley@iee.email>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Dennis Ameling <dennis@dennisameling.com>
Git's regular Makefile mentions that HOST_CPU should be defined when cross-compiling Git: https://github.com/git-for-windows/git/blob/37796bca76ef4180c39ee508ca3e42c0777ba444/Makefile#L438-L439

This is then used to set the GIT_HOST_CPU variable when compiling Git: https://github.com/git-for-windows/git/blob/37796bca76ef4180c39ee508ca3e42c0777ba444/Makefile#L1337-L1341

Then, when the user runs `git version --build-options`, it returns that value: https://github.com/git-for-windows/git/blob/37796bca76ef4180c39ee508ca3e42c0777ba444/help.c#L658

This commit adds the same functionality to the CMake configuration. Users can now set -DHOST_CPU= to set the target architecture.

Signed-off-by: Dennis Ameling <dennis@dennisameling.com>
As reported in newren/git-filter-repo#225, it
looks like 99 bytes is not really sufficient to represent e.g. the full
path to Python when installed via Windows Store (and this path is used
in the hasb bang line when installing scripts via `pip`).

Let's increase it to what is probably the maximum sensible path size:
MAX_PATH. This makes `parse_interpreter()` in line with what
`lookup_prog()` handles.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Vilius Šumskas <vilius@sumskas.eu>
We used to have that `make vcxproj` hack, but a hack it is. In the
meantime, we have a much cleaner solution: using CMake, either
explicitly, or even more conveniently via Visual Studio's built-in CMake
support (simply open Git's top-level directory via File>Open>Folder...).

Let's let the `README` reflect this.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
This adds support for a new http.sslAutoClientCert config value.

In cURL 7.77 or later the schannel backend does not automatically send
client certificates from the Windows Certificate Store anymore.

This config value is only used if http.sslBackend is set to "schannel",
and can be used to opt in to the old behavior and force cURL to send
client certificates.

This fixes git-for-windows#3292

Signed-off-by: Pascal Muller <pascalmuller@gmail.com>
Because `git subtree` (unlike most other `contrib` modules) is included as
part of the standard release of Git for Windows, its stability should be
verified as consistently as it is for the rest of git. By including the
`git subtree` tests in the CI workflow, these tests are as much of a gate to
merging and indicator of stability as the standard test suite.

Signed-off-by: Victoria Dye <vdye@github.com>
Ensure key CMake option values are part of the CMake output to
facilitate user support when tool updates impact the wider CMake
actions, particularly ongoing 'improvements' in Visual Studio.

These CMake displays perform the same function as the build-options.txt
provided in the main Git for Windows. CMake is already chatty.
The setting of CMAKE_EXPORT_COMPILE_COMMANDS is also reported.

Include the environment's CMAKE_EXPORT_COMPILE_COMMANDS value which
may have been propogated to CMake's internal value.

Testing the CMAKE_EXPORT_COMPILE_COMMANDS processing can be difficult
in the Visual Studio environment, as it may be cached in many places.
The 'environment' may include the OS, the user shell, CMake's
own environment, along with the Visual Studio presets and caches.

See previous commit for arefacts that need removing for a clean test.

Signed-off-by: Philip Oakley <philipoakley@iee.email>
To verify that the `clean` side of the `clean`/`smudge` filter code is
correct with regards to LLP64 (read: to ensure that `size_t` is used
instead of `unsigned long`), here is a test case using a trivial filter,
specifically _not_ writing anything to the object store to limit the
scope of the test case.

As in previous commits, the `big` file from previous test cases is
reused if available, to save setup time, otherwise re-generated.

Signed-off-by: Philip Oakley <philipoakley@iee.email>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
dscho and others added 30 commits April 1, 2026 02:11
The TerminateProcess() function does not actually leave the child
processes any chance to perform any cleanup operations. This is bad
insofar as Git itself expects its signal handlers to run.

A symptom is e.g. a left-behind .lock file that would not be left behind
if the same operation was run, say, on Linux.

To remedy this situation, we use an obscure trick: we inject a thread
into the process that needs to be killed and to let that thread run the
ExitProcess() function with the desired exit status. Thanks J Wyman for
describing this trick.

The advantage is that the ExitProcess() function lets the atexit
handlers run. While this is still different from what Git expects (i.e.
running a signal handler), in practice Git sets up signal handlers and
atexit handlers that call the same code to clean up after itself.

In case that the gentle method to terminate the process failed, we still
fall back to calling TerminateProcess(), but in that case we now also
make sure that processes spawned by the spawned process are terminated;
TerminateProcess() does not give the spawned process a chance to do so
itself.

Please note that this change only affects how Git for Windows tries to
terminate processes spawned by Git's own executables. Third-party
software that *calls* Git and wants to terminate it *still* need to make
sure to imitate this gentle method, otherwise this patch will not have
any effect.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
The Windows Subsystem for Linux (WSL) version 2 allows to use `chmod` on
NTFS volumes provided that they are mounted with metadata enabled (see
https://devblogs.microsoft.com/commandline/chmod-chown-wsl-improvements/
for details), for example:

	$ chmod 0755 /mnt/d/test/a.sh

In order to facilitate better collaboration between the Windows
version of Git and the WSL version of Git, we can make the Windows
version of Git also support reading and writing NTFS file modes
in a manner compatible with WSL.

Since this slightly slows down operations where lots of files are
created (such as an initial checkout), this feature is only enabled when
`core.WSLCompat` is set to true. Note that you also have to set
`core.fileMode=true` in repositories that have been initialized without
enabling WSL compatibility.

There are several ways to enable metadata loading for NTFS volumes
in WSL, one of which is to modify `/etc/wsl.conf` by adding:

```
[automount]
enabled = true
options = "metadata,umask=027,fmask=117"
```

And reboot WSL.

It can also be enabled temporarily by this incantation:

	$ sudo umount /mnt/c &&
	  sudo mount -t drvfs C: /mnt/c -o metadata,uid=1000,gid=1000,umask=22,fmask=111

It's important to note that this modification is compatible with, but
does not depend on WSL. The helper functions in this commit can operate
independently and functions normally on devices where WSL is not
installed or properly configured.

Signed-off-by: xungeng li <xungeng@gmail.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
The Git project followed Git for Windows' lead and added their Code of
Conduct, based on the Contributor Covenant v1.4, later updated to v2.0.

We adapt it slightly to Git for Windows.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Previously, we did not install any handler for Ctrl+C, but now we really
want to because the MSYS2 runtime learned the trick to call the
ConsoleCtrlHandler when Ctrl+C was pressed.

With this, hitting Ctrl+C while `git log` is running will only terminate
the Git process, but not the pager. This finally matches the behavior on
Linux and on macOS.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
This patch introduces support to set special NTFS attributes that are
interpreted by the Windows Subsystem for Linux as file mode bits, UID
and GID.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Getting started contributing to Git can be difficult on a Windows
machine. CONTRIBUTING.md contains a guide to getting started, including
detailed steps for setting up build tools, running tests, and
submitting patches to upstream.

[includes an example by Pratik Karki how to submit v2, v3, v4, etc.]

Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
…ITOR"

In e3f7e01 (Revert "editor: save and reset terminal after calling
EDITOR", 2021-11-22), we reverted the commit wholesale where the
terminal state would be saved and restored before/after calling an
editor.

The reverted commit was intended to fix a problem with Windows Terminal
where simply calling `vi` would cause problems afterwards.

To fix the problem addressed by the revert, but _still_ keep the problem
with Windows Terminal fixed, let's revert the revert, with a twist: we
restrict the save/restore _specifically_ to the case where `vi` (or
`vim`) is called, and do not do the same for any other editor.

This should still catch the majority of the cases, and will bridge the
time until the original patch is re-done in a way that addresses all
concerns.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Handle Ctrl+C in Git Bash nicely

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Includes touch-ups by 마누엘, Philip Oakley and 孙卓识.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
The `--stdin` option was a well-established paradigm in other commands,
therefore we implemented it in `git reset` for use by Visual Studio.

Unfortunately, upstream Git decided that it is time to introduce
`--pathspec-from-file` instead.

To keep backwards-compatibility for some grace period, we therefore
reinstate the `--stdin` option on top of the `--pathspec-from-file`
option, but mark it firmly as deprecated.

Helped-by: Victoria Dye <vdye@github.com>
Helped-by: Matthew John Cheetham <mjcheetham@outlook.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
A fix for calling `vim` in Windows Terminal caused a regression and was
reverted. We partially un-revert this, to get the fix again.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
With improvements by Clive Chan, Adric Norris, Ben Bodenmiller and
Philip Oakley.

Helped-by: Clive Chan <cc@clive.io>
Helped-by: Adric Norris <landstander668@gmail.com>
Helped-by: Ben Bodenmiller <bbodenmiller@hotmail.com>
Helped-by: Philip Oakley <philipoakley@iee.org>
Signed-off-by: Brendan Forster <brendan@github.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Rather than using private IFTTT Applets that send mails to this
maintainer whenever a new version of a Git for Windows component was
released, let's use the power of GitHub workflows to make this process
publicly visible.

This workflow monitors the Atom/RSS feeds, and opens a ticket whenever a
new version was released.

Note: Bash sometimes releases multiple patched versions within a few
minutes of each other (i.e. 5.1p1 through 5.1p4, 5.0p15 and 5.0p16). The
MSYS2 runtime also has a similar system. We can address those patches as
a group, so we shouldn't get multiple issues about them.

Note further: We're not acting on newlib releases, OpenSSL alphas, Perl
release candidates or non-stable Perl releases. There's no need to open
issues about them.

Co-authored-by: Matthias Aßhauer <mha1993@live.de>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Reintroduce the 'core.useBuiltinFSMonitor' config setting (originally added
in 0a756b2 (fsmonitor: config settings are repository-specific,
2021-03-05)) after its removal from the upstream version of FSMonitor.

Upstream, the 'core.useBuiltinFSMonitor' setting was rendered obsolete by
"overloading" the 'core.fsmonitor' setting to take a boolean value. However,
several applications (e.g., 'scalar') utilize the original config setting,
so it should be preserved for a deprecation period before complete removal:

* if 'core.fsmonitor' is a boolean, the user is correctly using the new
  config syntax; do not use 'core.useBuiltinFSMonitor'.
* if 'core.fsmonitor' is unspecified, use 'core.useBuiltinFSMonitor'.
* if 'core.fsmonitor' is a path, override and use the builtin FSMonitor if
  'core.useBuiltinFSMonitor' is 'true'; otherwise, use the FSMonitor hook
  indicated by the path.

Additionally, for this deprecation period, advise users to switch to using
'core.fsmonitor' to specify their use of the builtin FSMonitor.

Signed-off-by: Victoria Dye <vdye@github.com>
This topic branch re-adds the deprecated --stdin/-z options to `git
reset`. Those patches were overridden by a different set of options in
the upstream Git project before we could propose `--stdin`.

We offered this in MinGit to applications that wanted a safer way to
pass lots of pathspecs to Git, and these applications will need to be
adjusted.

Instead of `--stdin`, `--pathspec-from-file=-` should be used, and
instead of `-z`, `--pathspec-file-nul`.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Git for Windows accepts pull requests; Core Git does not. Therefore we
need to adjust the template (because it only matches core Git's
project management style, not ours).

Also: direct Git for Windows enhancements to their contributions page,
space out the text for easy reading, and clarify that the mailing list
is plain text, not HTML.

Signed-off-by: Philip Oakley <philipoakley@iee.org>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Originally introduced as `core.useBuiltinFSMonitor` in Git for Windows
and developed, improved and stabilized there, the built-in FSMonitor
only made it into upstream Git (after unnecessarily long hemming and
hawing and throwing overly perfectionist style review sticks into the
spokes) as `core.fsmonitor = true`.

In Git for Windows, with this topic branch, we re-introduce the
now-obsolete config setting, with warnings suggesting to existing users
how to switch to the new config setting, with the intention to
ultimately drop the patch at some stage.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
This is the recommended way on GitHub to describe policies revolving around
security issues and about supported versions.

Helped-by: Sven Strickroth <email@cs-ware.de>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
…updates

Start monitoring updates of Git for Windows' component in the open
Add a README.md for GitHub goodness.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
This topic branch addresses the following vulnerability:

- **CVE-2025-66413**:
  When a user clones a repository from an attacker-controlled server,
  Git may attempt NTLM authentication and disclose the user's NTLMv2 hash
  to the remote server. Since NTLM hashing is weak, the captured hash can
  potentially be brute-forced to recover the user's credentials. This is
  addressed by disabling NTLM authentication by default.
  (GHSA-hv9c-4jm9-jh3x)

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
In 816db62 (credential: advertise NTLM suppression and allow
helpers to re-enable, 2026-02-09), Git learned to advertise that NTLM
authentication was suppressed to credential helpers. It also introduced
a way to allow credential helpers to opt-back-in to NTLM authentication
via the `ntlm_allow=1` credential protocol flag.

There is a bug in the logic of 816db62 that means we are responding
to the `ntlm_allow=1` signal too late in the auth retry codepath; we've
already made the second-attempt request!

Move adding of NTLM as a valid auth method to `http_request_reauth`
right after the credential helper is consulted following the first
request, but (now) before we made the second request.

Signed-off-by: Matthew John Cheetham <mjcheetham@outlook.com>
As of git-for-windows/MINGW-packages#187, Git
for Windows no longer includes `git svn` in its installers and portable
Git editions.

As a consequence, the deprecation note is no longer necessary.

Even worse: Since the recommendation for users who want (or at least
need) to continue using `git svn` is to use the MSYS2 package instead,
and that MSYS2 package is built from Git for Windows' source code, they
would now be bothered by a note that they do not need.

So let's drop that deprecation note.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
In 816db62 (credential: advertise NTLM suppression and allow helpers
to re-enable, 2026-02-09), Git learned to advertise that NTLM
authentication was suppressed to credential helpers. It also introduced
a way to allow credential helpers to opt-back-in to NTLM authentication
via the `ntlm_allow=1` credential protocol flag.

There is a bug in the logic of 816db62 that means we are responding
to the `ntlm_allow=1` signal too late in the auth retry codepath; we've
already made the second-attempt request!

Move adding of NTLM as a valid auth method to `http_request_reauth`
right after the credential helper is consulted following the first
request, but (now) before we made the second request.
… Git for Windows, anyway) (git-for-windows#6142)

As of git-for-windows/MINGW-packages#187, Git
for Windows no longer includes `git svn` in its installers and portable
Git editions.

As a consequence, the deprecation note is no longer necessary.

Even worse: Since the recommendation for users who want (or at least
need) to continue using `git svn` is to use the MSYS2 package instead,
and that MSYS2 package is built from Git for Windows' source code, they
would now be bothered by a note that they do not need.

So let's drop that deprecation note.
Currently, Git for Windows is built off of the MINGW64 tool chain. But
this will have to change because [the MSYS2 project deprecated this tool
chain in favor of
UCRT64](https://www.msys2.org/news/#2026-03-15-deprecating-the-mingw64-environment).
Of course, that's only possible because they dropped support for Windows
8.1, which Git for Windows will probably have to do relatively soon. The
best time to do that is probably [the Git 3.0 inflection
point](git-for-windows#6018) when we
already promised to drop support for older Windows versions.

To prepare for such a huge change, I investigated what needs to be
changed in Git for Windows' source code. And the good news is there's
actually not very much. This here patch seems to be the only change
that's necessary, and not even _strictly_ necessary: the
`mingw_strftime()` wrapper would still do the right thing. It would just
uselessly load the same function that's already loaded, dynamically,
again.

- The `strerror()` override [is guarded by an `#ifndef
_UCRT`](https://github.com/git-for-windows/git/blob/v2.53.0.windows.2/compat/mingw-posix.h#L294-L296),
- `PRIuMAX` resolves to standard `"llu"` [via
`<inttypes.h>`](https://github.com/git-for-windows/git/blob/v2.53.0.windows.2/compat/mingw-posix.h#L449-L454)
(note that `__MINGW64_VERSION_MAJOR` is defined both in MINGW64 and
UCRT64, by virtue of using the `mingw-w64-headers`),
-
[`__USE_MINGW_ANSI_STDIO=0`](https://github.com/git-for-windows/git/blob/v2.53.0.windows.2/config.mak.uname#L751C19-L751C33)
is irrelevant because [`_UCRT` short-circuits
it](https://github.com/git-for-windows/git-sdk-64/blob/08933e673c79b5db48419917a2b02746b390afc4/mingw64/include/inttypes.h#L33),
and
- `SNPRINTF_RETURNS_BOGUS` hasn't been set for Git for Windows' builds
since ec47a33, i.e. for a _really_ long
time.
It was already decided in ef22148 (clean: do not traverse mount points,
2018-12-07) that we shouldn't traverse NTFS junctions/bind mounts when
using `git clean`, partly because they're sometimes used in worktrees.
But the same check wasn't applied to `remove_dir_recurse()` in `dir.c`,
which `git worktree remove` uses. So removing a worktree suffers the
same problem we had previously with `git clean`.

Let's add the same guard from ef22148.

Signed-off-by: Maks Kuznia <makskuznia244@gmail.com>
…s#6151)

`remove_dir_recurse()` in `dir.c` doesn't check for mount points, even
though this check was already added for `git clean` in git-for-windows#2268. So `git
worktree remove` (or anything else that calls it) will traverse NTFS
junctions and delete whatever is there. Similar to git-for-windows#607.

This extends the same check from git-for-windows#2268 but for anything that calls
`remove_dir_recurse()`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.