Skip to content

Rebase shears/main: 8 conflict(s) (1 skipped, 7 resolved) (#26381543924)#199

Open
gitforwindowshelper[bot] wants to merge 303 commits into
base/shears/main-26381543924from
shears/main-26381543924
Open

Rebase shears/main: 8 conflict(s) (1 skipped, 7 resolved) (#26381543924)#199
gitforwindowshelper[bot] wants to merge 303 commits into
base/shears/main-26381543924from
shears/main-26381543924

Conversation

@gitforwindowshelper
Copy link
Copy Markdown

Workflow run

Rebase Summary: main

From: a99c60ceeb (build: tolerate use of _Generic from glibc 2.43 with Clang (git-for-windows#6233), 2026-05-08) (c2ed2cc6f6..a99c60ceeb)

Resolved: 75b3e59 (mingw: include the Python parts in the build, 2015-02-16)

added NO_PYTHON= without the removed USE_NED_ALLOCATOR block that upstream dropped

Range-diff
  • 1: 75b3e59 ! 1: fe1c406 mingw: include the Python parts in the build

    @@ Commit message
     
      ## config.mak.uname ##
     @@ config.mak.uname: ifeq ($(uname_S),MINGW)
    -         ifneq (CLANGARM64,$(MSYSTEM))
    - 		USE_NED_ALLOCATOR = YesPlease
    -         endif
    + 	HAVE_LIBCHARSET_H = YesPlease
    + 	USE_GETTEXT_SCHEME = fallthrough
    + 	USE_LIBPCRE = YesPlease
     +	NO_PYTHON =
              ifeq (/mingw64,$(subst 32,64,$(subst clangarm,mingw,$(prefix))))
      		# Move system config into top-level /etc/

Resolved: 3d05079 (mimalloc: offer a build-time option to enable it, 2019-06-24)

accepted mimalloc and nedmalloc additions from patch into upstream's Makefile (trivial add-only conflicts)

Range-diff
  • 1: 3d05079 ! 1: 6e4bbf9 mimalloc: offer a build-time option to enable it

    @@ Makefile: BUILTIN_OBJS += builtin/write-tree.o
      THIRD_PARTY_SOURCES += compat/inet_ntop.c
      THIRD_PARTY_SOURCES += compat/inet_pton.c
     +THIRD_PARTY_SOURCES += compat/mimalloc/%
    - THIRD_PARTY_SOURCES += compat/nedmalloc/%
    ++THIRD_PARTY_SOURCES += compat/nedmalloc/%
      THIRD_PARTY_SOURCES += compat/obstack.%
      THIRD_PARTY_SOURCES += compat/poll/%
    -@@ Makefile: ifdef USE_NED_ALLOCATOR
    - 	OVERRIDE_STRDUP = YesPlease
    + THIRD_PARTY_SOURCES += compat/regex/%
    +@@ Makefile: ifdef NATIVE_CRLF
    + 	BASIC_CFLAGS += -DNATIVE_CRLF
      endif
      
    ++ifdef USE_NED_ALLOCATOR
    ++	COMPAT_CFLAGS += -Icompat/nedmalloc
    ++	COMPAT_OBJS += compat/nedmalloc/nedmalloc.o
    ++	OVERRIDE_STRDUP = YesPlease
    ++endif
    ++
     +ifdef USE_MIMALLOC
     +	MIMALLOC_OBJS = \
     +		compat/mimalloc/alloc-aligned.o \
    @@ Makefile: ifdef USE_NED_ALLOCATOR
     +	-Wno-implicit-function-declaration
     +endif
     +endif
    ++
     +
      ifdef OVERRIDE_STRDUP
      	COMPAT_CFLAGS += -DOVERRIDE_STRDUP

Resolved: 9f7d454 (mingw: use mimalloc, 2019-06-24)

added USE_MIMALLOC=YesPlease after upstream removed the old USE_NED_ALLOCATOR block

Range-diff
  • 1: 9f7d454 ! 1: 33f14ec mingw: use mimalloc

    @@ config.mak.uname: ifeq ($(uname_S),MINGW)
      	HAVE_LIBCHARSET_H = YesPlease
      	USE_GETTEXT_SCHEME = fallthrough
      	USE_LIBPCRE = YesPlease
    --        ifneq (CLANGARM64,$(MSYSTEM))
    --		USE_NED_ALLOCATOR = YesPlease
    --        endif
     +	USE_MIMALLOC = YesPlease
      	NO_PYTHON =
              ifeq (/mingw64,$(subst 32,64,$(subst clangarm,mingw,$(prefix))))

Resolved: 70d9955 (mingw: rely on MSYS2's metadata instead of hard-coding it, 2025-11-21)

resolved by removing USE_NED_ALLOCATOR (upstream's change) while applying platform-specific ENSURE_MSYSTEM_IS_SET/MINGW_PREFIX definitions (patch's intent)

Range-diff
  • 1: 70d9955 ! 1: 296470c mingw: rely on MSYS2's metadata instead of hard-coding it

    @@ contrib/buildsystems/CMakeLists.txt
     @@ contrib/buildsystems/CMakeLists.txt: if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
      				_CONSOLE DETECT_MSYS_TTY STRIP_EXTENSION=".exe"  NO_SYMLINK_HEAD UNRELIABLE_FSTAT
      				NOGDI OBJECT_CREATION_MODE=1 __USE_MINGW_ANSI_STDIO=0
    - 				USE_NED_ALLOCATOR OVERRIDE_STRDUP MMAP_PREVENTS_DELETE USE_WIN32_MMAP
    + 				OVERRIDE_STRDUP MMAP_PREVENTS_DELETE USE_WIN32_MMAP
     -				HAVE_WPGMPTR ENSURE_MSYSTEM_IS_SET HAVE_RTLGENRANDOM)
     +				HAVE_WPGMPTR HAVE_RTLGENRANDOM)
     +	if(CMAKE_GENERATOR_PLATFORM STREQUAL "x64")

Resolved: 1558b5f (t5563: verify that NTLM authentication works, 2025-11-26)

kept both upstream SPNEGO tests and downstream NTLM test, placing NTLM after SPNEGO at end of file

Range-diff
  • 1: 1558b5f ! 1: ce8b1c2 t5563: verify that NTLM authentication works

    @@ t/lib-httpd/ntlm-handshake.sh (new)
     +esac
     
      ## t/t5563-simple-http-auth.sh ##
    -@@ t/t5563-simple-http-auth.sh: test_expect_success 'access using three-legged auth' '
    - 	EOF
    +@@ t/t5563-simple-http-auth.sh: test_expect_success SPNEGO 'http.emptyAuth=false skips Negotiate' '
    + 	test_line_count = 1 actual_401s
      '
      
     +test_lazy_prereq NTLM 'curl --version | grep -q NTLM'

Skipped: ff779ba (http: extract http_reauth_prepare() from retry paths, 2026-04-13)

Upstream equivalent: a8faa7a (http: extract http_reauth_prepare() from retry paths, 2026-04-16)

Range-diff
  • 1: ff779ba ! 1: a8faa7a http: extract http_reauth_prepare() from retry paths

    @@ Commit message
         No functional change.
     
         Signed-off-by: Matthew John Cheetham <mjcheetham@outlook.com>
    +    Signed-off-by: Junio C Hamano <gitster@pobox.com>
     
      ## http.c ##
     @@ http.c: static void init_curl_http_auth(CURL *result)
    @@ http.c: static int http_request_recoverable(const char *url,
     +			http_reauth_prepare(1);
      		}
      
    - 		/*
    + 		ret = http_request(url, result, target, options);
     
      ## http.h ##
     @@ http.h: extern int http_is_verbose;

Resolved: 87a237e (mingw: add a cache below mingw's lstat and dirent implementations, 2013-10-01)

added compat/win32/fscache.c to CMakeLists.txt without nedmalloc (removed upstream)

Range-diff
  • 1: 87a237e ! 1: 75e1022 mingw: add a cache below mingw's lstat and dirent implementations

    @@ config.mak.uname: ifeq ($(uname_S),MINGW)
     
      ## contrib/buildsystems/CMakeLists.txt ##
     @@ contrib/buildsystems/CMakeLists.txt: if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
    + 		compat/win32/syslog.c
      		compat/win32/trace2_win32_process_info.c
      		compat/win32/dirent.c
    - 		compat/nedmalloc/nedmalloc.c
     -		compat/strdup.c)
     +		compat/strdup.c
     +		compat/win32/fscache.c)

Resolved: 6a598fe (mingw: optionally enable wsl compability file mode bits, 2023-06-07)

added compat/win32/wsl.c, dropped nedmalloc line removed upstream

Range-diff
  • 1: 6a598fe ! 1: 718b30a mingw: optionally enable wsl compability file mode bits

    @@ contrib/buildsystems/CMakeLists.txt: if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
      		compat/win32/trace2_win32_process_info.c
      		compat/win32/dirent.c
     +		compat/win32/wsl.c
    - 		compat/nedmalloc/nedmalloc.c
      		compat/strdup.c
      		compat/win32/fscache.c)
    + 	set(NO_UNIX_SOCKETS 1)
     
      ## meson.build ##
     @@ meson.build: elif host_machine.system() == 'windows'
    @@ meson.build: elif host_machine.system() == 'windows'
          'compat/win32/syslog.c',
     +    'compat/win32/wsl.c',
          'compat/win32mmap.c',
    -     'compat/nedmalloc/nedmalloc.c',
        ]
    + 

To: dbce1c7cd4 (build: tolerate use of _Generic from glibc 2.43 with Clang (git-for-windows#6233), 2026-05-08) (af02d4239f..dbce1c7cd4)

Statistics

Metric Count
Total conflicts 8
Skipped (upstreamed) 1
Resolved surgically 7
Range-diff (click to expand)
  • 1: 6f02b25 = 1: 5d642c5 ci(dockerized): reduce the PID limit for private repositories

  • 2: 9ca3a31 = 2: 94342fb mingw: skip symlink type auto-detection for network share targets

  • 3: d9a66d5 = 3: 2c6fc14 Merge branch 'fix-ci'

  • 4: 4518895 = 4: 936bf06 unix-socket: avoid leak when initialization fails

  • 5: a7e9382 = 5: c2e41b6 Merge branch 'prevent-accidental-ntlm-exfiltration-via-symlinks'

  • 6: dc63ded = 6: 567dfe4 grep: prevent ^$ false match at end of file

  • 7: 7fbe582 = 7: ca47b9c Merge branch 'v2.53.0.windows.3'

  • 8: aa16116 = 8: 7ef7c37 Merge branch 'fixes-from-the-git-mailing-list'

  • 9: c37705b = 9: 3ceed00 t9350: point out that refs are not updated correctly

  • 10: 12e2010 = 10: 85184f5 transport-helper: add trailing --

  • 11: 7414033 = 11: e212143 remote-helper: check helper status after import/export

  • 36: 2bcbec0 = 12: 14b1266 clean: do not traverse mount points

  • 12: 2d51b3a = 13: cc10467 Always auto-gc after calling a fast-import transport

  • 13: 020e6b6 = 14: fcc33b9 mingw: prevent regressions with "drive-less" absolute paths

  • 45: a8dfa81 = 15: 8c47dd1 clean: remove mount points when possible

  • -: ---------- > 16: fe1c406 mingw: include the Python parts in the build

  • 21: eaefc8e = 17: 511cc70 win32/pthread: avoid name clashes with winpthread

  • 24: 2a63b5a = 18: 4f7d857 git-compat-util: avoid redeclaring _DEFAULT_SOURCE

  • 27: db3d9f1 = 19: 3a6afdb Import the source code of mimalloc v2.2.7

  • 30: 6e676b5 = 20: b2f441d mimalloc: adjust for building inside Git

  • 34: 3d05079 ! 21: 6e4bbf9 mimalloc: offer a build-time option to enable it

    @@ Makefile: BUILTIN_OBJS += builtin/write-tree.o
      THIRD_PARTY_SOURCES += compat/inet_ntop.c
      THIRD_PARTY_SOURCES += compat/inet_pton.c
     +THIRD_PARTY_SOURCES += compat/mimalloc/%
    - THIRD_PARTY_SOURCES += compat/nedmalloc/%
    ++THIRD_PARTY_SOURCES += compat/nedmalloc/%
      THIRD_PARTY_SOURCES += compat/obstack.%
      THIRD_PARTY_SOURCES += compat/poll/%
    -@@ Makefile: ifdef USE_NED_ALLOCATOR
    - 	OVERRIDE_STRDUP = YesPlease
    + THIRD_PARTY_SOURCES += compat/regex/%
    +@@ Makefile: ifdef NATIVE_CRLF
    + 	BASIC_CFLAGS += -DNATIVE_CRLF
      endif
      
    ++ifdef USE_NED_ALLOCATOR
    ++	COMPAT_CFLAGS += -Icompat/nedmalloc
    ++	COMPAT_OBJS += compat/nedmalloc/nedmalloc.o
    ++	OVERRIDE_STRDUP = YesPlease
    ++endif
    ++
     +ifdef USE_MIMALLOC
     +	MIMALLOC_OBJS = \
     +		compat/mimalloc/alloc-aligned.o \
    @@ Makefile: ifdef USE_NED_ALLOCATOR
     +	-Wno-implicit-function-declaration
     +endif
     +endif
    ++
     +
      ifdef OVERRIDE_STRDUP
      	COMPAT_CFLAGS += -DOVERRIDE_STRDUP
  • 14: e4380f8 = 22: 5ed800f vcpkg_install: detect lack of Git

  • 15: 00efe1f = 23: 50948b9 vcpkg_install: add comment regarding slow network connections

  • 16: 39d0de6 = 24: 7b106f2 vcbuild: install ARM64 dependencies when building ARM64 binaries

  • 17: 42881a6 = 25: 4f8bd68 vcbuild: add an option to install individual 'features'

  • 18: 4e0f2c7 = 26: 8662038 cmake: allow building for Windows/ARM64

  • 19: 75b3e59 < -: ---------- mingw: include the Python parts in the build

  • 20: fcb5a6e = 27: 19edc22 ci(vs-build) also build Windows/ARM64 artifacts

  • 31: c09a1b7 = 28: fb323cc mingw: demonstrate a git add issue with NTFS junctions

  • 22: 09bcf5b = 29: ac3537b Add schannel to curl installation

  • 35: 1685552 = 30: 3d271bf t5505/t5516: allow running without .git/branches/ in the templates

  • 37: 6902a17 = 31: 3e7df65 strbuf_realpath(): use platform-dependent API if available

  • 43: 9f7d454 ! 32: 33f14ec mingw: use mimalloc

    @@ config.mak.uname: ifeq ($(uname_S),MINGW)
      	HAVE_LIBCHARSET_H = YesPlease
      	USE_GETTEXT_SCHEME = fallthrough
      	USE_LIBPCRE = YesPlease
    --        ifneq (CLANGARM64,$(MSYSTEM))
    --		USE_NED_ALLOCATOR = YesPlease
    --        endif
     +	USE_MIMALLOC = YesPlease
      	NO_PYTHON =
              ifeq (/mingw64,$(subst 32,64,$(subst clangarm,mingw,$(prefix))))
  • 25: 33844a3 = 33: 9404992 cmake(): allow setting HOST_CPU for cross-compilation

  • 38: 42aa598 = 34: 0490d8d http: use new "best effort" strategy for Secure Channel revoke checking

  • 44: 555d8cb = 35: fc0ceac t5505/t5516: fix white-space around redirectors

  • 46: b43d783 = 36: 1e9f131 transport: optionally disable side-band-64k

  • 47: afa7016 = 37: e49ec9d mingw: fix fatal error working on mapped network drives on Windows

  • 48: f46cc5a = 38: 878a25d clink.pl: fix MSVC compile script to handle libcurl-d.lib

  • 49: e2c8ebf = 39: dc14e67 mingw: implement a platform-specific strbuf_realpath()

  • 50: ba4a08f = 40: 2c4ba23 t3701: verify that we can add lots of files interactively

  • 51: dda1d7b = 41: cc8e40a commit: accept "scissors" with CR/LF line endings

  • 52: ed89e09 = 42: e2ede90 t0014: fix indentation

  • 53: aa6baba = 43: 9800a7d git-gui: accommodate for intent-to-add files

  • 54: f063c9a = 44: e15ca79 mingw: allow for longer paths in parse_interpreter()

  • 62: c73dfca = 45: ceaa6a3 windows: skip linking git-<command> for built-ins

  • 63: 2fe2f02 = 46: 53c59b8 mingw: stop hard-coding CC = gcc

  • 23: c805606 = 47: e125be8 hash-object: demonstrate a >4GB/LLP64 problem

  • 64: 495a287 = 48: 713e15a mingw: drop the -D_USE_32BIT_TIME_T option

  • 26: 19d3729 = 49: b3c8382 object-file.c: use size_t for header lengths

  • 65: 01875c9 = 50: 518195b mingw: only use -Wl,--large-address-aware for 32-bit builds

  • 28: 7e44f07 = 51: 8f7f68d CMake: default Visual Studio generator has changed

  • 29: b341d6c = 52: 8e505d9 hash algorithms: use size_t for section lengths

  • 66: 0a6412d = 53: 30eb95c mingw: avoid over-specifying --pic-executable

  • 32: ed7237f = 54: 83e5cb9 .gitignore: add Visual Studio CMakeSetting.json file

  • 33: 807e2a9 = 55: fcb8e9b hash-object --stdin: verify that it works with >4GB/LLP64

  • 67: 0e00f3b = 56: 44acc7e mingw: set the prefix and HOST_CPU as per MSYS2's settings

  • 39: 35d9690 = 57: 0f3c39a subtree: update contrib/subtree test target

  • 40: db8e17c = 58: 3610a13 CMakeLists: add default "x64-windows" arch for Visual Studio

  • 41: 197c954 = 59: 8fc87b9 hash-object: add another >4GB/LLP64 test case

  • 42: d9d1136 = 60: 05b47ac setup: properly use "%(prefix)/" when in WSL

  • 93: 2298936 = 61: 14fad04 Add config option windows.appendAtomically

  • 68: c1f5adc = 62: d9705de mingw: only enable the MSYS2-specific stuff when compiling in MSYS2

  • 85: f0edea9 = 63: 29384dd MinGW: link as terminal server aware

  • 55: 5d67caa = 64: b505960 compat/vcbuild: document preferred way to build in Visual Studio

  • 56: 4932991 = 65: 9af2ed3 http: optionally send SSL client certificate

  • 57: d8523e8 = 66: 7020713 ci: run contrib/subtree tests in CI builds

  • 58: 807e420 = 67: 484ec68 CMake: show Win32 and Generator_platform build-option values

  • 59: c5af8be = 68: f2b1279 hash-object: add a >4GB/LLP64 test case using filtered input

  • 60: c597689 = 69: 02cfa83 compat/mingw.c: do not warn when failing to get owner

  • 61: 9702783 = 70: fb256b2 mingw: $env:TERM="xterm-256color" for newer OSes

  • 97: b958c12 = 71: a43e309 winansi: check result and Buffer before using Name

  • 98: 3ac7522 = 72: 82b3217 mingw: change core.fsyncObjectFiles = 1 by default

  • 99: caec482 = 73: 03daa1d Fix Windows version resources

  • 100: cb94b60 = 74: 4d74e88 status: fix for old-style submodules with commondir

  • 69: 70d9955 ! 75: 296470c mingw: rely on MSYS2's metadata instead of hard-coding it

    @@ contrib/buildsystems/CMakeLists.txt
     @@ contrib/buildsystems/CMakeLists.txt: if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
      				_CONSOLE DETECT_MSYS_TTY STRIP_EXTENSION=".exe"  NO_SYMLINK_HEAD UNRELIABLE_FSTAT
      				NOGDI OBJECT_CREATION_MODE=1 __USE_MINGW_ANSI_STDIO=0
    - 				USE_NED_ALLOCATOR OVERRIDE_STRDUP MMAP_PREVENTS_DELETE USE_WIN32_MMAP
    + 				OVERRIDE_STRDUP MMAP_PREVENTS_DELETE USE_WIN32_MMAP
     -				HAVE_WPGMPTR ENSURE_MSYSTEM_IS_SET HAVE_RTLGENRANDOM)
     +				HAVE_WPGMPTR HAVE_RTLGENRANDOM)
     +	if(CMAKE_GENERATOR_PLATFORM STREQUAL "x64")
  • 70: 779e6b5 = 76: 3b13ae2 mingw: always define ETC_* for MSYS2 environments

  • 71: 579be36 = 77: d1c31ed max_tree_depth: lower it for clang builds in general on Windows

  • 72: ca68b67 = 78: be8ccd8 mingw: ensure valid CTYPE

  • 73: 9f4bf8a = 79: 35656ba mingw: allow git.exe to be used instead of the "Git wrapper"

  • 74: 7986b8e = 80: 7244c33 mingw: ignore HOMEDRIVE/HOMEPATH if it points to Windows' system directory

  • 76: f1de59b = 81: 0ac212d Merge branch 'dscho-avoid-d-f-conflict-in-vs-master'

  • 78: 6fbd1d6 = 82: 71399e0 clink.pl: fix libexpatd.lib link error when using MSVC

  • 80: aac1fdf = 83: 0580871 Makefile: clean up .ilk files when MSVC=1

  • 82: 107d2cd = 84: 154c5cd vcbuild: add support for compiling Windows resource files

  • 84: 178c3fd = 85: 32b0576 config.mak.uname: add git.rc to MSVC builds

  • 87: e9ebb2f = 86: f4cb55d clink.pl: ignore no-stack-protector arg on MSVC=1 builds

  • 88: c80e6fb = 87: 7ee3e13 http: optionally load libcurl lazily

  • 90: 83772e5 = 88: 4f8ca86 clink.pl: move default linker options for MSVC=1 builds

  • 91: 225aefa = 89: 12b9337 http: support lazy-loading libcurl also on Windows

  • 94: 86647da = 90: 6848e7f cmake: install headless-git.

  • 95: 8d05842 = 91: d66ba07 http: when loading libcurl lazily, allow for multiple SSL backends

  • 101: fec953d = 92: f3f4fca git.rc: include winuser.h

  • 102: daff56f = 93: 3e15a6d mingw: do load libcurl dynamically by default

  • 103: 85fec69 = 94: 1c0703c Add a GitHub workflow to verify that Git/Scalar work in Nano Server

  • 104: 7b21850 = 95: 2ba130c mingw: suggest windows.appendAtomically in more cases

  • 105: 2f9ed14 = 96: ae1d0a6 win32: use native ANSI sequence processing, if possible

  • 106: bcf90a0 = 97: 19cbe75 common-main.c: fflush stdout buffer upon exit

  • 107: 09300d2 = 98: 7430fc0 t5601/t7406(mingw): do run tests with symlink support

  • 108: c08cd64 = 99: 8a22653 win32: ensure that localtime_r() is declared even in i686 builds

  • 75: 2d929af = 100: 49c9d6b ci: work around a problem with HTTP/2 vs libcurl v8.10.0

  • 77: f461a39 = 101: e54ff7e revision: create mark_trees_uninteresting_dense()

  • 79: cb6768e = 102: 8a00b9d survey: stub in new experimental 'git-survey' command

  • 81: 6bd8ffe = 103: 59e724c survey: add command line opts to select references

  • 83: bf3dacd = 104: 11d7467 survey: start pretty printing data in table form

  • 86: c889993 = 105: eaa0920 survey: add object count summary

  • 89: 3ed0933 = 106: 8ceb688 survey: summarize total sizes by object type

  • 92: e8ce4eb = 107: 94a5b24 survey: show progress during object walk

  • 117: 49241c1 = 108: e23d2a7 mingw: make sure errno is set correctly when socket operations fail

  • 96: bf26d84 = 109: 5282612 survey: add ability to track prioritized lists

  • 120: 6eedce1 = 110: 348c033 compat/mingw: handle WSA errors in strerror

  • 123: 624f4a6 = 111: 1790061 survey: add report of "largest" paths

  • 124: d5d33ba = 112: c7f02f1 compat/mingw: drop outdated comment

  • 127: 5f03184 = 113: aa76e60 survey: add --top= option and config

  • 128: cb42cd7 = 114: 3e06f40 t0301: actually test credential-cache on Windows

  • 109: 3bb2847 = 115: 681fd69 Fallback to AppData if XDG_CONFIG_HOME is unset

  • 110: 9c1d79c = 116: 3050cec run-command: be helpful with Git LFS fails on Windows 7

  • 131: eb0205f = 117: 8e4044b survey: clearly note the experimental nature in the output

  • 132: 1f6a92a = 118: ab50ddf credential-cache: handle ECONNREFUSED gracefully

  • 133: c8c463d = 119: ac53c6f reftable: do make sure to use custom allocators

  • 134: d02091f = 120: cac6aca check-whitespace: avoid alerts about upstream commits

  • 135: 0ce61a6 = 121: b930b13 t/t5571-prep-push-hook.sh: Add test with writing to stderr

  • 113: 1558b5f ! 122: ce8b1c2 t5563: verify that NTLM authentication works

    @@ t/lib-httpd/ntlm-handshake.sh (new)
     +esac
     
      ## t/t5563-simple-http-auth.sh ##
    -@@ t/t5563-simple-http-auth.sh: test_expect_success 'access using three-legged auth' '
    - 	EOF
    +@@ t/t5563-simple-http-auth.sh: test_expect_success SPNEGO 'http.emptyAuth=false skips Negotiate' '
    + 	test_line_count = 1 actual_401s
      '
      
     +test_lazy_prereq NTLM 'curl --version | grep -q NTLM'
  • 115: 55ea387 = 123: 75e5c89 http: disallow NTLM authentication by default

  • 118: ce49dde ! 124: be66822 http: warn if might have failed because of NTLM

    @@ http.c: static int handle_curl_result(struct slot_results *results)
     +			}
      			return HTTP_NOAUTH;
      		} else {
    - 			http_auth_methods &= ~CURLAUTH_GSSNEGOTIATE;
    + 			if (curl_empty_auth == -1 &&
     
      ## t/t5563-simple-http-auth.sh ##
     @@ t/t5563-simple-http-auth.sh: test_expect_success NTLM 'access using NTLM auth' '
  • 121: e25849c ! 125: 120103c credential: advertise NTLM suppression and allow helpers to re-enable

    @@ http.c: static int handle_curl_result(struct slot_results *results)
      					  "NTLM authentication has been

"
"disabled in Git by default. You can "
@@ http.c: static int http_request_recoverable(const char *url,

  •    	credential_fill(the_repository, &http_auth, 1);
    
  •    	http_reauth_prepare(1);
       }
    
+		/*

* 136:  a2ead5fc03 = 126:  531b0ebec1 dir: do not traverse mount points
* 137:  0108b4b1bc = 127:  eed4f5209c win32: thread-utils: handle multi-socket systems
* 111:  eebe32ac77 = 128:  4a6e3e26a6 Merge 'remote-hg-prerequisites' into HEAD
* 112:  f88162edfb = 129:  a3f4e3d3a5 Merge branch 'drive-prefix'
* 114:  6fc40d0416 = 130:  7d8c859e7b Merge branch 'dont-clean-junctions'
* 116:  f47b50b8ad = 131:  bb4b2e58b7 Merge branch 'msys2-python'
* 119:  4f96d080ba = 132:  e114274d06 Update mimalloc to v2.2.7 (#6048)
* 122:  3f5c04b66e = 133:  1cbdfc1f34 Merge pull request #2375 from assarbad/reintroduce-sideband-config
* 125:  ff779baed9 <   -:  ---------- http: extract http_reauth_prepare() from retry paths
* 126:  feb0b2f2d8 = 134:  bd0bb15823 Merge pull request #2488 from bmueller84/master
* 129:  2053e94d8a <   -:  ---------- http: attempt Negotiate auth in http.emptyAuth=auto mode
* 130:  8b90512a61 = 135:  f6647f9be0 Merge pull request #2501 from jeffhostetler/clink-debug-curl
* 138:  06db37a908 = 136:  4f04562856 t5563: add tests for http.emptyAuth with Negotiate
* 139:  c9b5c3780e = 137:  e73723420c Merge pull request #2504 from dscho/access-repo-via-junction
* 140:  6f4e1f61f5 = 138:  7a2bdf782f Merge pull request #2535 from dscho/schannel-revoke-best-effort
* 141:  c378b2a1fe = 139:  0303cea80f Merge pull request #2618 from dscho/avoid-d/f-conflict-in-vs/master
* 142:  9bfad5cfac = 140:  f217f85df8 Merge 'add-p-many-files'
* 143:  372d9c5fee = 141:  116257d53c Merge pull request #2714 from lbonanomi/crlf-scissors
* 144:  cb278466d6 = 142:  76751fbe65 Merge pull request #2655 from jglathe/jg/t0014_trace_extra_info
* 145:  dbe710bf2d = 143:  c20294a564 Merge 'git-gui/js/intent-to-add'
* 146:  23591b713a = 144:  756d8890b5 Merge pull request #2351 from PhilipOakley/vcpkg-tip
* 147:  27d5e16181 = 145:  e7eac1418a Merge pull request #2915 from dennisameling/windows-arm64-support
* 148:  e22c089af3 = 146:  d289d0a95e Merge pull request #3327 from dennisameling/fix-host-cpu
* 149:  f527bb0764 = 147:  6e92b94c4b Merge pull request #3165 from dscho/increase-allowed-length-of-interpreter-path
* 150:  1b72bcb990 = 148:  807914320c Merge pull request #3220 from dscho/there-is-no-vs/master-anymore
* 151:  cf9226a0be = 149:  70748a9943 Merge pull request #3293 from pascalmuller/http-support-automatically-sending-client-certificate
* 152:  c5835797bf = 150:  9d92a03b82 Merge pull request #3349 from vdye/feature/ci-subtree-tests
* 153:  a15f96ecaa = 151:  fd9f5f0d70 Merge pull request #3306 from PhilipOakley/vs-sln
* 154:  e72f59c9be = 152:  8553381afd Merge pull request #3533 from PhilipOakley/hashliteral_t
* 155:  fde28c5e59 = 153:  689c7346c2 Merge pull request #3791: Various fixes around `safe.directory`
* 156:  c81487265f = 154:  d8aadc3697 Merge pull request #3751 from rkitover/native-term
* 157:  2d0197f86c = 155:  8ce6334419 Merge pull request #3875 from 1480c1/wine/detect_msys_tty
* 158:  4263a942a7 = 156:  8a6e2820fd Merge branch 'optionally-dont-append-atomically-on-windows'
* 159:  60b50a3b52 = 157:  43677166bb Merge branch 'fsync-object-files-always'
* 160:  e10753f2ce = 158:  e6b91bd5ec Merge pull request #3942 from rimrul/mingw-tsaware
* 161:  a7d723005f = 159:  0335c9df92 Fix Windows version resources (#4092)
* 162:  0f44544fa6 = 160:  5f63f00846 Fix global repository field not being cleared (#4083)
* 163:  be9239d6e6 = 161:  b6d9741ab0 Skip linking the "dashed" `git-<command>`s for built-ins (#4252)
* 164:  fc8ef88d25 = 162:  d82a3ce0d9 Add full `mingw-w64-git` (i.e. regular MSYS2 ecosystem) support (#5971)
* 165:  23301ff133 = 163:  08b944e2cf Merge pull request #2506 from dscho/issue-2283
* 166:  de82965dcb = 164:  8f6b4e459e Merge pull request #2974 from derrickstolee/maintenance-and-headless
* 167:  0c953f1bf0 = 165:  8ffda11ce6 ARM64: Embed manifest properly (#4718)
* 168:  35f875c055 = 166:  5936a2d52c Lazy load libcurl, allowing for an SSL/TLS backend-specific libcurl (#4410)
* 169:  aa6f5421c0 = 167:  c970937013 Merge branch 'nano-server'
* 170:  ddd64fe3e7 = 168:  b5e36c6fbe Additional error checks for issuing the windows.appendAtomically warning (#4528)
* 171:  db6e1fb032 = 169:  0d8784b66c win32: use native ANSI sequence processing, if possible (#4700)
* 172:  4353b74b7f = 170:  82081a1a23 common-main.c: fflush stdout buffer when exit (#4901)
* 173:  46d6f2bf62 = 171:  9339b7fdd3 Merge branch 'run-t5601-and-t7406-with-symlinks-on-windows-10'
* 174:  655c006a86 = 172:  d36f149b6c Merge branch 'Fix-i686-build-with-GCC-v14'
* 175:  f744995704 = 173:  979aa22c5a Merge branch 'Fallback-to-AppData-if-XDG-CONFIG-HOME-is-unset'
* 176:  fa9bd9b33f = 174:  1a6b4b4a39 Merge branch 'run-command-be-helpful-when-Git-LFS-fails-on-Windows-7'
* 177:  39cec468fa = 175:  0934206d48 pack-objects: create new name-hash algorithm (#5157)
* 178:  1647afd20f = 176:  62e206b720 Add path walk API and its use in 'git pack-objects' (#5171)
* 179:  679fe2f176 = 177:  93e941a7ec Add experimental 'git survey' builtin (#5174)
* 180:  cb8052e8cf = 178:  803ff07f12 credential-cache: handle ECONNREFUSED gracefully (#5329)
* 181:  6823bd2d66 = 179:  12efcbfc78 Merge branch 'reftable-vs-custom-allocators'
* 182:  bd679080c6 = 180:  d23f0681d0 Merge branch 'check-whitespace-only-downstream'
* 183:  2eaf863e7c = 181:  6c2fadf179 t/t5571-prep-push-hook.sh: Add test with writing to stderr (#6063)
* 184:  32992f4f5d = 182:  e88bfab902 Merge branch 'disallow-ntlm-auth-by-default'
* 185:  6a49b36689 = 183:  d60cc56782 Don't traverse mount points in `remove_dir_recurse()` (#6151)
* 186:  110d0c5b90 = 184:  678b4a6444 Detect number of cores better on multi-socket systems (#6108)
* 187:  47ce2d7627 = 185:  566abef64c http: fix emptyAuth=auto for Negotiate/SPNEGO (#6170)
* 188:  c2d878ba47 = 186:  3ae187f05e Merge branch 'ready-for-upstream'
* 189:  9642f302eb = 187:  5010345e5a ci(macos): skip the `git p4` tests
* 190:  a6c21c6415 = 188:  3e77570bdb ci(macos): skip the `git p4` tests (#5954)
* 191:  8589a1dad4 = 189:  52f7a0e85b Win32: make FILETIME conversion functions public
* 192:  9c69d597d7 = 190:  6e64e219cd Win32: dirent.c: Move opendir down
* 193:  b3f85b8c62 = 191:  5ddc26eee3 mingw: make the dirent implementation pluggable
* 198:  6ea251b703 = 192:  601d10fd15 git-gui--askyesno: fix funny text wrapping
* 194:  00420b3120 = 193:  88d341aabe Win32: make the lstat implementation pluggable
* 200:  acf39211eb = 194:  004e173a17 git-gui--askyesno (mingw): use Git for Windows' icon, if available
* 195:  2c8c89bee2 = 195:  7735952ed2 mingw: add infrastructure for read-only file system level caches
* 202:  6f645706f2 = 196:  6974ba56c5 Merge branch 'git-gui-askyesno'
* 196:  87a237e053 ! 197:  75e10229bc mingw: add a cache below mingw's lstat and dirent implementations

``````diff
@@ config.mak.uname: ifeq ($(uname_S),MINGW)
 
  ## contrib/buildsystems/CMakeLists.txt ##
 @@ contrib/buildsystems/CMakeLists.txt: if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
+ 		compat/win32/syslog.c
  		compat/win32/trace2_win32_process_info.c
  		compat/win32/dirent.c
- 		compat/nedmalloc/nedmalloc.c
 -		compat/strdup.c)
 +		compat/strdup.c
 +		compat/win32/fscache.c)

PhilipOakley and others added 30 commits May 25, 2026 03:31
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 already defines a couple of helpful environment variables, and we
can use those to infer the installation location as well as the CPU. No
need for hard-coding ;-)

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>
The tell-tale is the presence of the `MSYSTEM` value while compiling, of
course. In that case, we want to ensure that `MSYSTEM` is set when
running `git.exe`, and also enable the magic MSYS2 tty detection.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
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>
In the case of Git for Windows (say, in a Git Bash window) running in a
Windows Subsystem for Linux (WSL) directory, the GetNamedSecurityInfoW()
call in is_path_owned_By_current_side() returns an error code other than
ERROR_SUCCESS. This is consistent behavior across this boundary.

In these cases, the owner would always be different because the WSL
owner is a different entity than the Windows user.

The change here is to suppress the error message that looks like this:

  error: failed to get owner for '//wsl.localhost/...' (1)

Before this change, this warning happens for every Git command,
regardless of whether the directory is marked with safe.directory.

Signed-off-by: Derrick Stolee <derrickstolee@github.com>
For Windows builds >= 15063 set $env:TERM to "xterm-256color" instead of
"cygwin" because they have a more capable console system that supports
this. Also set $env:COLORTERM="truecolor" if unset.

$env:TERM is initialized so that ANSI colors in color.c work, see
29a3963 (Win32: patch Windows environment on startup, 2012-01-15).

See git-for-windows#3629 regarding problems caused by always setting
$env:TERM="cygwin".

This is the same heuristic used by the Cygwin runtime.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
NtQueryObject under Wine can return a success but fill out no name.
In those situations, Wine will set Buffer to NULL, and set result to
the sizeof(OBJECT_NAME_INFORMATION).

Running a command such as

echo "$(git.exe --version 2>/dev/null)"

will crash due to a NULL pointer dereference when the code attempts to
null terminate the buffer, although, weirdly, removing the subshell or
redirecting stdout to a file will not trigger the crash.

Code has been added to also check Buffer and Length to ensure the check
is as robust as possible due to the current behavior being fragile at
best, and could potentially change in the future

This code is based on the behavior of NtQueryObject under wine and
reactos.

Signed-off-by: Christopher Degawa <ccom@randomderp.com>
Atomic append on windows is only supported on local disk files, and it may
cause errors in other situations, e.g. network file system. If that is the
case, this config option should be used to turn atomic append off.

Co-Authored-By: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: 孙卓识 <sunzhuoshi@gmail.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
From the documentation of said setting:

	This boolean will enable fsync() when writing object files.

	This is a total waste of time and effort on a filesystem that
	orders data writes properly, but can be useful for filesystems
	that do not use journalling (traditional UNIX filesystems) or
	that only journal metadata and not file contents (OS X’s HFS+,
	or Linux ext3 with "data=writeback").

The most common file system on Windows (NTFS) does not guarantee that
order, therefore a sudden loss of power (or any other event causing an
unclean shutdown) would cause corrupt files (i.e. files filled with
NULs). Therefore we need to change the default.

Note that the documentation makes it sound as if this causes really bad
performance. In reality, writing loose objects is something that is done
only rarely, and only a handful of files at a time.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Whith Windows 2000, Microsoft introduced a flag to the PE header to mark executables as
"terminal server aware". Windows terminal servers provide a redirected Windows directory and
redirected registry hives when launching legacy applications without this flag set. Since we
do not use any INI files in the Windows directory and don't write to the registry, we don't
need  this additional preparation. Telling the OS that we don't need this should provide
slightly improved startup times in terminal server environments.

When building for supported Windows Versions with MSVC the /TSAWARE linker flag is
automatically set, but MinGW requires us to set the --tsaware flag manually.

This partially addresses git-for-windows#3935.

Signed-off-by: Matthias Aßhauer <mha1993@live.de>
Add FileVersion, which is a required field
As not all required fields were present, none were being included
Fixes git-for-windows#4090

Signed-off-by: Kiel Hurley <kielhurley@gmail.com>
In f9b7573 (repository: free fields before overwriting them,
2017-09-05), Git was taught to release memory before overwriting it, but
357a03e (repository.c: move env-related setup code back to
environment.c, 2018-03-03) changed the code so that it would not
_always_ be overwritten.

As a consequence, the `commondir` attribute would point to
already-free()d memory.

This seems not to cause problems in core Git, but there are add-on
patches in Git for Windows where the `commondir` attribute is
subsequently used and causing invalid memory accesses e.g. in setups
containing old-style submodules (i.e. the ones with a `.git` directory
within theirs worktrees) that have `commondir` configured.

This fixes git-for-windows#4083.

Signed-off-by: Andrey Zabavnikov <zabavnikov@gmail.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
It is merely a historical wart that, say, `git-commit` exists in the
`libexec/git-core/` directory, a tribute to the original idea to let Git
be essentially a bunch of Unix shell scripts revolving around very few
"plumbing" (AKA low-level) commands.

Git has evolved a lot from there. These days, most of Git's
functionality is contained within the `git` executable, in the form of
"built-in" commands.

To accommodate for scripts that use the "dashed" form of Git commands,
even today, Git provides hard-links that make the `git` executable
available as, say, `git-commit`, just in case that an old script has not
been updated to invoke `git commit`.

Those hard-links do not come cheap: they take about half a minute for
every build of Git on Windows, they are mistaken for taking up huge
amounts of space by some Windows Explorer versions that do not
understand hard-links, and therefore many a "bug" report had to be
addressed.

The "dashed form" has been officially deprecated in Git version 1.5.4,
which was released on February 2nd, 2008, i.e. a very long time ago.
This deprecation was never finalized by skipping these hard-links, but
we can start the process now, in Git for Windows.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Merge this early to resolve merge conflicts early.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
When building with `make MSVC=1 DEBUG=1`, link to `libexpatd.lib`
rather than `libexpat.lib`.

It appears that the `vcpkg` package for "libexpat" has changed and now
creates `libexpatd.lib` for debug mode builds.  Previously, both debug
and release builds created a ".lib" with the same basename.

Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
Create a wrapper for the Windows Resource Compiler (RC.EXE)
for use by the MSVC=1 builds. This is similar to the CL.EXE
and LIB.EXE wrappers used for the MSVC=1 builds.

Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
Teach MSVC=1 builds to depend on the `git.rc` file so that
the resulting executables have Windows-style resources and
version number information within them.

Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
This compile-time option allows to ask Git to load libcurl dynamically
at runtime.

Together with a follow-up patch that optionally overrides the file name
depending on the `http.sslBackend` setting, this kicks open the door for
installing multiple libcurl flavors side by side, and load the one
corresponding to the (runtime-)configured SSL/TLS backend.

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>
A change between versions 2.4.1 and 2.6.0 of the MSYS2 runtime modified
how Cygwin's runtime (and hence Git for Windows' MSYS2 runtime
derivative) handles locales: d16a56306d (Consolidate wctomb/mbtowc calls
for POSIX-1.2008, 2016-07-20).

An unintended side-effect is that "cold-calling" into the POSIX
emulation will start with a locale based on the current code page,
something that Git for Windows is very ill-prepared for, as it expects
to be able to pass a command-line containing non-ASCII characters to the
shell without having those characters munged.

One symptom of this behavior: when `git clone` or `git fetch` shell out
to call `git-upload-pack` with a path that contains non-ASCII
characters, the shell tried to interpret the entire command-line
(including command-line parameters) as executable path, which obviously
must fail.

This fixes git-for-windows#1036

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Ignore the `-fno-stack-protector` compiler argument when building
with MSVC.  This will be used in a later commit that needs to build
a Win32 GUI app.

Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
dscho and others added 30 commits May 25, 2026 03:39
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>
This was pull request git-for-windows#1645 from ZCube/master

Support windows container.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
…ws#4527)

With this patch, Git for Windows works as intended on mounted APFS
volumes (where renaming read-only files would fail).

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

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>
In this time and age, AI is everywhere. However, it's sometimes not very
easy to use. For green-field projects it works quite a bit better than
for existing legacy projects. And Git's source code is _quite_ as legacy
code as they come... 😁

Now, the only way how AI can be used efficiently with legacy code
is by providing enough information by way of prompt context for the
AI to have a chance to make any sense of the code. The structure and
the architecture is, after all, not designed for AI, but rather the
opposite: By virtue of having grown organically over two decades, there
is no design that AI coding models would readily grasp.

So here is a document that describes all kinds of aspects about this
project. The idea is to help AI by providing information that it does
not have ingrained in its weights. The idea is to provide information
that a human prompter might take for granted, but no coding model will
have been trained on specifically.

Assisted-by: Claude Opus 4.5
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
…opment

This adds an extensive section about resolving merge conflicts during
rebases, which happens quite often in Git for Windows' day-to-day.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
…opment

AGENTS.md: add upstream contribution and worktree guidance

Add sections covering the GitGitGadget workflow for contributing to
upstream Git, commit message conventions specific to the upstream
project, how to manage patch series with dependencies (branch
thickets), effective worktree usage including --update-refs for
history rewrites, and techniques for analyzing merge-structured
topic branches with git replay.

These learnings come from a session contributing the
safe.bareRepository test preparation patches via GitGitGadget.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Assisted-by: Claude Opus 4.6
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>
…opment

AGENTS.md: document rebase, staging, and log -L tricks for AI agents

Add practical recipes for three workflows that are particularly useful
when AI agents work with Git:

Non-interactive "interactive" rebases using `sed -i 1ib` as a sequence
editor to insert a `break` command, then editing the todo file directly
via the path from `git rev-parse --git-path rebase-merge/git-rebase-todo`.
This avoids the impossible task of driving an interactive editor from an
AI agent.

Scripted hunk staging via `printf '%s\n' s y q | git add -p`, which
feeds predictable keystrokes to the add-patch protocol to stage
individual hunks without human interaction.

The `git log -L <start>,+<count>:<file>` trick for finding which commit
last touched specific lines, enabling an `hg absorb`-like workflow where
the agent can identify the right fixup! target surgically rather than
grepping through full diffs.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Assisted-by: Claude Opus 4.6
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>
…opment

AGENTS.md: add pre-commit checklist for lint checks

Bundle the existing ASCII-only, 80-column, and whitespace validation
recipes into a "pre-commit checklist" block that agents should run
before every commit. The individual recipes already existed in the
Coding Conventions section but were presented as reference material
rather than as an actionable workflow step.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Assisted-by: Claude Opus 4.6
…updates

Start monitoring updates of Git for Windows' component in the open
This was marked as a temporary work-around in 4538ee6 (ci: work
around a problem with HTTP/2 vs libcurl v8.10.0 (git-for-windows#5165), 2024-09-24), to
help CI builds pass even on macOS. The faulty libcurl version has hence
been replaced with plenty of fixed ones, therefore this work-around is
no longer necessary.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
…opment

AGENTS: document learnings from split-index + fsmonitor investigation

While investigating a CI failure in the `linux-TEST-vars` job caused by
the interaction between the `pt/fsmonitor-linux` and
`hn/git-checkout-m-with-stash` topics in `seen`, several debugging
techniques proved essential and were not previously documented.

The investigation required bisecting the first-parent history of `seen`
while temporarily merging the fsmonitor topic at each step. This
revealed that `GIT_TEST_SPLIT_INDEX=yes` corrupts the bisect
machinery's own index operations unless it is unset before cleanup
checkouts. It also revealed that `fprintf(stderr, ...)` instrumentation
in Git's C code is swallowed by the test framework, making Trace2 the
correct instrumentation approach.

A key insight was that the bug appeared Linux-specific only because
`linux-TEST-vars` is the sole CI job setting `GIT_TEST_SPLIT_INDEX=yes`;
there is no macOS or Windows equivalent. The actual root cause (the
`index.skipHash=true` + split-index interaction producing a null
`base_oid` in the shared index) is platform-independent.

Add four documentation sections capturing these learnings: bisecting
`seen` interactions, reproducing with exact CI variables, verifying CI
platform coverage before concluding platform-specificity, and using
Trace2 for instrumentation inside the test framework.

Assisted-by: Claude Opus 4.6
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Add a README.md for GitHub goodness.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
This was a preparatory commit for the path-walk API, which has since
been upstreamed into v2.54.0. During the merging-rebase, the code
changes this commit introduced were already present in the new base,
leaving it empty. Drop it.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
…it-for-windows#6198)

AI-assisted contributions are a reality of open source in 2025 and
beyond. Contributors will use AI tools, and that includes the
maintainers themselves. Over recent months, I have found AI increasingly
useful for the kind of menial, tedious work that does not require much
creativity but is highly boring when done by hand: resolving merge
conflicts during merging-rebases, chasing down CI failures across
platforms, adapting downstream patches to upstream API changes.

To that end, I would like to have an `AGENTS.md` file in the code base
that helps any LLM to understand the context of the project.

A secondary goal of this is to preemptively help outside contributors.
The risk is not AI usage per se, but low-quality AI slop: contributions
where the human hits "accept" without sufficient context being available
to the model (and without proper review by the human, we've all been
there), resulting in changes that miss conventions, break patterns, or
misunderstand the project's architecture. Git's source code is about as
legacy as they come, having grown organically over two decades with no
design that AI coding models would readily grasp from a narrow code
sample alone.

This `AGENTS.md` is designed to raise the floor on AI-assisted
contributions by providing enough context that even when a human
contributor fails to steer carefully, the model has the information it
needs to produce something reasonable. It documents the repository
structure, build process, test conventions, the object model and ODB
internals, debugging techniques (Trace2, instrumenting tests, bisecting
failures), the merging-rebase workflow, conflict resolution patterns,
coding conventions (ASCII only, 80 columns, tabs), commit message
expectations, and the GitGitGadget contribution workflow. This is
information that a human might take for granted, but no coding model
will have been trained on specifically.

Similar `AGENTS.md` files have recently been added to other repositories
in the Git for Windows project:
[MINGW-packages](git-for-windows/MINGW-packages#194),
[git-for-windows.github.io](git-for-windows/git-for-windows.github.io#88)
and
[msys2-runtime](git-for-windows/msys2-runtime@1e0ff37).
Over time, as upstream Git absorbs fixes and features that originated in
or were carried by Git for Windows, downstream patches accumulate that
are no longer needed. The steady stream of merged PRs makes this
virtually inevitable. This PR collects fixup! commits to drop three such
patches during the next autosquash rebase.

The HTTP/2 workaround in `t5551` was a temporary fix for a libcurl
v8.10.0 regression on macOS CI runners. The faulty libcurl has long been
superseded by fixed versions, making it unnecessary.

The `unix-socket: avoid leak when initialization fails` patch changed
`return -1` to `goto fail` in `unix_stream_connect()` so cleanup would
run when `unix_sockaddr_init()` failed. Upstream fixed the same leak
more surgically in c5fe29f (unix-socket: fix memory leak when
chdir(3p) fails, 2025-01-30) by having `unix_sockaddr_init()` call
`FREE_AND_NULL(ctx->orig_dir)` before returning, making the downstream
caller-side fix redundant.

The `revision: create mark_trees_uninteresting_dense()` commit was a
preparatory patch for the path-walk API. That API has since been
upstreamed, and this commit became empty during the merging-rebase
because its changes were already in the new base.
…erver

Bump actions/checkout from v5 to v6 and
git-for-windows/setup-git-for-windows-sdk from v1 to v2.

Both bumps are Node.js 20 to Node.js 24 runtime migrations with
no functional changes to the actions themselves. checkout v6 moves
persisted credentials to `` instead of `.git/config`,
which does not affect this workflow since no subsequent steps rely
on the credential location. The setup-sdk v2 provisions the same
minimal SDK as v1.

Risk: very low. The only precondition is a recent Actions Runner,
which github.com-hosted runners already satisfy.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
When building with `make DEVELOPER=1` we explicitly pass "-std=gnu99" to
the compiler so that we don't start leaning on features exposed by more
recent versions of the C standard. Unfortunately though, glibc 2.43
started to use type-generic expressions. This works alright with GCC,
but when compiling with Clang this leads to errors:

  $ make DEVELOPER=1 CC=clang
  CC daemon.o
  In file included from daemon.c:3:
  ./git-compat-util.h:344:11: error: '_Generic' is a C11 extension [-Werror,-Wc11-extensions]
    344 |         return !!strchr(path, '/');
        |                  ^
  /usr/include/string.h:265:3: note: expanded from macro 'strchr'
    265 |   __glibc_const_generic (S, const char *, strchr (S, C))
        |   ^
  /usr/include/x86_64-linux-gnu/sys/cdefs.h:838:3: note: expanded from macro '__glibc_const_generic'
    838 |   _Generic (0 ? (PTR) : (void *) 1,                     \
        |   ^

In theory, the `__glibc_const_generic` macro does have feature gating:

  #if !defined __cplusplus \
      && (__GNUC_PREREQ (4, 9) \
          || __glibc_has_extension (c_generic_selections) \
          || (!defined __GNUC__ && defined __STDC_VERSION__ \
              && __STDC_VERSION__ >= 201112L))
  # define __HAVE_GENERIC_SELECTION 1
  #else
  # define __HAVE_GENERIC_SELECTION 0
  #endif

But this feature gating isn't effective because `_has_extension()` will
always evaluate to true as C generics _are_ available as a language
extension to GNU C99 when using Clang. This would have been different if
`_has_feature()` was used instead, in which case it would have properly
evaluated to `false`.

Unfortunately, there is no easy way for us to work around the warning.
We cannot define `__HAVE_GENERIC_SELECTION` ourselves as that would lead
to a redefinition, and given that the conditions are or'd together we
cannot disable any of those, either.

Instead, work around the issue by not using -std=gnu99 with Clang when
using the Makefile and by disabling warnings about C11 extensions when
using Meson. This isn't ideal, but we at least retain the ability to
detect the (mis-)use of features from newer standards with GCC.

An alternative to this might be to simply bump the required C standard
to C11, which is 15 years old by now and should have support on most
platforms out there. But some more esoteric platforms may not have it.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
…windows#6220)

This includes gitgitgadget#2097 and a
`fixup!` for a workflow that is not upstream (Nano Server).
…indows#6233)

The `linux-{asan-ubsan,sha256,reftable}` jobs run inside
`ubuntu:rolling`, which now resolves to Ubuntu 26.04 with glibc 2.43;
that pulls `_Generic` into `<sys/cdefs.h>` and breaks our `-std=gnu99
-Werror` Clang builds. Concrete failure:
https://github.com/git-for-windows/git/actions/runs/25390480083/job/74463338845.

Picking up Patrick Steinhardt's fix from
https://lore.kernel.org/git/20260505-b4-pks-ci-tolerate-glibc-generic-v1-1-5786386fe512@pks.im/
ahead of its upstream merge so the GfW CI goes green again. The diff
conflicts with `fe5704a3695c "mimalloc: offer a build-time option to
enable it"`, which wraps the affected `config.mak.dev` block in `ifndef
USE_MIMALLOC`; the resolution preserves that wrap on the `gcc6`-only
branch surviving Patrick's patch. `meson.build` auto-merged.
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.