Skip to content

Rebase shears/seen: 19 conflict(s) (0 skipped, 19 resolved) (#29679312715)#318

Open
gitforwindowshelper[bot] wants to merge 335 commits into
base/shears/seen-29679312715from
shears/seen-29679312715
Open

Rebase shears/seen: 19 conflict(s) (0 skipped, 19 resolved) (#29679312715)#318
gitforwindowshelper[bot] wants to merge 335 commits into
base/shears/seen-29679312715from
shears/seen-29679312715

Conversation

@gitforwindowshelper

Copy link
Copy Markdown

Workflow run

Rebase Summary: seen

From: 9758e46e11 (Merge tag 'v2.55.0.windows.3', 2026-07-16) (35f921a6c9..9758e46e11)

Resolved: a551cb2 (vcbuild: install ARM64 dependencies when building ARM64 binaries, 2020-01-31)

adapted ARM64 architecture parameter additions to use upstream's path (compat/vcbuild/ instead of lib/compat/vcbuild/)

Range-diff
  • 1: a551cb2 ! 1: cfe5b92 vcbuild: install ARM64 dependencies when building ARM64 binaries

    @@ Commit message
         Signed-off-by: Dennis Ameling <dennis@dennisameling.com>
         Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
     
    - ## lib/compat/vcbuild/README ##
    -@@ lib/compat/vcbuild/README: The Steps to Build Git with VS2015 or VS2017 from the command line.
    + ## compat/vcbuild/README ##
    +@@ compat/vcbuild/README: The Steps to Build Git with VS2015 or VS2017 from the command line.
         Prompt or from an SDK bash window:
      
         $ cd <repo_root>
    --   $ ./lib/compat/vcbuild/vcpkg_install.bat
    -+   $ ./lib/compat/vcbuild/vcpkg_install.bat x64-windows
    +-   $ ./compat/vcbuild/vcpkg_install.bat
    ++   $ ./compat/vcbuild/vcpkg_install.bat x64-windows
     +
     +   or
     +
    -+   $ ./lib/compat/vcbuild/vcpkg_install.bat arm64-windows
    ++   $ ./compat/vcbuild/vcpkg_install.bat arm64-windows
      
         The vcpkg tools and all of the third-party sources will be installed
         in this folder:
     
    - ## lib/compat/vcbuild/vcpkg_copy_dlls.bat ##
    -@@ lib/compat/vcbuild/vcpkg_copy_dlls.bat: REM ================================================================
    + ## compat/vcbuild/vcpkg_copy_dlls.bat ##
    +@@ compat/vcbuild/vcpkg_copy_dlls.bat: REM ================================================================
      	@FOR /F "delims=" %%D IN ("%~dp0") DO @SET cwd=%%~fD
      	cd %cwd%
      
    @@ lib/compat/vcbuild/vcpkg_copy_dlls.bat: REM ====================================
      
      	IF [%1]==[release] (
     
    - ## lib/compat/vcbuild/vcpkg_install.bat ##
    -@@ lib/compat/vcbuild/vcpkg_install.bat: REM ================================================================
    + ## compat/vcbuild/vcpkg_install.bat ##
    +@@ compat/vcbuild/vcpkg_install.bat: REM ================================================================
      
      	SETLOCAL EnableDelayedExpansion
      
    @@ lib/compat/vcbuild/vcpkg_install.bat: REM ======================================
      	@FOR /F "delims=" %%D IN ("%~dp0") DO @SET cwd=%%~fD
      	cd %cwd%
      
    -@@ lib/compat/vcbuild/vcpkg_install.bat: REM ================================================================
    +@@ compat/vcbuild/vcpkg_install.bat: REM ================================================================
      	echo Successfully installed %cwd%vcpkg\vcpkg.exe
      
      :install_libraries

Resolved: 9bc9746 (cmake: allow building for Windows/ARM64, 2020-12-04)

adapted ARM64/VCPKG_ARCH changes to use upstream's renamed compat/vcbuild/ path (lib/ prefix removed)

Range-diff
  • 1: 9bc9746 ! 1: a313299 cmake: allow building for Windows/ARM64

    @@ Commit message
     
      ## contrib/buildsystems/CMakeLists.txt ##
     @@ contrib/buildsystems/CMakeLists.txt: if(USE_VCPKG)
    - 	set(VCPKG_DIR "${CMAKE_SOURCE_DIR}/lib/compat/vcbuild/vcpkg")
    + 	set(VCPKG_DIR "${CMAKE_SOURCE_DIR}/compat/vcbuild/vcpkg")
      	if(NOT EXISTS ${VCPKG_DIR})
      		message("Initializing vcpkg and building the Git's dependencies (this will take a while...)")
    --		execute_process(COMMAND ${CMAKE_SOURCE_DIR}/lib/compat/vcbuild/vcpkg_install.bat)
    -+		execute_process(COMMAND ${CMAKE_SOURCE_DIR}/lib/compat/vcbuild/vcpkg_install.bat ${VCPKG_ARCH})
    +-		execute_process(COMMAND ${CMAKE_SOURCE_DIR}/compat/vcbuild/vcpkg_install.bat)
    ++		execute_process(COMMAND ${CMAKE_SOURCE_DIR}/compat/vcbuild/vcpkg_install.bat ${VCPKG_ARCH})
      	endif()
     -	list(APPEND CMAKE_PREFIX_PATH "${VCPKG_DIR}/installed/x64-windows")
     +	list(APPEND CMAKE_PREFIX_PATH "${VCPKG_DIR}/installed/${VCPKG_ARCH}")
    @@ contrib/buildsystems/CMakeLists.txt: string(REPLACE "@USE_LIBPCRE2@" "" git_buil
      string(REPLACE "@WITH_BREAKING_CHANGES@" "" git_build_options "${git_build_options}")
      string(REPLACE "@X@" "${EXE_EXTENSION}" git_build_options "${git_build_options}")
      if(USE_VCPKG)
    --	string(APPEND git_build_options "PATH=\"$PATH:$TEST_DIRECTORY/../lib/compat/vcbuild/vcpkg/installed/x64-windows/bin\"\n")
    -+	string(APPEND git_build_options "PATH=\"$PATH:$TEST_DIRECTORY/../lib/compat/vcbuild/vcpkg/installed/${VCPKG_ARCH}/bin\"\n")
    +-	string(APPEND git_build_options "PATH=\"$PATH:$TEST_DIRECTORY/../compat/vcbuild/vcpkg/installed/x64-windows/bin\"\n")
    ++	string(APPEND git_build_options "PATH=\"$PATH:$TEST_DIRECTORY/../compat/vcbuild/vcpkg/installed/${VCPKG_ARCH}/bin\"\n")
      endif()
      file(WRITE ${CMAKE_BINARY_DIR}/GIT-BUILD-OPTIONS ${git_build_options})
      

Resolved: 2873943 (ci(vs-build) also build Windows/ARM64 artifacts, 2020-11-29)

adapted ARM64 matrix patch to use upstream's compat/vcbuild paths (without lib/ prefix)

Range-diff
  • 1: 2873943 ! 1: 3729206 ci(vs-build) also build Windows/ARM64 artifacts

    @@ .github/workflows/main.yml: jobs:
            uses: microsoft/setup-msbuild@v3
          - name: copy dlls to root
            shell: cmd
    --      run: lib\compat\vcbuild\vcpkg_copy_dlls.bat release
    -+      run: lib\compat\vcbuild\vcpkg_copy_dlls.bat release ${{ matrix.arch }}-windows
    +-      run: compat\vcbuild\vcpkg_copy_dlls.bat release
    ++      run: compat\vcbuild\vcpkg_copy_dlls.bat release ${{ matrix.arch }}-windows
          - name: generate Visual Studio solution
            shell: bash
            run: |
    --        cmake `pwd`/contrib/buildsystems/ -DCMAKE_PREFIX_PATH=`pwd`/lib/compat/vcbuild/vcpkg/installed/x64-windows \
    +-        cmake `pwd`/contrib/buildsystems/ -DCMAKE_PREFIX_PATH=`pwd`/compat/vcbuild/vcpkg/installed/x64-windows \
     -        -DNO_GETTEXT=YesPlease -DPERL_TESTS=OFF -DPYTHON_TESTS=OFF -DCURL_NO_CURL_CMAKE=ON
    -+        cmake `pwd`/contrib/buildsystems/ -DCMAKE_PREFIX_PATH=`pwd`/lib/compat/vcbuild/vcpkg/installed/${{ matrix.arch }}-windows \
    ++        cmake `pwd`/contrib/buildsystems/ -DCMAKE_PREFIX_PATH=`pwd`/compat/vcbuild/vcpkg/installed/${{ matrix.arch }}-windows \
     +        -DNO_GETTEXT=YesPlease -DPERL_TESTS=OFF -DPYTHON_TESTS=OFF -DCURL_NO_CURL_CMAKE=ON -DCMAKE_GENERATOR_PLATFORM=${{ matrix.arch }} -DVCPKG_ARCH=${{ matrix.arch }}-windows
          - name: MSBuild
            run: |

Resolved: 6bbe78d (cmake(): allow setting HOST_CPU for cross-compilation, 2021-07-19)

resolved by keeping HEAD's removal of lib/ path prefix and applying REBASE_HEAD's HOST_CPU cross-compilation support in both files

Range-diff
  • 1: 6bbe78d ! 1: 590dfe4 cmake(): allow setting HOST_CPU for cross-compilation

    @@ .github/workflows/main.yml
     @@ .github/workflows/main.yml: jobs:
            shell: bash
            run: |
    -         cmake `pwd`/contrib/buildsystems/ -DCMAKE_PREFIX_PATH=`pwd`/lib/compat/vcbuild/vcpkg/installed/${{ matrix.arch }}-windows \
    +         cmake `pwd`/contrib/buildsystems/ -DCMAKE_PREFIX_PATH=`pwd`/compat/vcbuild/vcpkg/installed/${{ matrix.arch }}-windows \
     -        -DNO_GETTEXT=YesPlease -DPERL_TESTS=OFF -DPYTHON_TESTS=OFF -DCURL_NO_CURL_CMAKE=ON -DCMAKE_GENERATOR_PLATFORM=${{ matrix.arch }} -DVCPKG_ARCH=${{ matrix.arch }}-windows
     +        -DNO_GETTEXT=YesPlease -DPERL_TESTS=OFF -DPYTHON_TESTS=OFF -DCURL_NO_CURL_CMAKE=ON -DCMAKE_GENERATOR_PLATFORM=${{ matrix.arch }} -DVCPKG_ARCH=${{ matrix.arch }}-windows -DHOST_CPU=${{ matrix.arch }}
          - name: MSBuild
    @@ .github/workflows/main.yml: jobs:
     
      ## contrib/buildsystems/CMakeLists.txt ##
     @@ contrib/buildsystems/CMakeLists.txt: endif()
    + 
      #default behaviour
      include_directories(${CMAKE_SOURCE_DIR})
    - include_directories(${CMAKE_SOURCE_DIR}/lib)
     -add_compile_definitions(GIT_HOST_CPU="${CMAKE_SYSTEM_PROCESSOR}")
     +
     +# When cross-compiling, define HOST_CPU as the canonical name of the CPU on

Resolved: d94ffe5 (CMake: show Win32 and Generator_platform build-option values, 2021-05-10)

adapted patch's debug message() lines to use upstream's updated VCPKG_DIR path (lib/ prefix removed)

Range-diff
  • 1: d94ffe5 ! 1: 5a2dba7 CMake: show Win32 and Generator_platform build-option values

    @@ contrib/buildsystems/CMakeLists.txt: endif()
      endif()
      
      if(USE_VCPKG)
    - 	set(VCPKG_DIR "${CMAKE_SOURCE_DIR}/lib/compat/vcbuild/vcpkg")
    + 	set(VCPKG_DIR "${CMAKE_SOURCE_DIR}/compat/vcbuild/vcpkg")
     +	message("WIN32: ${WIN32}") # show its underlying text values
     +	message("VCPKG_DIR: ${VCPKG_DIR}")
     +	message("VCPKG_ARCH: ${VCPKG_ARCH}") # maybe unset
    @@ contrib/buildsystems/CMakeLists.txt: endif()
     +	message("ENV(CMAKE_EXPORT_COMPILE_COMMANDS): $ENV{CMAKE_EXPORT_COMPILE_COMMANDS}")
      	if(NOT EXISTS ${VCPKG_DIR})
      		message("Initializing vcpkg and building the Git's dependencies (this will take a while...)")
    - 		execute_process(COMMAND ${CMAKE_SOURCE_DIR}/lib/compat/vcbuild/vcpkg_install.bat ${VCPKG_ARCH})
    + 		execute_process(COMMAND ${CMAKE_SOURCE_DIR}/compat/vcbuild/vcpkg_install.bat ${VCPKG_ARCH})

Resolved: 6554f9d (MinGW: link as terminal server aware, 2022-07-10)

added -Wl,--tsaware to BASIC_LDFLAGS while preserving upstream's Icompat path rename

Range-diff
  • 1: 6554f9d ! 1: b6adddd MinGW: link as terminal server aware

    @@ config.mak.uname: ifeq ($(uname_S),MINGW)
      	CSPRNG_METHOD = rtlgenrandom
     -	BASIC_LDFLAGS += -municode
     +	BASIC_LDFLAGS += -municode -Wl,--tsaware
    - 	COMPAT_CFLAGS += -DNOGDI -Ilib/compat -Ilib/compat/win32
    + 	COMPAT_CFLAGS += -DNOGDI -Icompat -Icompat/win32
      	COMPAT_CFLAGS += -DSTRIP_EXTENSION=\".exe\"
    - 	COMPAT_OBJS += lib/compat/mingw.o lib/compat/winansi.o \
    + 	COMPAT_OBJS += compat/mingw.o compat/winansi.o \

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

kept nanosec, msystem, and mingw_prefix meson options from the patch; upstream had no conflicting additions

Range-diff
  • 1: 0ad8dd0 ! 1: f207da1 mingw: rely on MSYS2's metadata instead of hard-coding it

    @@ contrib/buildsystems/CMakeLists.txt: if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
     +		add_compile_definitions(ENSURE_MSYSTEM_IS_SET="MINGW32" MINGW_PREFIX="mingw32")
     +	endif()
      	list(APPEND compat_SOURCES
    - 		lib/compat/mingw.c
    - 		lib/compat/winansi.c
    + 		compat/mingw.c
    + 		compat/winansi.c
     
      ## meson.build ##
     @@ meson.build: elif host_machine.system() == 'windows'
    @@ meson.build: elif host_machine.system() == 'windows'
     +  endif
     +
        libgit_dependencies += compiler.find_library('ntdll')
    -   libgit_include_directories += 'lib/compat/win32'
    +   libgit_include_directories += 'compat/win32'
        if compiler.get_id() == 'msvc'
     
      ## meson_options.txt ##
    -@@ meson_options.txt: option('sane_tool_path', type: 'array', value: [],
    +@@ meson_options.txt: option('runtime_prefix', type: 'boolean', value: false,
    +   description: 'Resolve ancillary tooling and support files relative to the location of the runtime binary instead of hard-coding them into the binary.')
    + option('sane_tool_path', type: 'array', value: [],
        description: 'An array of paths to pick up tools from in case the normal tools are broken or lacking.')
    - option('nanosec', type: 'boolean', value: false,
    -   description: 'Care about sub-second file mtimes and ctimes.')
    ++option('nanosec', type: 'boolean', value: false,
    ++  description: 'Care about sub-second file mtimes and ctimes.')
     +option('msystem', type: 'string', value: '',
     +  description: 'Fall-back on Windows when MSYSTEM is not set.')
     +option('mingw_prefix', type: 'string', value: '',

Resolved: 76ee47b (mingw: ensure valid CTYPE, 2017-02-21)

inserted LC_CTYPE check at end of setup_windows_environment(), before the new mingw_platform_has_symlinks() function that upstream extracted

Range-diff
  • 1: 76ee47b ! 1: 2918d4e mingw: ensure valid CTYPE

    @@ Commit message
     
         Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
     
    - ## lib/compat/mingw.c ##
    -@@ lib/compat/mingw.c: static void setup_windows_environment(void)
    + ## compat/mingw.c ##
    +@@ compat/mingw.c: static void setup_windows_environment(void)
    + 		if (!tmp && (tmp = getenv("USERPROFILE")))
      			setenv("HOME", tmp, 1);
      	}
    - 
    ++
     +	if (!getenv("LC_ALL") && !getenv("LC_CTYPE") && !getenv("LANG"))
     +		setenv("LC_CTYPE", "C.UTF-8", 1);
    -+
    - 	/*
    - 	 * Change 'core.symlinks' default to false, unless native symlinks are
    - 	 * enabled in MSys2 (via 'MSYS=winsymlinks:nativestrict'). Thus we can
    + }
    + 
    + int mingw_platform_has_symlinks(void)

Resolved: 53ef770 (mingw: allow git.exe to be used instead of the "Git wrapper", 2020-02-01)

adapted ENSURE_MSYSTEM_IS_SET and MINGW_PREFIX defines to upstream's compat/ paths (without lib/ prefix)

Range-diff
  • 1: 53ef770 ! 1: 0c6208c mingw: allow git.exe to be used instead of the "Git wrapper"

    @@ Commit message
     
         Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
     
    - ## config.mak.uname ##
    -@@ config.mak.uname: endif
    - 		lib/compat/win32/pthread.o lib/compat/win32/syslog.o \
    - 		lib/compat/win32/trace2_win32_process_info.o \
    - 		lib/compat/win32/dirent.o
    --	COMPAT_CFLAGS = -D__USE_MINGW_ACCESS -DDETECT_MSYS_TTY -DNOGDI -DHAVE_STRING_H -Ilib/compat -Ilib/compat/regex -Ilib/compat/win32 -DSTRIP_EXTENSION=\".exe\"
    -+	COMPAT_CFLAGS = -D__USE_MINGW_ACCESS -DDETECT_MSYS_TTY \
    -+		-DENSURE_MSYSTEM_IS_SET="\"$(MSYSTEM)\"" -DMINGW_PREFIX="\"$(patsubst /%,%,$(MINGW_PREFIX))\"" \
    -+		-DNOGDI -DHAVE_STRING_H -Ilib/compat -Ilib/compat/regex -Ilib/compat/win32 -DSTRIP_EXTENSION=\".exe\"
    - 	BASIC_LDFLAGS = -IGNORE:4217 -IGNORE:4049 -NOLOGO -ENTRY:wmainCRTStartup -SUBSYSTEM:CONSOLE
    - 	# invalidcontinue.obj allows Git's source code to close the same file
    - 	# handle twice, or to access the osfhandle of an already-closed stdout
    -@@ config.mak.uname: ifeq ($(uname_S),MINGW)
    - 		prefix = $(MINGW_PREFIX)
    - 		HOST_CPU = $(patsubst %-w64-mingw32,%,$(MINGW_CHOST))
    - 		BASIC_LDFLAGS += -Wl,--pic-executable
    --		COMPAT_CFLAGS += -DDETECT_MSYS_TTY
    -+		COMPAT_CFLAGS += -DDETECT_MSYS_TTY \
    -+			-DENSURE_MSYSTEM_IS_SET="\"$(MSYSTEM)\"" \
    -+			-DMINGW_PREFIX="\"$(patsubst /%,%,$(MINGW_PREFIX))\""
    -                 ifeq (MINGW32,$(MSYSTEM))
    - 			BASIC_LDFLAGS += -Wl,--large-address-aware
    -                 endif
    -
    - ## lib/compat/mingw.c ##
    -@@ lib/compat/mingw.c: int xwcstoutf(char *utf, const wchar_t *wcs, size_t utflen)
    + ## compat/mingw.c ##
    +@@ compat/mingw.c: int xwcstoutf(char *utf, const wchar_t *wcs, size_t utflen)
      	return -1;
      }
      
    @@ lib/compat/mingw.c: int xwcstoutf(char *utf, const wchar_t *wcs, size_t utflen)
      static void setup_windows_environment(void)
      {
      	char *tmp = getenv("TMPDIR");
    -@@ lib/compat/mingw.c: static void setup_windows_environment(void)
    +@@ compat/mingw.c: static void setup_windows_environment(void)
      			setenv("HOME", tmp, 1);
      	}
      
    @@ lib/compat/mingw.c: static void setup_windows_environment(void)
     +
      	if (!getenv("LC_ALL") && !getenv("LC_CTYPE") && !getenv("LANG"))
      		setenv("LC_CTYPE", "C.UTF-8", 1);
    - 
    + }
    +
    + ## config.mak.uname ##
    +@@ config.mak.uname: endif
    + 		compat/win32/pthread.o compat/win32/syslog.o \
    + 		compat/win32/trace2_win32_process_info.o \
    + 		compat/win32/dirent.o
    +-	COMPAT_CFLAGS = -D__USE_MINGW_ACCESS -DDETECT_MSYS_TTY -DNOGDI -DHAVE_STRING_H -Icompat -Icompat/regex -Icompat/win32 -DSTRIP_EXTENSION=\".exe\"
    ++	COMPAT_CFLAGS = -D__USE_MINGW_ACCESS -DDETECT_MSYS_TTY \
    ++		-DENSURE_MSYSTEM_IS_SET="\"$(MSYSTEM)\"" -DMINGW_PREFIX="\"$(patsubst /%,%,$(MINGW_PREFIX))\"" \
    ++		-DNOGDI -DHAVE_STRING_H -Icompat -Icompat/regex -Icompat/win32 -DSTRIP_EXTENSION=\".exe\"
    + 	BASIC_LDFLAGS = -IGNORE:4217 -IGNORE:4049 -NOLOGO -ENTRY:wmainCRTStartup -SUBSYSTEM:CONSOLE
    + 	# invalidcontinue.obj allows Git's source code to close the same file
    + 	# handle twice, or to access the osfhandle of an already-closed stdout
    +@@ config.mak.uname: ifeq ($(uname_S),MINGW)
    + 		prefix = $(MINGW_PREFIX)
    + 		HOST_CPU = $(patsubst %-w64-mingw32,%,$(MINGW_CHOST))
    + 		BASIC_LDFLAGS += -Wl,--pic-executable
    +-		COMPAT_CFLAGS += -DDETECT_MSYS_TTY
    ++		COMPAT_CFLAGS += -DDETECT_MSYS_TTY \
    ++			-DENSURE_MSYSTEM_IS_SET="\"$(MSYSTEM)\"" \
    ++			-DMINGW_PREFIX="\"$(patsubst /%,%,$(MINGW_PREFIX))\""
    +                 ifeq (MINGW32,$(MSYSTEM))
    + 			BASIC_LDFLAGS += -Wl,--large-address-aware
    +                 endif
     
      ## t/t0060-path-utils.sh ##
     @@ t/t0060-path-utils.sh: test_expect_success !VALGRIND,RUNTIME_PREFIX,CAN_EXEC_IN_PWD 'RUNTIME_PREFIX wor

Resolved: a842fb1 (vcbuild: add support for compiling Windows resource files, 2021-04-05)

accepted directory rename from lib/compat/vcbuild/scripts/rc.pl to compat/vcbuild/scripts/rc.pl; file content unchanged, just staged

Range-diff
  • 1: a842fb1 ! 1: c041011 vcbuild: add support for compiling Windows resource files

    @@ Commit message
     
         Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
     
    - ## config.mak.uname ##
    -@@ config.mak.uname: ifeq ($(uname_S),Windows)
    - 	# link.exe next to, and required by, cl.exe, we have to prepend this
    - 	# onto the existing $PATH.
    - 	#
    --	SANE_TOOL_PATH ?= $(msvc_bin_dir_msys)
    -+	SANE_TOOL_PATH ?= $(msvc_bin_dir_msys):$(sdk_ver_bin_dir_msys)
    - 	HAVE_ALLOCA_H = YesPlease
    - 	NO_PREAD = YesPlease
    - 	NEEDS_CRYPTO_WITH_SSL = YesPlease
    -@@ config.mak.uname: endif
    - 	# See https://msdn.microsoft.com/en-us/library/ms235330.aspx
    - 	EXTLIBS = user32.lib advapi32.lib shell32.lib wininet.lib ws2_32.lib invalidcontinue.obj kernel32.lib ntdll.lib
    - 	PTHREAD_LIBS =
    -+	RC = lib/compat/vcbuild/scripts/rc.pl
    - 	lib =
    - 	BASIC_CFLAGS += $(vcpkg_inc) $(sdk_includes) $(msvc_includes)
    - ifndef DEBUG
    -
    - ## lib/compat/vcbuild/find_vs_env.bat ##
    -@@ lib/compat/vcbuild/find_vs_env.bat: REM ================================================================
    + ## compat/vcbuild/find_vs_env.bat ##
    +@@ compat/vcbuild/find_vs_env.bat: REM ================================================================
      
         SET sdk_dir=%WindowsSdkDir%
         SET sdk_ver=%WindowsSDKVersion%
    @@ lib/compat/vcbuild/find_vs_env.bat: REM ========================================
         SET si=%sdk_dir%Include\%sdk_ver%
         SET sdk_includes=-I"%si%ucrt" -I"%si%um" -I"%si%shared"
         SET sl=%sdk_dir%lib\%sdk_ver%
    -@@ lib/compat/vcbuild/find_vs_env.bat: REM ================================================================
    +@@ compat/vcbuild/find_vs_env.bat: REM ================================================================
      
         SET sdk_dir=%WindowsSdkDir%
         SET sdk_ver=%WindowsSDKVersion%
    @@ lib/compat/vcbuild/find_vs_env.bat: REM ========================================
         SET si=%sdk_dir%Include\%sdk_ver%
         SET sdk_includes=-I"%si%ucrt" -I"%si%um" -I"%si%shared" -I"%si%winrt"
         SET sl=%sdk_dir%lib\%sdk_ver%
    -@@ lib/compat/vcbuild/find_vs_env.bat: REM ================================================================
    +@@ compat/vcbuild/find_vs_env.bat: REM ================================================================
         echo msvc_includes=%msvc_includes%
         echo msvc_libs=%msvc_libs%
      
    @@ lib/compat/vcbuild/find_vs_env.bat: REM ========================================
         echo sdk_libs=%sdk_libs%
      
     
    - ## lib/compat/vcbuild/scripts/rc.pl (new) ##
    + ## compat/vcbuild/scripts/rc.pl (new) ##
     @@
     +#!/usr/bin/perl -w
     +######################################################################
    @@ lib/compat/vcbuild/scripts/rc.pl (new)
     +printf("**** @args\n");
     +
     +exit (system(@args) != 0);
    +
    + ## config.mak.uname ##
    +@@ config.mak.uname: ifeq ($(uname_S),Windows)
    + 	# link.exe next to, and required by, cl.exe, we have to prepend this
    + 	# onto the existing $PATH.
    + 	#
    +-	SANE_TOOL_PATH ?= $(msvc_bin_dir_msys)
    ++	SANE_TOOL_PATH ?= $(msvc_bin_dir_msys):$(sdk_ver_bin_dir_msys)
    + 	HAVE_ALLOCA_H = YesPlease
    + 	NO_PREAD = YesPlease
    + 	NO_WRITEV = YesPlease
    +@@ config.mak.uname: endif
    + 	# See https://msdn.microsoft.com/en-us/library/ms235330.aspx
    + 	EXTLIBS = user32.lib advapi32.lib shell32.lib wininet.lib ws2_32.lib invalidcontinue.obj kernel32.lib ntdll.lib
    + 	PTHREAD_LIBS =
    ++	RC = lib/compat/vcbuild/scripts/rc.pl
    + 	lib =
    + 	BASIC_CFLAGS += $(vcpkg_inc) $(sdk_includes) $(msvc_includes)
    + ifndef DEBUG

Resolved: a0fd88b (clink.pl: move default linker options for MSVC=1 builds, 2021-04-05)

combined upstream's Icompat path changes with patch's removal of -ENTRY/-SUBSYSTEM linker flags

Range-diff
  • 1: a0fd88b ! 1: 10c4c16 clink.pl: move default linker options for MSVC=1 builds

    @@ Commit message
     
         Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
     
    - ## config.mak.uname ##
    -@@ config.mak.uname: endif
    - 	COMPAT_CFLAGS = -D__USE_MINGW_ACCESS -DDETECT_MSYS_TTY \
    - 		-DENSURE_MSYSTEM_IS_SET="\"$(MSYSTEM)\"" -DMINGW_PREFIX="\"$(patsubst /%,%,$(MINGW_PREFIX))\"" \
    - 		-DNOGDI -DHAVE_STRING_H -Ilib/compat -Ilib/compat/regex -Ilib/compat/win32 -DSTRIP_EXTENSION=\".exe\"
    --	BASIC_LDFLAGS = -IGNORE:4217 -IGNORE:4049 -NOLOGO -ENTRY:wmainCRTStartup -SUBSYSTEM:CONSOLE
    -+	BASIC_LDFLAGS = -IGNORE:4217 -IGNORE:4049 -NOLOGO
    - 	# invalidcontinue.obj allows Git's source code to close the same file
    - 	# handle twice, or to access the osfhandle of an already-closed stdout
    - 	# See https://msdn.microsoft.com/en-us/library/ms235330.aspx
    -
    - ## lib/compat/vcbuild/scripts/clink.pl ##
    + ## compat/vcbuild/scripts/clink.pl ##
     @@
      my @lflags = ();
      my $is_linking = 0;
    @@ lib/compat/vcbuild/scripts/clink.pl
      	push(@args, @lflags);
      	unshift(@args, "link.exe");
      } else {
    +
    + ## config.mak.uname ##
    +@@ config.mak.uname: endif
    + 	COMPAT_CFLAGS = -D__USE_MINGW_ACCESS -DDETECT_MSYS_TTY \
    + 		-DENSURE_MSYSTEM_IS_SET="\"$(MSYSTEM)\"" -DMINGW_PREFIX="\"$(patsubst /%,%,$(MINGW_PREFIX))\"" \
    + 		-DNOGDI -DHAVE_STRING_H -Icompat -Icompat/regex -Icompat/win32 -DSTRIP_EXTENSION=\".exe\"
    +-	BASIC_LDFLAGS = -IGNORE:4217 -IGNORE:4049 -NOLOGO -ENTRY:wmainCRTStartup -SUBSYSTEM:CONSOLE
    ++	BASIC_LDFLAGS = -IGNORE:4217 -IGNORE:4049 -NOLOGO
    + 	# invalidcontinue.obj allows Git's source code to close the same file
    + 	# handle twice, or to access the osfhandle of an already-closed stdout
    + 	# See https://msdn.microsoft.com/en-us/library/ms235330.aspx

Resolved: 487b75e (cmake: install headless-git., 2023-03-11)

kept upstream's compat/win32/headless.c path, added the patch's list(APPEND PROGRAMS_BUILT headless-git) line

Range-diff
  • 1: 487b75e ! 1: c0719d3 cmake: install headless-git.

    @@ contrib/buildsystems/CMakeLists.txt
     @@ contrib/buildsystems/CMakeLists.txt: if(WIN32)
      	endif()
      
    - 	add_executable(headless-git ${CMAKE_SOURCE_DIR}/lib/compat/win32/headless.c)
    + 	add_executable(headless-git ${CMAKE_SOURCE_DIR}/compat/win32/headless.c)
     +	list(APPEND PROGRAMS_BUILT headless-git)
      	if(CMAKE_C_COMPILER_ID STREQUAL "GNU" OR CMAKE_C_COMPILER_ID STREQUAL "Clang")
      		target_link_options(headless-git PUBLIC -municode -Wl,-subsystem,windows)

Resolved: 0f5901f (http: optionally load libcurl lazily, 2023-05-06)

adapted lib/ prefix removal from upstream while preserving LAZYLOAD_LIBCURL_OBJ additions

Range-diff
  • 1: 0f5901f ! 1: d020ee9 http: optionally load libcurl lazily

    @@ Makefile: else
     -        ifndef CURL_LDFLAGS
     -		CURL_LDFLAGS = $(eval CURL_LDFLAGS := $$(shell $$(CURL_CONFIG) --libs))$(CURL_LDFLAGS)
     +        ifdef LAZYLOAD_LIBCURL
    -+		LAZYLOAD_LIBCURL_OBJ = lib/compat/lazyload-curl.o
    ++		LAZYLOAD_LIBCURL_OBJ = compat/lazyload-curl.o
     +		OBJECTS += $(LAZYLOAD_LIBCURL_OBJ)
     +		# The `CURL_STATICLIB` constant must be defined to avoid seeing the functions
     +		# declared as DLL imports
    @@ Makefile: else
              endif
              ifdef USE_CURL_FOR_IMAP_SEND
      		BASIC_CFLAGS += -DUSE_CURL_FOR_IMAP_SEND
    --		IMAP_SEND_BUILDDEPS = lib/http.o
    -+		IMAP_SEND_BUILDDEPS = lib/http.o $(LAZYLOAD_LIBCURL_OBJ)
    +-		IMAP_SEND_BUILDDEPS = http.o
    ++		IMAP_SEND_BUILDDEPS = http.o $(LAZYLOAD_LIBCURL_OBJ)
      		IMAP_SEND_LDFLAGS += $(CURL_LIBCURL)
              endif
              ifndef NO_EXPAT
    @@ Makefile: git-imap-send$X: imap-send.o $(IMAP_SEND_BUILDDEPS) GIT-LDFLAGS $(GITL
      	$(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \
      		$(IMAP_SEND_LDFLAGS) $(LIBS)
      
    --git-http-fetch$X: lib/http.o lib/http-walker.o http-fetch.o GIT-LDFLAGS $(GITLIBS)
    -+git-http-fetch$X: lib/http.o lib/http-walker.o http-fetch.o $(LAZYLOAD_LIBCURL_OBJ) GIT-LDFLAGS $(GITLIBS)
    +-git-http-fetch$X: http.o http-walker.o http-fetch.o GIT-LDFLAGS $(GITLIBS)
    ++git-http-fetch$X: http.o http-walker.o http-fetch.o $(LAZYLOAD_LIBCURL_OBJ) GIT-LDFLAGS $(GITLIBS)
      	$(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \
      		$(CURL_LIBCURL) $(LIBS)
    --git-http-push$X: lib/http.o http-push.o GIT-LDFLAGS $(GITLIBS)
    -+git-http-push$X: lib/http.o http-push.o $(LAZYLOAD_LIBCURL_OBJ) GIT-LDFLAGS $(GITLIBS)
    +-git-http-push$X: http.o http-push.o GIT-LDFLAGS $(GITLIBS)
    ++git-http-push$X: http.o http-push.o $(LAZYLOAD_LIBCURL_OBJ) GIT-LDFLAGS $(GITLIBS)
      	$(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \
      		$(CURL_LIBCURL) $(EXPAT_LIBEXPAT) $(LIBS)
      
    @@ Makefile: $(REMOTE_CURL_ALIASES): $(REMOTE_CURL_PRIMARY)
      	ln -s $< $@ 2>/dev/null || \
      	cp $< $@
      
    --$(REMOTE_CURL_PRIMARY): remote-curl.o lib/http.o lib/http-walker.o GIT-LDFLAGS $(GITLIBS)
    -+$(REMOTE_CURL_PRIMARY): remote-curl.o lib/http.o lib/http-walker.o $(LAZYLOAD_LIBCURL_OBJ) GIT-LDFLAGS $(GITLIBS)
    +-$(REMOTE_CURL_PRIMARY): remote-curl.o http.o http-walker.o GIT-LDFLAGS $(GITLIBS)
    ++$(REMOTE_CURL_PRIMARY): remote-curl.o http.o http-walker.o $(LAZYLOAD_LIBCURL_OBJ) GIT-LDFLAGS $(GITLIBS)
      	$(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \
      		$(CURL_LIBCURL) $(EXPAT_LIBEXPAT) $(LIBS)
      
     
    - ## lib/compat/lazyload-curl.c (new) ##
    + ## compat/lazyload-curl.c (new) ##
     @@
     +#include "../git-compat-util.h"
     +#include "../git-curl-compat.h"

Resolved: 21419c0 (mingw: do load libcurl dynamically by default, 2023-05-07)

added LAZYLOAD_LIBCURL line before COMPAT_CFLAGS, using upstream's updated include paths (Icompat instead of Ilib/compat)

Range-diff
  • 1: 21419c0 ! 1: 0ae0b61 mingw: do load libcurl dynamically by default

    @@ config.mak.uname: ifeq ($(uname_S),MINGW)
      	CSPRNG_METHOD = rtlgenrandom
      	BASIC_LDFLAGS += -municode -Wl,--tsaware
     +	LAZYLOAD_LIBCURL = YesDoThatPlease
    - 	COMPAT_CFLAGS += -DNOGDI -Ilib/compat -Ilib/compat/win32
    + 	COMPAT_CFLAGS += -DNOGDI -Icompat -Icompat/win32
      	COMPAT_CFLAGS += -DSTRIP_EXTENSION=\".exe\"
    - 	COMPAT_OBJS += lib/compat/mingw.o lib/compat/winansi.o \
    + 	COMPAT_OBJS += compat/mingw.o compat/winansi.o \

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

adapted patch from lib/compat/ to compat/ paths: kept HEAD's directory structure (no lib/ prefix) and added compat/win32/wsl.o and compat/win32/wsl.c entries to config.mak.uname, CMakeLists.txt, and meson.build

Range-diff
  • 1: 45ce288 ! 1: f180533 mingw: optionally enable wsl compability file mode bits

    @@ Documentation/config/core.adoc: core.maxTreeDepth::
     +	bits of the file in the way of wsl, so that the executable flag of
     +	files can be set or read correctly.
     
    - ## config.mak.uname ##
    -@@ config.mak.uname: endif
    - 		lib/compat/win32/path-utils.o \
    - 		lib/compat/win32/pthread.o lib/compat/win32/syslog.o \
    - 		lib/compat/win32/trace2_win32_process_info.o \
    --		lib/compat/win32/dirent.o
    -+		lib/compat/win32/dirent.o lib/compat/win32/wsl.o
    - 	COMPAT_CFLAGS = -D__USE_MINGW_ACCESS -DDETECT_MSYS_TTY \
    - 		-DENSURE_MSYSTEM_IS_SET="\"$(MSYSTEM)\"" -DMINGW_PREFIX="\"$(patsubst /%,%,$(MINGW_PREFIX))\"" \
    - 		-DNOGDI -DHAVE_STRING_H -Ilib/compat -Ilib/compat/regex -Ilib/compat/win32 -DSTRIP_EXTENSION=\".exe\"
    -@@ config.mak.uname: ifeq ($(uname_S),MINGW)
    - 		lib/compat/win32/flush.o \
    - 		lib/compat/win32/path-utils.o \
    - 		lib/compat/win32/pthread.o lib/compat/win32/syslog.o \
    --		lib/compat/win32/dirent.o
    -+		lib/compat/win32/dirent.o lib/compat/win32/wsl.o
    - 	BASIC_CFLAGS += -DWIN32
    - 	EXTLIBS += -lws2_32
    - 	GITLIBS += git.res
    -
    - ## contrib/buildsystems/CMakeLists.txt ##
    -@@ contrib/buildsystems/CMakeLists.txt: if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
    - 		lib/compat/win32/syslog.c
    - 		lib/compat/win32/trace2_win32_process_info.c
    - 		lib/compat/win32/dirent.c
    -+		lib/compat/win32/wsl.c
    - 		lib/compat/strdup.c)
    - 	set(NO_UNIX_SOCKETS 1)
    - 
    -
    - ## lib/compat/mingw.c ##
    + ## compat/mingw.c ##
     @@
      #include "win32.h"
      #include "win32/exit-process.h"
    @@ lib/compat/mingw.c
      #include "wrapper.h"
      #include <aclapi.h>
      #include <conio.h>
    -@@ lib/compat/mingw.c: int mingw_open (const char *filename, int oflags, ...)
    +@@ compat/mingw.c: int mingw_open (const char *filename, int oflags, ...)
      	if (fd < 0 && create && GetLastError() == ERROR_ACCESS_DENIED &&
      	    INIT_PROC_ADDR(RtlGetLastNtStatus) && RtlGetLastNtStatus() == STATUS_DELETE_PENDING)
      		errno = EEXIST;
    @@ lib/compat/mingw.c: int mingw_open (const char *filename, int oflags, ...)
      	if (fd < 0 && (oflags & O_ACCMODE) != O_RDONLY && errno == EACCES) {
      		DWORD attrs = GetFileAttributesW(wfilename);
      		if (attrs != INVALID_FILE_ATTRIBUTES && (attrs & FILE_ATTRIBUTE_DIRECTORY))
    -@@ lib/compat/mingw.c: int mingw_lstat(const char *file_name, struct stat *buf)
    +@@ compat/mingw.c: int mingw_lstat(const char *file_name, struct stat *buf)
      		filetime_to_timespec(&(fdata.ftLastAccessTime), &(buf->st_atim));
      		filetime_to_timespec(&(fdata.ftLastWriteTime), &(buf->st_mtim));
      		filetime_to_timespec(&(fdata.ftCreationTime), &(buf->st_ctim));
    @@ lib/compat/mingw.c: int mingw_lstat(const char *file_name, struct stat *buf)
      		return 0;
      	}
      
    -@@ lib/compat/mingw.c: static int get_file_info_by_handle(HANDLE hnd, struct stat *buf)
    +@@ compat/mingw.c: static int get_file_info_by_handle(HANDLE hnd, struct stat *buf)
      	filetime_to_timespec(&(fdata.ftLastAccessTime), &(buf->st_atim));
      	filetime_to_timespec(&(fdata.ftLastWriteTime), &(buf->st_mtim));
      	filetime_to_timespec(&(fdata.ftCreationTime), &(buf->st_ctim));
    @@ lib/compat/mingw.c: static int get_file_info_by_handle(HANDLE hnd, struct stat *
      }
      
     
    - ## lib/compat/win32/wsl.c (new) ##
    + ## compat/win32/wsl.c (new) ##
     @@
     +#define USE_THE_REPOSITORY_VARIABLE
     +#include "../../git-compat-util.h"
    @@ lib/compat/win32/wsl.c (new)
     +	return -1;
     +}
     
    - ## lib/compat/win32/wsl.h (new) ##
    + ## compat/win32/wsl.h (new) ##
     @@
     +#ifndef COMPAT_WIN32_WSL_H
     +#define COMPAT_WIN32_WSL_H
    @@ lib/compat/win32/wsl.h (new)
     +
     +#endif
     
    + ## config.mak.uname ##
    +@@ config.mak.uname: endif
    + 		compat/win32/path-utils.o \
    + 		compat/win32/pthread.o compat/win32/syslog.o \
    + 		compat/win32/trace2_win32_process_info.o \
    +-		compat/win32/dirent.o
    ++		compat/win32/dirent.o compat/win32/wsl.o
    + 	COMPAT_CFLAGS = -D__USE_MINGW_ACCESS -DDETECT_MSYS_TTY \
    + 		-DENSURE_MSYSTEM_IS_SET="\"$(MSYSTEM)\"" -DMINGW_PREFIX="\"$(patsubst /%,%,$(MINGW_PREFIX))\"" \
    + 		-DNOGDI -DHAVE_STRING_H -Icompat -Icompat/regex -Icompat/win32 -DSTRIP_EXTENSION=\".exe\"
    +@@ config.mak.uname: ifeq ($(uname_S),MINGW)
    + 		compat/win32/flush.o \
    + 		compat/win32/path-utils.o \
    + 		compat/win32/pthread.o compat/win32/syslog.o \
    +-		compat/win32/dirent.o
    ++		compat/win32/dirent.o compat/win32/wsl.o
    + 	BASIC_CFLAGS += -DWIN32
    + 	EXTLIBS += -lws2_32
    + 	GITLIBS += git.res
    +
    + ## 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/win32/wsl.c
    + 		compat/strdup.c)
    + 	set(NO_UNIX_SOCKETS 1)
    + 
    +
      ## meson.build ##
     @@ meson.build: elif host_machine.system() == 'windows'
    -     'lib/compat/win32/path-utils.c',
    -     'lib/compat/win32/pthread.c',
    -     'lib/compat/win32/syslog.c',
    -+    'lib/compat/win32/wsl.c',
    -     'lib/compat/win32mmap.c',
    +     'compat/win32/path-utils.c',
    +     'compat/win32/pthread.c',
    +     'compat/win32/syslog.c',
    ++    'compat/win32/wsl.c',
    +     'compat/win32mmap.c',
        ]
      

Resolved: 0212fdd (fast-import: drop the six size casts in the object-read paths, 2026-06-05)

kept upstream's struct iovec iov[3] declaration alongside REBASE_HEAD's unsigned long sizesize_t size type change

Range-diff
  • 1: 0212fdd ! 1: dcad1f1 fast-import: drop the six size casts in the object-read paths

    @@ builtin/fast-import.c: static void parse_from_existing(struct branch *b)
      		parse_from_commit(b, buf, size);
      		free(buf);
      	}
    -@@ builtin/fast-import.c: static int parse_objectish(struct branch *b, const char *objectish)
    +@@ builtin/fast-import.c: static int parse_objectish(struct fast_import_state *state, struct branch *b, co
      		if (!oideq(&b->oid, &oe->idx.oid)) {
      			oidcpy(&b->oid, &oe->idx.oid);
      			if (oe->pack_id != MAX_PACK_ID) {
    @@ builtin/fast-import.c: static int parse_objectish(struct branch *b, const char *
      				char *buf = gfi_unpack_entry(oe, &size);
      				parse_from_commit(b, buf, size);
      				free(buf);
    -@@ builtin/fast-import.c: static void cat_blob_write(const char *buf, unsigned long size)
    - static void cat_blob(struct object_entry *oe, struct object_id *oid)
    +@@ builtin/fast-import.c: static void cat_blob(struct object_entry *oe, struct object_id *oid)
      {
      	struct strbuf line = STRBUF_INIT;
    + 	struct iovec iov[3];
     -	unsigned long size;
     +	size_t size;
      	enum object_type type = 0;
    @@ builtin/fast-import.c: static void cat_blob_write(const char *buf, unsigned long
      	} else {
      		type = oe->type;
      		buf = gfi_unpack_entry(oe, &size);
    -@@ builtin/fast-import.c: static void parse_cat_blob(const char *p)
    +@@ builtin/fast-import.c: static void parse_cat_blob(struct fast_import_state *state UNUSED, const char *p
      static struct object_entry *dereference(struct object_entry *oe,
      					struct object_id *oid)
      {

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

adapted fscache additions from lib/compat/ to compat/ paths in all build systems (config.mak.uname, CMakeLists.txt, meson.build) and staged the new fscache.c/fscache.h files

Range-diff
  • 1: 4303828 ! 1: 765a2f1 mingw: add a cache below mingw's lstat and dirent implementations

    @@ Commit message
         Signed-off-by: Karsten Blees <blees@dcon.de>
         Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
     
    - ## config.mak.uname ##
    -@@ config.mak.uname: endif
    - 		lib/compat/win32/path-utils.o \
    - 		lib/compat/win32/pthread.o lib/compat/win32/syslog.o \
    - 		lib/compat/win32/trace2_win32_process_info.o \
    --		lib/compat/win32/dirent.o lib/compat/win32/wsl.o
    -+		lib/compat/win32/dirent.o lib/compat/win32/fscache.o lib/compat/win32/wsl.o
    - 	COMPAT_CFLAGS = -D__USE_MINGW_ACCESS -DDETECT_MSYS_TTY \
    - 		-DENSURE_MSYSTEM_IS_SET="\"$(MSYSTEM)\"" -DMINGW_PREFIX="\"$(patsubst /%,%,$(MINGW_PREFIX))\"" \
    - 		-DNOGDI -DHAVE_STRING_H -Ilib/compat -Ilib/compat/regex -Ilib/compat/win32 -DSTRIP_EXTENSION=\".exe\"
    -@@ config.mak.uname: ifeq ($(uname_S),MINGW)
    - 		lib/compat/win32/flush.o \
    - 		lib/compat/win32/path-utils.o \
    - 		lib/compat/win32/pthread.o lib/compat/win32/syslog.o \
    --		lib/compat/win32/dirent.o lib/compat/win32/wsl.o
    -+		lib/compat/win32/dirent.o lib/compat/win32/fscache.o lib/compat/win32/wsl.o
    - 	BASIC_CFLAGS += -DWIN32
    - 	EXTLIBS += -lws2_32
    - 	GITLIBS += git.res
    -
    - ## contrib/buildsystems/CMakeLists.txt ##
    -@@ contrib/buildsystems/CMakeLists.txt: if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
    - 		lib/compat/win32/trace2_win32_process_info.c
    - 		lib/compat/win32/dirent.c
    - 		lib/compat/win32/wsl.c
    --		lib/compat/strdup.c)
    -+		lib/compat/strdup.c
    -+		lib/compat/win32/fscache.c)
    - 	set(NO_UNIX_SOCKETS 1)
    - 
    - elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux")
    -
    - ## lib/compat/win32/fscache.c (new) ##
    + ## compat/win32/fscache.c (new) ##
     @@
     +#include "../../git-compat-util.h"
     +#include "../../hashmap.h"
    @@ lib/compat/win32/fscache.c (new)
     +	return (DIR*) dir;
     +}
     
    - ## lib/compat/win32/fscache.h (new) ##
    + ## compat/win32/fscache.h (new) ##
     @@
     +#ifndef FSCACHE_H
     +#define FSCACHE_H
    @@ lib/compat/win32/fscache.h (new)
     +
     +#endif
     
    - ## lib/git-compat-util.h ##
    -@@ lib/git-compat-util.h: static inline int is_xplatform_dir_sep(int c)
    + ## config.mak.uname ##
    +@@ config.mak.uname: endif
    + 		compat/win32/path-utils.o \
    + 		compat/win32/pthread.o compat/win32/syslog.o \
    + 		compat/win32/trace2_win32_process_info.o \
    +-		compat/win32/dirent.o compat/win32/wsl.o
    ++		compat/win32/dirent.o compat/win32/fscache.o compat/win32/wsl.o
    + 	COMPAT_CFLAGS = -D__USE_MINGW_ACCESS -DDETECT_MSYS_TTY \
    + 		-DENSURE_MSYSTEM_IS_SET="\"$(MSYSTEM)\"" -DMINGW_PREFIX="\"$(patsubst /%,%,$(MINGW_PREFIX))\"" \
    + 		-DNOGDI -DHAVE_STRING_H -Icompat -Icompat/regex -Icompat/win32 -DSTRIP_EXTENSION=\".exe\"
    +@@ config.mak.uname: ifeq ($(uname_S),MINGW)
    + 		compat/win32/flush.o \
    + 		compat/win32/path-utils.o \
    + 		compat/win32/pthread.o compat/win32/syslog.o \
    +-		compat/win32/dirent.o compat/win32/wsl.o
    ++		compat/win32/dirent.o compat/win32/fscache.o compat/win32/wsl.o
    + 	BASIC_CFLAGS += -DWIN32
    + 	EXTLIBS += -lws2_32
    + 	GITLIBS += git.res
    +
    + ## contrib/buildsystems/CMakeLists.txt ##
    +@@ 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/strdup.c)
    ++		compat/strdup.c
    ++		compat/win32/fscache.c)
    + 	set(NO_UNIX_SOCKETS 1)
    + 
    + elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux")
    +
    + ## git-compat-util.h ##
    +@@ git-compat-util.h: static inline int is_xplatform_dir_sep(int c)
      /* pull in Windows compatibility stuff */
      #include "compat/win32/path-utils.h"
      #include "compat/mingw.h"
    @@ lib/git-compat-util.h: static inline int is_xplatform_dir_sep(int c)
      #endif
      
      /* used on Mac OS X */
    -@@ lib/git-compat-util.h: static inline int is_missing_file_error(int errno_)
    +@@ git-compat-util.h: static inline int is_missing_file_error(int errno_)
      #ifndef enable_fscache
      #define enable_fscache(x) /* noop */
      #endif
    @@ lib/git-compat-util.h: static inline int is_missing_file_error(int errno_)
     
      ## meson.build ##
     @@ meson.build: elif host_machine.system() == 'windows'
    -     'lib/compat/winansi.c',
    -     'lib/compat/win32/dirent.c',
    -     'lib/compat/win32/flush.c',
    -+    'lib/compat/win32/fscache.c',
    -     'lib/compat/win32/path-utils.c',
    -     'lib/compat/win32/pthread.c',
    -     'lib/compat/win32/syslog.c',
    +     'compat/winansi.c',
    +     'compat/win32/dirent.c',
    +     'compat/win32/flush.c',
    ++    'compat/win32/fscache.c',
    +     'compat/win32/path-utils.c',
    +     'compat/win32/pthread.c',
    +     'compat/win32/syslog.c',

Resolved: 859d347 (fscache: teach fscache to use NtQueryDirectoryFile, 2018-11-15)

staged compat/win32/ntifs.h; path-rename conflict (lib/ prefix removed upstream) with correct content already on disk

Range-diff
  • 1: 859d347 ! 1: da65dab fscache: teach fscache to use NtQueryDirectoryFile

    @@ Commit message
         Signed-off-by: Ben Peart <benpeart@microsoft.com>
         Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
     
    - ## lib/compat/win32/fscache.c ##
    + ## compat/win32/fscache.c ##
     @@
      #include "../../trace.h"
      #include "config.h"
    @@ lib/compat/win32/fscache.c
      
      static volatile long initialized;
      static DWORD dwTlsIndex;
    -@@ lib/compat/win32/fscache.c: struct fscache {
    +@@ compat/win32/fscache.c: struct fscache {
      	unsigned int opendir_requests;
      	unsigned int fscache_requests;
      	unsigned int fscache_misses;
    @@ lib/compat/win32/fscache.c: struct fscache {
      };
      static struct trace_key trace_fscache = TRACE_KEY_INIT(FSCACHE);
      
    -@@ lib/compat/win32/fscache.c: static void fsentry_release(struct fsentry *fse)
    +@@ compat/win32/fscache.c: static void fsentry_release(struct fsentry *fse)
      	InterlockedDecrement(&(fse->u.refcnt));
      }
      
    @@ lib/compat/win32/fscache.c: static void fsentry_release(struct fsentry *fse)
      
      	return fse;
      }
    -@@ lib/compat/win32/fscache.c: static struct fsentry *fseentry_create_entry(struct fscache *cache,
    +@@ compat/win32/fscache.c: static struct fsentry *fseentry_create_entry(struct fscache *cache,
      static struct fsentry *fsentry_create_list(struct fscache *cache, const struct fsentry *dir,
      					   int *dir_not_found)
      {
    @@ lib/compat/win32/fscache.c: static struct fsentry *fseentry_create_entry(struct
      	HANDLE h;
      	int wlen;
      	struct fsentry *list, **phead;
    -@@ lib/compat/win32/fscache.c: static struct fsentry *fsentry_create_list(struct fscache *cache, const struct f
    +@@ compat/win32/fscache.c: static struct fsentry *fsentry_create_list(struct fscache *cache, const struct f
      		return NULL;
      	}
      
    @@ lib/compat/win32/fscache.c: static struct fsentry *fsentry_create_list(struct fs
      	if (h == INVALID_HANDLE_VALUE) {
      		err = GetLastError();
      		*dir_not_found = 1; /* or empty directory */
    -@@ lib/compat/win32/fscache.c: static struct fsentry *fsentry_create_list(struct fscache *cache, const struct f
    +@@ compat/win32/fscache.c: static struct fsentry *fsentry_create_list(struct fscache *cache, const struct f
      
      	/* walk directory and build linked list of fsentry structures */
      	phead = &list->next;
    @@ lib/compat/win32/fscache.c: static struct fsentry *fsentry_create_list(struct fs
      }
      
     
    - ## lib/compat/win32/ntifs.h (new) ##
    + ## compat/win32/ntifs.h (new) ##
     @@
     +#ifndef _NTIFS_
     +#define _NTIFS_

Resolved: d9a9787 (Some amendments for the hashliteral_t size fixes (git-for-windows#6311), 2026-07-03)

Resolved merge commit conflicts: kept HEAD for 13 files with collateral upstream changes; applied the intended t1007 fix (dropped !LONG_IS_64BIT prereq)

Range-diff
  • 1: d9a9787 ! 1: 7c2fa94 Some amendments for the hashliteral_t size fixes (Some amendments for the hashliteral_t size fixes git#6311)

    @@ Commit message
         to make a new Git for Windows release (to address [the
         NTLM](https://github.com/git-for-windows/git/issues/6308) issue).
     
    - ## lib/refs/reftable-backend.c ##
    -@@ lib/refs/reftable-backend.c: static struct ref_store *reftable_be_init(struct repository *repo,
    + ## builtin/fast-import.c ##
    + remerge CONFLICT (content): Merge conflict in builtin/fast-import.c
    + index add55f7c14..7d856af38d 100644
    + --- builtin/fast-import.c
    + +++ builtin/fast-import.c
    +@@ builtin/fast-import.c: static int store_object(
    + 	struct object_entry *e;
    + 	unsigned char hdr[96];
    + 	struct object_id oid;
    +-<<<<<<< 1236ea8105 (build(deps): bump actions/cache from 5 to 6 (#6303))
    + 	size_t hdrlen, deltalen = 0;
    +-=======
    +-	size_t hdrlen, deltalen;
    +->>>>>>> c8dff95af8 (fixup! hash-object: add a >4GB/LLP64 test case using filtered input)
    + 	struct git_hash_ctx c;
    + 	git_zstream s;
    + 	struct repo_config_values *cfg = repo_config_values(the_repository);
    +@@ builtin/fast-import.c: static void cat_blob_write(const char *buf, unsigned long size)
    + static void cat_blob(struct object_entry *oe, struct object_id *oid)
    + {
    + 	struct strbuf line = STRBUF_INIT;
    +-<<<<<<< 1236ea8105 (build(deps): bump actions/cache from 5 to 6 (#6303))
    + 	struct iovec iov[3];
    +-=======
    +->>>>>>> c8dff95af8 (fixup! hash-object: add a >4GB/LLP64 test case using filtered input)
    + 	size_t size;
    + 	enum object_type type = 0;
    + 	char *buf;
    +
    + ## ci/lib.sh ##
    + remerge CONFLICT (content): Merge conflict in ci/lib.sh
    + index dc0a608b4e..f31a36ceeb 100755
    + --- ci/lib.sh
    + +++ ci/lib.sh
    +@@ ci/lib.sh: export SKIP_DASHED_BUILT_INS=YesPlease
    + # In order to catch bugs introduced at integration time by mismerges,
    + # enable the long tests for pushes to the integration branches as well.
    + test -z "$MSYSTEM" ||
    +-<<<<<<< 1236ea8105 (build(deps): bump actions/cache from 5 to 6 (#6303))
    + case "$CI_EVENT,$CI_BRANCH" in
    +-=======
    +-case "$GITHUB_EVENT_NAME,$CI_BRANCH" in
    +->>>>>>> c8dff95af8 (fixup! hash-object: add a >4GB/LLP64 test case using filtered input)
    + pull_request,*|push,*next*|push,*master*|push,*main*|push,*maint*)
    + 	export GIT_TEST_LONG=${GIT_TEST_LONG:-true}
    + 	;;
    +
    + ## compat/mingw.c ##
    + remerge CONFLICT (content): Merge conflict in compat/mingw.c
    + index b8036a2405..df70bae6b6 100644
    + --- compat/mingw.c
    + +++ compat/mingw.c
    +@@ compat/mingw.c: static void setup_windows_environment(void)
    + 
    + 	if (!getenv("LC_ALL") && !getenv("LC_CTYPE") && !getenv("LANG"))
    + 		setenv("LC_CTYPE", "C.UTF-8", 1);
    +-<<<<<<< 1236ea8105 (build(deps): bump actions/cache from 5 to 6 (#6303))
    + }
    + 
    + int mingw_platform_has_symlinks(void)
    + {
    + 	static int has_symlinks = -1;
    +-=======
    +-
    +->>>>>>> c8dff95af8 (fixup! hash-object: add a >4GB/LLP64 test case using filtered input)
    + 	/*
    + 	 * Change 'core.symlinks' default to false, unless native symlinks are
    + 	 * enabled in MSys2 (via 'MSYS=winsymlinks:nativestrict'). Thus we can
    +
    + ## compat/win32/path-utils.c ##
    + remerge CONFLICT (content): Merge conflict in compat/win32/path-utils.c
    + index cc47b7a2de..84b620756a 100644
    + --- compat/win32/path-utils.c
    + +++ compat/win32/path-utils.c
    +@@
    + 
    + #include "../../git-compat-util.h"
    + #include "../../environment.h"
    +-<<<<<<< 1236ea8105 (build(deps): bump actions/cache from 5 to 6 (#6303))
    + #include "../../repository.h"
    +-=======
    +->>>>>>> c8dff95af8 (fixup! hash-object: add a >4GB/LLP64 test case using filtered input)
    + #include "../../wrapper.h"
    + #include "../../strbuf.h"
    + #include "../../versioncmp.h"
    +
    + ## config.mak.uname ##
    + remerge CONFLICT (content): Merge conflict in config.mak.uname
    + index d9ef37f304..e0c8dcef9c 100644
    + --- config.mak.uname
    + +++ config.mak.uname
    +@@ config.mak.uname: endif
    + 	EXTLIBS = user32.lib advapi32.lib shell32.lib wininet.lib ws2_32.lib invalidcontinue.obj kernel32.lib ntdll.lib
    + 	GITLIBS += git.res
    + 	PTHREAD_LIBS =
    +-<<<<<<< 1236ea8105 (build(deps): bump actions/cache from 5 to 6 (#6303))
    + 	RC = lib/compat/vcbuild/scripts/rc.pl
    +-=======
    +-	RC = compat/vcbuild/scripts/rc.pl
    +->>>>>>> c8dff95af8 (fixup! hash-object: add a >4GB/LLP64 test case using filtered input)
    + 	lib =
    + 	BASIC_CFLAGS += $(vcpkg_inc) $(sdk_includes) $(msvc_includes)
    + ifndef DEBUG
    +
    + ## git-compat-util.h ##
    + remerge CONFLICT (content): Merge conflict in git-compat-util.h
    + index a78bf91d42..4980c60506 100644
    + --- git-compat-util.h
    + +++ git-compat-util.h
    +@@ git-compat-util.h: struct fscache;
    + #ifndef enable_fscache
    + #define enable_fscache(x) /* noop */
    + #endif
    +-<<<<<<< 1236ea8105 (build(deps): bump actions/cache from 5 to 6 (#6303))
    + #ifndef flush_fscache
    + #define flush_fscache() /* noop */
    + #endif
    +-=======
    +->>>>>>> c8dff95af8 (fixup! hash-object: add a >4GB/LLP64 test case using filtered input)
    + 
    + #ifndef disable_fscache
    + #define disable_fscache() /* noop */
    +
    + ## meson_options.txt ##
    + remerge CONFLICT (content): Merge conflict in meson_options.txt
    + index 2f3d7340ae..427697f5f7 100644
    + --- meson_options.txt
    + +++ meson_options.txt
    +@@ meson_options.txt: option('runtime_prefix', type: 'boolean', value: false,
    +   description: 'Resolve ancillary tooling and support files relative to the location of the runtime binary instead of hard-coding them into the binary.')
    + option('sane_tool_path', type: 'array', value: [],
    +   description: 'An array of paths to pick up tools from in case the normal tools are broken or lacking.')
    +-<<<<<<< 1236ea8105 (build(deps): bump actions/cache from 5 to 6 (#6303))
    + option('nanosec', type: 'boolean', value: false,
    +   description: 'Care about sub-second file mtimes and ctimes.')
    +-=======
    +->>>>>>> c8dff95af8 (fixup! hash-object: add a >4GB/LLP64 test case using filtered input)
    + option('msystem', type: 'string', value: '',
    +   description: 'Fall-back on Windows when MSYSTEM is not set.')
    + option('mingw_prefix', type: 'string', value: '',
    +
    + ## object-file.c ##
    + remerge CONFLICT (content): Merge conflict in object-file.c
    + index a5dbfdb249..ec35c318bc 100644
    + --- object-file.c
    + +++ object-file.c
    +@@ object-file.c: int parse_loose_header(const char *hdr, struct object_info *oi)
    + 	return 0;
    + }
      
    - 	reftable_set_alloc(malloc, realloc, free);
    +-<<<<<<< 1236ea8105 (build(deps): bump actions/cache from 5 to 6 (#6303))
    +-=======
    +-static void hash_object_body(const struct git_hash_algo *algo, struct git_hash_ctx *c,
    +-			     const void *buf, size_t len,
    +-			     struct object_id *oid,
    +-			     char *hdr, size_t *hdrlen)
    +-{
    +-	algo->init_fn(c);
    +-	git_hash_update(c, hdr, *hdrlen);
    +-	git_hash_update(c, buf, len);
    +-	git_hash_final_oid(oid, c);
    +-}
    +-
    +-void write_object_file_prepare(const struct git_hash_algo *algo,
    +-			       const void *buf, size_t len,
    +-			       enum object_type type, struct object_id *oid,
    +-			       char *hdr, size_t *hdrlen)
    +-{
    +-	struct git_hash_ctx c;
    +-
    +-	/* Generate the header */
    +-	*hdrlen = format_object_header(hdr, *hdrlen, type, len);
    +-
    +-	/* Hash (function pointers) computation */
    +-	hash_object_body(algo, &c, buf, len, oid, hdr, hdrlen);
    +-}
    +-
    +->>>>>>> c8dff95af8 (fixup! hash-object: add a >4GB/LLP64 test case using filtered input)
    + #define CHECK_COLLISION_DEST_VANISHED -2
      
    -+	reftable_set_alloc(malloc, realloc, free);
    -+
    - 	refs_compute_filesystem_location(gitdir, payload, &is_worktree, &refdir,
    - 					 &ref_common_dir);
    + static int check_collision(const char *source, const char *dest)
    +@@ object-file.c: void hash_object_file(const struct git_hash_algo *algo, const void *buf,
    + {
    + 	struct git_hash_ctx c;
    + 	char hdr[MAX_HEADER_LEN];
    +-<<<<<<< 1236ea8105 (build(deps): bump actions/cache from 5 to 6 (#6303))
    + 	int hdrlen;
    +-=======
    +-	size_t hdrlen = sizeof(hdr);
    +->>>>>>> c8dff95af8 (fixup! hash-object: add a >4GB/LLP64 test case using filtered input)
      
    + 	hdrlen = format_object_header(hdr, sizeof(hdr), type, len);
    + 
    +
    + ## object-file.h ##
    + remerge CONFLICT (content): Merge conflict in object-file.h
    + index 499101b144..805f2cfa28 100644
    + --- object-file.h
    + +++ object-file.h
    +@@ object-file.h: int finalize_object_file_flags(struct repository *repo,
    + void hash_object_file(const struct git_hash_algo *algo, const void *buf,
    + 		      size_t len, enum object_type type,
    + 		      struct object_id *oid);
    +-<<<<<<< 1236ea8105 (build(deps): bump actions/cache from 5 to 6 (#6303))
    +-=======
    +-void write_object_file_prepare(const struct git_hash_algo *algo,
    +-			       const void *buf, size_t len,
    +-			       enum object_type type, struct object_id *oid,
    +-			       char *hdr, size_t *hdrlen);
    +-int write_loose_object(struct odb_source_loose *loose,
    +-		       const struct object_id *oid, char *hdr,
    +-		       int hdrlen, const void *buf, unsigned long len,
    +-		       time_t mtime, unsigned flags);
    +->>>>>>> c8dff95af8 (fixup! hash-object: add a >4GB/LLP64 test case using filtered input)
    + 
    + /* Helper to check and "touch" a file */
    + int check_and_freshen_file(const char *fn, int freshen,
    +
    + ## odb/source-loose.c ##
    + remerge CONFLICT (content): Merge conflict in odb/source-loose.c
    + index 22470da47d..ef0e919277 100644
    + --- odb/source-loose.c
    + +++ odb/source-loose.c
    +@@ odb/source-loose.c: static int write_loose_object(struct odb_source_loose *loose,
    + 
    + static int odb_source_loose_write_object(struct odb_source *source,
    + 					 const void *buf, size_t len,
    +-<<<<<<< 1236ea8105 (build(deps): bump actions/cache from 5 to 6 (#6303))
    + 					 enum object_type type,
    + 					 const struct object_id *oid,
    + 					 const struct object_id *compat_oid,
    + 					 const time_t *mtime,
    +-=======
    +-					 enum object_type type, struct object_id *oid,
    +-					 struct object_id *compat_oid_in,
    +->>>>>>> c8dff95af8 (fixup! hash-object: add a >4GB/LLP64 test case using filtered input)
    + 					 enum odb_write_object_flags flags)
    + {
    + 	struct odb_source_loose *loose = odb_source_loose_downcast(source);
    + 	char hdr[MAX_HEADER_LEN];
    +-<<<<<<< 1236ea8105 (build(deps): bump actions/cache from 5 to 6 (#6303))
    + 	int hdrlen;
    +-=======
    +-	size_t hdrlen = sizeof(hdr);
    +->>>>>>> c8dff95af8 (fixup! hash-object: add a >4GB/LLP64 test case using filtered input)
    + 
    + 	hdrlen = format_object_header(hdr, sizeof(hdr), type, len);
    + 
    +
    + ## send-pack.c ##
    + remerge CONFLICT (content): Merge conflict in send-pack.c
    + index d9b6efa9aa..0d3a0d330c 100644
    + --- send-pack.c
    + +++ send-pack.c
    +@@ send-pack.c: int send_pack(struct repository *r,
    + 		allow_deleting_refs = 1;
    + 	if (server_supports("ofs-delta"))
    + 		args->use_ofs_delta = 1;
    +-<<<<<<< 1236ea8105 (build(deps): bump actions/cache from 5 to 6 (#6303))
    + 	if (server_supports("no-ref-delta"))
    + 		args->no_ref_delta = 1;
    +-=======
    +->>>>>>> c8dff95af8 (fixup! hash-object: add a >4GB/LLP64 test case using filtered input)
    + 	use_sideband = use_sideband && server_supports("side-band-64k");
    + 	if (server_supports("quiet"))
    + 		quiet_supported = 1;
     
      ## t/t1007-hash-object.sh ##
    + remerge CONFLICT (content): Merge conflict in t/t1007-hash-object.sh
    + index 3baf9adac6..463b38f990 100755
    + --- t/t1007-hash-object.sh
    + +++ t/t1007-hash-object.sh
     @@ t/t1007-hash-object.sh: test_expect_success EXPENSIVE,SIZE_T_IS_64BIT \
      
      # This clean filter does nothing, other than excercising the interface.
      # We ensure that cleaning doesn't mangle large files on 64-bit Windows.
    +-<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 1236ea8105 (build(deps): bump actions/cache from 5 to 6 (#6303))
     -test_expect_success EXPENSIVE,SIZE_T_IS_64BIT,!LONG_IS_64BIT \
    -+test_expect_success EXPENSIVE,SIZE_T_IS_64BIT \
    +-================================
    + test_expect_success EXPENSIVE,SIZE_T_IS_64BIT \
    +->>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> c8dff95af8 (fixup! hash-object: add a >4GB/LLP64 test case using filtered input)
      		'hash filtered files over 4GB correctly' '
      	{ test -f big || test-tool genzeros $((5*1024*1024*1024)) >big; } &&
      	test_oid large5GB >expect &&
    +
    + ## t/t1517-outside-repo.sh ##
    + remerge CONFLICT (content): Merge conflict in t/t1517-outside-repo.sh
    + index 2077d12762..efbac29c0e 100755
    + --- t/t1517-outside-repo.sh
    + +++ t/t1517-outside-repo.sh
    +@@ t/t1517-outside-repo.sh: do
    + 	http-backend | http-fetch | http-push | init-db | \
    + 	mktag | p4 | p4.py | pickaxe | remote-ftp | remote-ftps | \
    + 	remote-http | remote-https | replay | send-email | \
    +-<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 1236ea8105 (build(deps): bump actions/cache from 5 to 6 (#6303))
    + 	sh-i18n--envsubst | shell | show | stage | survey | \
    + 	upload-archive--writer | upload-pack | whatchanged)
    + 		h_expect_outcome=expect_failure
    +@@ t/t1517-outside-repo.sh: do
    + 		h_expect_outcome=expect_success
    + 		all_expect_outcome=expect_failure
    + 		;;
    +-================================
    +-	sh-i18n--envsubst | shell | show | stage | submodule | survey | svn | \
    +-	upload-archive--writer | upload-pack | web--browse | whatchanged)
    +-		expect_outcome=expect_failure ;;
    +->>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> c8dff95af8 (fixup! hash-object: add a >4GB/LLP64 test case using filtered input)
    + 	*)
    + 		h_expect_outcome=expect_success
    + 		all_expect_outcome=expect_success
    +
    + ## t/t6403-merge-file.sh ##
    + remerge CONFLICT (content): Merge conflict in t/t6403-merge-file.sh
    + index 1bbbcb6547..bd58e471bc 100755
    + --- t/t6403-merge-file.sh
    + +++ t/t6403-merge-file.sh
    +@@ t/t6403-merge-file.sh: test_expect_success "expected conflict markers" '
    + test_expect_success 'binary files cannot be merged' '
    + 	test_must_fail git merge-file -p \
    + 		orig.txt "$TEST_DIRECTORY"/lib-diff/test-binary-1.png new1.txt 2> merge.err &&
    +-<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 1236ea8105 (build(deps): bump actions/cache from 5 to 6 (#6303))
    + 	test_grep "Cannot merge binary files" merge.err
    +-================================
    +-	grep "Cannot merge binary files" merge.err
    +->>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> c8dff95af8 (fixup! hash-object: add a >4GB/LLP64 test case using filtered input)
    + '
    + 
    + test_expect_success 'binary files cannot be merged with --object-id' '

To: 7608b4ab22 (Merge tag 'v2.55.0.windows.3', 2026-07-16) (8d82cfd875..7608b4ab22)

Statistics

Metric Count
Total conflicts 19
Skipped (upstreamed) 0
Resolved surgically 19
Range-diff (click to expand)
  • 1: 70bb86f ! 1: 3dc8192 mingw: skip symlink type auto-detection for network share targets

    @@ Commit message
         Assisted-by: Claude Opus 4.6
         Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
     
    - ## lib/compat/mingw.c ##
    -@@ lib/compat/mingw.c: process_phantom_symlink(const wchar_t *wtarget, const wchar_t *wlink)
    + ## compat/mingw.c ##
    +@@ compat/mingw.c: process_phantom_symlink(const wchar_t *wtarget, const wchar_t *wlink)
      	wchar_t relative[MAX_PATH];
      	const wchar_t *rel;
      
  • 2: 57bfd6e ! 2: eb5c1f7 unix-socket: avoid leak when initialization fails

    @@ Commit message
     
         Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
     
    - ## lib/unix-socket.c ##
    -@@ lib/unix-socket.c: int unix_stream_connect(const char *path, int disallow_chdir)
    + ## unix-socket.c ##
    +@@ unix-socket.c: int unix_stream_connect(const char *path, int disallow_chdir)
      	struct unix_sockaddr_context ctx;
      
      	if (unix_sockaddr_init(&sa, path, &ctx, disallow_chdir) < 0)
  • 3: 15b583d = 3: 07f14d8 Merge branch 'prevent-accidental-ntlm-exfiltration-via-symlinks'

  • 4: 77833d3 ! 4: c8fa178 grep: prevent ^$ false match at end of file

    @@ Commit message
         Reported-by: Olly Betts <olly@survex.com>
         Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
     
    - ## lib/grep.c ##
    -@@ lib/grep.c: static int grep_source_1(struct grep_opt *opt, struct grep_source *gs, int colle
    + ## grep.c ##
    +@@ grep.c: static int grep_source_1(struct grep_opt *opt, struct grep_source *gs, int colle
      
      	bol = gs->buf;
      	left = gs->size;
  • 5: b1efc37 = 5: ee4075d Merge branch 'v2.53.0.windows.3'

  • 6: dffe57a = 6: 27d17dc Merge branch 'fixes-from-the-git-mailing-list'

  • 7: 55c0a8d = 7: 1b1d964 t9350: point out that refs are not updated correctly

  • 12: 7081eb9 ! 8: 067e268 ci(vs-build): adapt to Visual Studio 2026 default on windows-latest

    @@ Commit message
     
      ## .github/workflows/main.yml ##
     @@ .github/workflows/main.yml: jobs:
    -         cmake `pwd`/contrib/buildsystems/ -DCMAKE_PREFIX_PATH=`pwd`/lib/compat/vcbuild/vcpkg/installed/x64-windows \
    +         cmake `pwd`/contrib/buildsystems/ -DCMAKE_PREFIX_PATH=`pwd`/compat/vcbuild/vcpkg/installed/x64-windows \
              -DNO_GETTEXT=YesPlease -DPERL_TESTS=OFF -DPYTHON_TESTS=OFF -DCURL_NO_CURL_CMAKE=ON
          - name: MSBuild
     -      run: msbuild git.sln -property:Configuration=Release -property:Platform=x64 -maxCpuCount:4 -property:PlatformToolset=v142
  • 8: e89b9ea ! 9: 47d6324 transport-helper: add trailing --

    @@ Commit message
         Signed-off-by: Sverre Rabbelier <srabbelier@gmail.com>
         Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
     
    - ## lib/transport-helper.c ##
    -@@ lib/transport-helper.c: static int get_exporter(struct transport *transport,
    + ## transport-helper.c ##
    +@@ transport-helper.c: static int get_exporter(struct transport *transport,
      	for (size_t i = 0; i < revlist_args->nr; i++)
      		strvec_push(&fastexport->args, revlist_args->items[i].string);
      
  • 25: fe90133 = 10: a0ca8c8 mingw: demonstrate a git add issue with NTFS junctions

  • 13: a5348d3 ! 11: e317a70 vcpkg_install: detect lack of Git

    @@ Commit message
     
         Signed-off-by: Philip Oakley <philipoakley@iee.email>
     
    - ## lib/compat/vcbuild/vcpkg_install.bat ##
    -@@ lib/compat/vcbuild/vcpkg_install.bat: REM ================================================================
    + ## compat/vcbuild/vcpkg_install.bat ##
    +@@ compat/vcbuild/vcpkg_install.bat: REM ================================================================
      
      	dir vcpkg\vcpkg.exe >nul 2>nul && GOTO :install_libraries
      
  • 28: 1d95f82 = 12: 0d59eb0 t5505/t5516: allow running without .git/branches/ i

Truncated; see the full conflict report in the workflow run summary.

chengzhuo5 and others added 30 commits July 19, 2026 08:25
By default, the buffer type of Windows' `stdout` is unbuffered (_IONBF),
and there is no need to manually fflush `stdout`.

But some programs, such as the Windows Filtering Platform driver
provided by the security software, may change the buffer type of
`stdout` to full buffering. This nees `fflush(stdout)` to be called
manually, otherwise there will be no output to `stdout`.

Signed-off-by: MinarKotonoha <chengzhuo5@qq.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
A long time ago, we decided to run tests in Git for Windows' SDK with
the default `winsymlinks` mode: copying instead of linking. This is
still the default mode of MSYS2 to this day.

However, this is not how most users run Git for Windows: As the majority
of Git for Windows' users seem to be on Windows 10 and newer, likely
having enabled Developer Mode (which allows creating symbolic links
without administrator privileges), they will run with symlink support
enabled.

This is the reason why it is crucial to get the fixes for CVE-2024-? to
the users, and also why it is crucial to ensure that the test suite
exercises the related test cases. This commit ensures the latter.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
In order to be a better Windows citizenship, Git should
save its configuration files on AppData folder. This can
enables git configuration files be replicated between machines
using the same Microsoft account logon which would reduce the
friction of setting up Git on new systems. Therefore, if
%APPDATA%\Git\config exists, we use it; otherwise
$HOME/.config/git/config is used.

Signed-off-by: Ariel Lourenco <ariellourenco@users.noreply.github.com>
Git LFS is now built with Go 1.21 which no longer supports Windows 7.
However, Git for Windows still wants to support Windows 7.

Ideally, Git LFS would re-introduce Windows 7 support until Git for
Windows drops support for Windows 7, but that's not going to happen:
git-for-windows#4996 (comment)

The next best thing we can do is to let the users know what is
happening, and how to get out of their fix, at least.

This is not quite as easy as it would first seem because programs
compiled with Go 1.21 or newer will simply throw an exception and fail
with an Access Violation on Windows 7.

The only way I found to address this is to replicate the logic from Go's
very own `version` command (which can determine the Go version with
which a given executable was built) to detect the situation, and in that
case offer a helpful error message.

This addresses git-for-windows#4996.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
The sparse tree walk algorithm was created in d5d2e93 (revision:
implement sparse algorithm, 2019-01-16) and involves using the
mark_trees_uninteresting_sparse() method. This method takes a repository
and an oidset of tree IDs, some of which have the UNINTERESTING flag and
some of which do not.

Create a method that has an equivalent set of preconditions but uses a
"dense" walk (recursively visits all reachable trees, as long as they
have not previously been marked UNINTERESTING). This is an important
difference from mark_tree_uninteresting(), which short-circuits if the
given tree has the UNINTERESTING flag.

A use of this method will be added in a later change, with a condition
set whether the sparse or dense approach should be used.

Signed-off-by: Derrick Stolee <stolee@gmail.com>
By default we will scan all references in "refs/heads/", "refs/tags/"
and "refs/remotes/".

Add command line opts let the use ask for all refs or a subset of them
and to include a detached HEAD.

Signed-off-by: Jeff Hostetler <git@jeffhostetler.com>
Signed-off-by: Derrick Stolee <stolee@gmail.com>
Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
When 'git survey' provides information to the user, this will be presented
in one of two formats: plaintext and JSON. The JSON implementation will be
delayed until the functionality is complete for the plaintext format.

The most important parts of the plaintext format are headers specifying the
different sections of the report and tables providing concreted data.

Create a custom table data structure that allows specifying a list of
strings for the row values. When printing the table, check each column for
the maximum width so we can create a table of the correct size from the
start.

The table structure is designed to be flexible to the different kinds of
output that will be implemented in future changes.

Signed-off-by: Derrick Stolee <stolee@gmail.com>
At the moment, nothing is obvious about the reason for the use of the
path-walk API, but this will become more prevelant in future iterations. For
now, use the path-walk API to sum up the counts of each kind of object.

For example, this is the reachable object summary output for my local repo:

REACHABLE OBJECT SUMMARY
========================
Object Type |  Count
------------+-------
       Tags |   1343
    Commits | 179344
      Trees | 314350
      Blobs | 184030

Signed-off-by: Derrick Stolee <stolee@gmail.com>
Now that we have explored objects by count, we can expand that a bit more to
summarize the data for the on-disk and inflated size of those objects. This
information is helpful for diagnosing both why disk space (and perhaps
clone or fetch times) is growing but also why certain operations are slow
because the inflated size of the abstract objects that must be processed is
so large.

Note: zlib-ng is slightly more efficient even at those small sizes. Even
between zlib versions, there are slight differences in compression. To
accommodate for that in the tests, not the exact numbers but some rough
approximations are validated (the test should validate `git survey`,
after all, not zlib).

Signed-off-by: Derrick Stolee <stolee@gmail.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Derrick Stolee <stolee@gmail.com>
The winsock2 library provides functions that work on different data
types than file descriptors, therefore we wrap them.

But that is not the only difference: they also do not set `errno` but
expect the callers to enquire about errors via `WSAGetLastError()`.

Let's translate that into appropriate `errno` values whenever the socket
operations fail so that Git's code base does not have to change its
expectations.

This closes git-for-windows#2404

Helped-by: Jeff Hostetler <jeffhost@microsoft.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
In future changes, we will make use of these methods. The intention is to
keep track of the top contributors according to some metric. We don't want
to store all of the entries and do a sort at the end, so track a
constant-size table and remove rows that get pushed out depending on the
chosen sorting algorithm.

Co-authored-by: Jeff Hostetler <git@jeffhostetler.com>
Signed-off-by; Jeff Hostetler <git@jeffhostetler.com>
Signed-off-by: Derrick Stolee <stolee@gmail.com>
We map WSAGetLastError() errors to errno errors in winsock_error_to_errno(),
but the MSVC strerror() implementation only produces "Unknown error" for
most of them. Produce some more meaningful error messages in these
cases.

Our builds for ARM64 link against the newer UCRT strerror() that does know
these errors, so we won't change the strerror() used there.

The wording of the messages is copied from glibc strerror() messages.

Reported-by: M Hickford <mirth.hickford@gmail.com>
Signed-off-by: Matthias Aßhauer <mha1993@live.de>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Although NTLM authentication is considered weak (extending even to
NTLMv2, which purportedly allows brute-forcing reasonably complex
8-character passwords in a matter of days, given ample compute
resources), it _is_ one of the authentication methods supported by
libcurl.

Note: The added test case *cannot* reuse the existing `custom_auth`
facility. The reason is that that facility is backed by an NPH script
("No Parse Headers"), which does not allow handling the 3-phase NTLM
authentication correctly (in my hands, the NPH script would not even be
called upon the Type 3 message, a "200 OK" would be returned, but no
headers, let alone the `git http-backend` output as payload). Having a
separate NTLM authentication script makes the exact workings clearer and
more readable, anyway.

Co-authored-by: Matthew John Cheetham <mjcheetham@outlook.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
This will come in handy in the next commit.

Signed-off-by: JiSeop Moon <zcube@zcube.kr>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Bert Belder <bertbelder@gmail.com>
Since we are already walking our reachable objects using the path-walk API,
let's now collect lists of the paths that contribute most to different
metrics. Specifically, we care about

 * Number of versions.
 * Total size on disk.
 * Total inflated size (no delta or zlib compression).

This information can be critical to discovering which parts of the
repository are causing the most growth, especially on-disk size. Different
packing strategies might help compress data more efficiently, but the toal
inflated size is a representation of the raw size of all snapshots of those
paths. Even when stored efficiently on disk, that size represents how much
information must be processed to complete a command such as 'git blame'.

The exact disk size seems to be not quite robust enough for testing, as
could be seen by the `linux-musl-meson` job consistently failing, possibly
because of zlib-ng deflates differently: t8100.4(git survey
(default)) was failing with a symptom like this:

   TOTAL OBJECT SIZES BY TYPE
   ===============================================
   Object Type | Count | Disk Size | Inflated Size
   ------------+-------+-----------+--------------
  -    Commits |    10 |      1523 |          2153
  +    Commits |    10 |      1528 |          2153
         Trees |    10 |       495 |          1706
         Blobs |    10 |       191 |           101
  -       Tags |     4 |       510 |           528
  +       Tags |     4 |       547 |           528

This means: the disk size is unlikely something we can verify robustly.
Since zlib-ng seems to increase the disk size of the tags from 528 to
547, we cannot even assume that the disk size is always smaller than the
inflated size. We will most likely want to either skip verifying the
disk size altogether, or go for some kind of fuzzy matching, say, by
replacing `s/ 1[45][0-9][0-9] / ~1.5k /` and `s/ [45][0-9][0-9] / ~½k /`
or something like that.

Signed-off-by: Derrick Stolee <stolee@gmail.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
This comment has been true for the longest time; The combination of the
two preceding commits made it incorrect, so let's drop that comment.

Signed-off-by: Matthias Aßhauer <mha1993@live.de>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
NTLM authentication is relatively weak. This is the case even with the
default setting of modern Windows versions, where NTLMv1 and LanManager
are disabled and only NTLMv2 is enabled: NTLMv2 hashes of even
reasonably complex 8-character passwords can be broken in a matter of
days, given enough compute resources.

Even worse: On Windows, NTLM authentication uses Security Support
Provider Interface ("SSPI"), which provides the credentials without
requiring the user to type them in.

Which means that an attacker could talk an unsuspecting user into
cloning from a server that is under the attacker's control and extracts
the user's NTLMv2 hash without their knowledge.

For that reason, let's disallow NTLM authentication by default.

NTLM authentication is quite simple to set up, though, and therefore
there are still some on-prem Azure DevOps setups out there whose users
and/or automation rely on this type of authentication. To give them an
escape hatch, introduce the `http.<url>.allowNTLMAuth` config setting
that can be set to `true` to opt back into using NTLM for a specific
remote repository.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
The `git_terminal_prompt()` function expects the terminal window to be
attached to a Win32 Console. However, this is not the case with terminal
windows other than `cmd.exe`'s, e.g. with MSys2's own `mintty`.

Non-cmd terminals such as `mintty` still have to have a Win32 Console
to be proper console programs, but have to hide the Win32 Console to
be able to provide more flexibility (such as being resizeable not only
vertically but also horizontally). By writing to that Win32 Console,
`git_terminal_prompt()` manages only to send the prompt to nowhere and
to wait for input from a Console to which the user has no access.

This commit introduces a function specifically to support `mintty` -- or
other terminals that are compatible with MSys2's `/dev/tty` emulation. We
use the `TERM` environment variable as an indicator for that: if the value
starts with "xterm" (such as `mintty`'s "xterm_256color"), we prefer to
let `xterm_prompt()` handle the user interaction.

The most prominent user of `git_terminal_prompt()` is certainly
`git-remote-https.exe`. It is an interesting use case because both
`stdin` and `stdout` are redirected when Git calls said executable, yet
it still wants to access the terminal.

When running inside a `mintty`, the terminal is not accessible to the
`git-remote-https.exe` program, though, because it is a MinGW program
and the `mintty` terminal is not backed by a Win32 console.

To solve that problem, we simply call out to the shell -- which is an
*MSys2* program and can therefore access `/dev/tty`.

Helped-by: nalla <nalla@hamal.uberspace.de>
Signed-off-by: Karsten Blees <blees@dcon.de>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
It is a known issue that a rename() can fail with an "Access denied"
error at times, when copying followed by deleting the original file
works. Let's just fall back to that behavior.

Signed-off-by: JiSeop Moon <zcube@zcube.kr>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
On Windows, symbolic links actually have a type depending on the target:
it can be a file or a directory.

In certain circumstances, this poses problems, e.g. when a symbolic link
is supposed to point into a submodule that is not checked out, so there
is no way for Git to auto-detect the type.

To help with that, we will add support over the course of the next
commits to specify that symlink type via the Git attributes. This
requires an index_state, though, something that Git for Windows'
`symlink()` replacement cannot know about because the function signature
is defined by the POSIX standard and not ours to change.

So let's introduce a helper function to create symbolic links that
*does* know about the index_state.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
The 'git survey' builtin provides several detail tables, such as "top
files by on-disk size". The size of these tables defaults to 10,
currently.

Allow the user to specify this number via a new --top=<N> option or the
new survey.top config key.

Signed-off-by: Derrick Stolee <stolee@gmail.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Commit 2406bf5 (Win32: detect unix socket support at runtime,
2024-04-03) introduced a runtime detection for whether the operating
system supports unix sockets for Windows, but a mistake snuck into the
tests. When building and testing Git without NO_UNIX_SOCKETS we
currently skip t0301-credential-cache on Windows if unix sockets are
supported and run the tests if they aren't.

Flip that logic to actually work the way it was intended.

Signed-off-by: Matthias Aßhauer <mha1993@live.de>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
The new default of Git is to disable NTLM authentication by default.

To help users find the escape hatch of that config setting, should they
need it, suggest it when the authentication failed and the server had
offered NTLM, i.e. if re-enabling it would fix the problem.

Helped-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Accessing the Windows console through the special CONIN$ / CONOUT$ devices
doesn't work properly for non-ASCII usernames an passwords.

It also doesn't work for terminal emulators that hide the native console
window (such as mintty), and 'TERM=xterm*' is not necessarily a reliable
indicator for such terminals.

The new shell_prompt() function, on the other hand, works fine for both
MSys1 and MSys2, in native console windows as well as mintty, and properly
supports Unicode. It just needs bash on the path (for 'read -s', which is
bash-specific).

On Windows, try to use the shell to read from the terminal. If that fails
with ENOENT (i.e. bash was not found), use CONIN/OUT as fallback.

Note: To test this, create a UTF-8 credential file with non-ASCII chars,
e.g. in git-bash: 'echo url=http://täst.com > cred.txt'. Then in git-cmd,
'git credential fill <cred.txt' works (shell version), while calling git
without the git-wrapper (i.e. 'mingw64\bin\git credential fill <cred.txt')
mangles non-ASCII chars in both console output and input.

Signed-off-by: Karsten Blees <blees@dcon.de>
In preparation for making this function a bit more complicated (to allow
for special-casing the `ContainerMappedDirectories` in Windows
containers, which look like a symbolic link, but are not), let's move it
out of the header.

Signed-off-by: JiSeop Moon <zcube@zcube.kr>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
On Windows, symbolic links have a type: a "file symlink" must point at
a file, and a "directory symlink" must point at a directory. If the
type of symlink does not match its target, it doesn't work.

Git does not record the type of symlink in the index or in a tree. On
checkout it'll guess the type, which only works if the target exists
at the time the symlink is created. This may often not be the case,
for example when the link points at a directory inside a submodule.

By specifying `symlink=file` or `symlink=dir` the user can specify what
type of symlink Git should create, so Git doesn't have to rely on
unreliable heuristics.

Signed-off-by: Bert Belder <bertbelder@gmail.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
It seems to be not exactly rare on Windows to install NTFS junction
points (the equivalent of "bind mounts" on Linux/Unix) in worktrees,
e.g. to map some development tools into a subdirectory.

In such a scenario, it is pretty horrible if `git clean -dfx` traverses
into the mapped directory and starts to "clean up".

Let's just not do that. Let's make sure before we traverse into a
directory that it is not a mount point (or junction).

This addresses git-for-windows#607

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
While this command is definitely something we _want_, chances are that
upstreaming this will require substantial changes.

We still want to be able to experiment with this before that, to focus
on what we need out of this command: To assist with diagnosing issues
with large repositories, as well as to help monitoring the growth and
the associated painpoints of such repositories.

To that end, we are about to integrate this command into
`microsoft/git`, to get the tool into the hands of users who need it
most, with the idea to iterate in close collaboration between these
users and the developers familar with Git's internals.

However, we will definitely want to avoid letting anybody have the
impression that this command, its exact inner workings, as well as its
output format, are anywhere close to stable. To make that fact utterly
clear (and thereby protect the freedom to iterate and innovate freely
before upstreaming the command), let's mark its output as experimental
in all-caps, as the first thing we do.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
dscho and others added 30 commits July 19, 2026 08:39
Includes touch-ups by 마누엘, Philip Oakley and 孙卓识.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
…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>
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>
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>
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>
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>
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>
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>
Upstream Git does not test their tags with the expensive set of tests,
so a couple of them seem quite broken for now, even so much as hanging
indefinitely.

It is outside of the responsibility of the Git for Windows project to
fix upstream's own tests for platforms other than Windows, so let's not
exercise them.

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

Start monitoring updates of Git for Windows' component in the open
Bumps [actions/cache](https://github.com/actions/cache) from 5 to 6.
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](actions/cache@v5...v6)

---
updated-dependencies:
- dependency-name: actions/cache
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Add a README.md for GitHub goodness.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Bumps [actions/cache](https://github.com/actions/cache) from 5 to 6.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/actions/cache/releases">actions/cache's
releases</a>.</em></p>
<blockquote>
<h2>v6.0.0</h2>
<h2>What's Changed</h2>
<ul>
<li>Update packages, migrate to ESM by <a
href="https://github.com/Samirat"><code>@​Samirat</code></a> in <a
href="https://redirect.github.com/actions/cache/pull/1760">actions/cache#1760</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/actions/cache/compare/v5...v6.0.0">https://github.com/actions/cache/compare/v5...v6.0.0</a></p>
<h2>v5.1.0</h2>
<h2>What's Changed</h2>
<ul>
<li>Bump <code>@​actions/cache</code> to v5.1.0 - handle read-only cache
access by <a
href="https://github.com/jasongin"><code>@​jasongin</code></a> in <a
href="https://redirect.github.com/actions/cache/pull/1775">actions/cache#1775</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/actions/cache/compare/v5...v5.1.0">https://github.com/actions/cache/compare/v5...v5.1.0</a></p>
<h2>v5.0.5</h2>
<h2>What's Changed</h2>
<ul>
<li>Update ts-http-runtime dependency by <a
href="https://github.com/yacaovsnc"><code>@​yacaovsnc</code></a> in <a
href="https://redirect.github.com/actions/cache/pull/1747">actions/cache#1747</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/actions/cache/compare/v5...v5.0.5">https://github.com/actions/cache/compare/v5...v5.0.5</a></p>
<h2>v5.0.4</h2>
<h2>What's Changed</h2>
<ul>
<li>Add release instructions and update maintainer docs by <a
href="https://github.com/Link"><code>@​Link</code></a>- in <a
href="https://redirect.github.com/actions/cache/pull/1696">actions/cache#1696</a></li>
<li>Potential fix for code scanning alert no. 52: Workflow does not
contain permissions by <a
href="https://github.com/Link"><code>@​Link</code></a>- in <a
href="https://redirect.github.com/actions/cache/pull/1697">actions/cache#1697</a></li>
<li>Fix workflow permissions and cleanup workflow names / formatting by
<a href="https://github.com/Link"><code>@​Link</code></a>- in <a
href="https://redirect.github.com/actions/cache/pull/1699">actions/cache#1699</a></li>
<li>docs: Update examples to use the latest version by <a
href="https://github.com/XZTDean"><code>@​XZTDean</code></a> in <a
href="https://redirect.github.com/actions/cache/pull/1690">actions/cache#1690</a></li>
<li>Fix proxy integration tests by <a
href="https://github.com/Link"><code>@​Link</code></a>- in <a
href="https://redirect.github.com/actions/cache/pull/1701">actions/cache#1701</a></li>
<li>Fix cache key in examples.md for bun.lock by <a
href="https://github.com/RyPeck"><code>@​RyPeck</code></a> in <a
href="https://redirect.github.com/actions/cache/pull/1722">actions/cache#1722</a></li>
<li>Update dependencies &amp; patch security vulnerabilities by <a
href="https://github.com/Link"><code>@​Link</code></a>- in <a
href="https://redirect.github.com/actions/cache/pull/1738">actions/cache#1738</a></li>
</ul>
<h2>New Contributors</h2>
<ul>
<li><a href="https://github.com/XZTDean"><code>@​XZTDean</code></a> made
their first contribution in <a
href="https://redirect.github.com/actions/cache/pull/1690">actions/cache#1690</a></li>
<li><a href="https://github.com/RyPeck"><code>@​RyPeck</code></a> made
their first contribution in <a
href="https://redirect.github.com/actions/cache/pull/1722">actions/cache#1722</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/actions/cache/compare/v5...v5.0.4">https://github.com/actions/cache/compare/v5...v5.0.4</a></p>
<h2>v5.0.3</h2>
<h2>What's Changed</h2>
<ul>
<li>Bump <code>@actions/cache</code> to v5.0.5 (Resolves: <a
href="https://github.com/actions/cache/security/dependabot/33">https://github.com/actions/cache/security/dependabot/33</a>)</li>
<li>Bump <code>@actions/core</code> to v2.0.3</li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/actions/cache/compare/v5...v5.0.3">https://github.com/actions/cache/compare/v5...v5.0.3</a></p>
<h2>v.5.0.2</h2>
<h1>v5.0.2</h1>
<h2>What's Changed</h2>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/actions/cache/blob/main/RELEASES.md">actions/cache's
changelog</a>.</em></p>
<blockquote>
<h1>Releases</h1>
<h2>How to prepare a release</h2>
<blockquote>
<p>[!NOTE]
Relevant for maintainers with write access only.</p>
</blockquote>
<ol>
<li>Switch to a new branch from <code>main</code>.</li>
<li>Run <code>npm test</code> to ensure all tests are passing.</li>
<li>Update the version in <a
href="https://github.com/actions/cache/blob/main/package.json"><code>https://github.com/actions/cache/blob/main/package.json</code></a>.</li>
<li>Run <code>npm run build</code> to update the compiled files.</li>
<li>Update this <a
href="https://github.com/actions/cache/blob/main/RELEASES.md"><code>https://github.com/actions/cache/blob/main/RELEASES.md</code></a>
with the new version and changes in the <code>## Changelog</code>
section.</li>
<li>Run <code>licensed cache</code> to update the license report.</li>
<li>Run <code>licensed status</code> and resolve any warnings by
updating the <a
href="https://github.com/actions/cache/blob/main/.licensed.yml"><code>https://github.com/actions/cache/blob/main/.licensed.yml</code></a>
file with the exceptions.</li>
<li>Commit your changes and push your branch upstream.</li>
<li>Open a pull request against <code>main</code> and get it reviewed
and merged.</li>
<li>Draft a new release <a
href="https://github.com/actions/cache/releases">https://github.com/actions/cache/releases</a>
use the same version number used in <code>package.json</code>
<ol>
<li>Create a new tag with the version number.</li>
<li>Auto generate release notes and update them to match the changes you
made in <code>RELEASES.md</code>.</li>
<li>Toggle the set as the latest release option.</li>
<li>Publish the release.</li>
</ol>
</li>
<li>Navigate to <a
href="https://github.com/actions/cache/actions/workflows/release-new-action-version.yml">https://github.com/actions/cache/actions/workflows/release-new-action-version.yml</a>
<ol>
<li>There should be a workflow run queued with the same version
number.</li>
<li>Approve the run to publish the new version and update the major tags
for this action.</li>
</ol>
</li>
</ol>
<h2>Changelog</h2>
<h3>6.1.0</h3>
<ul>
<li>Bump <code>@actions/cache</code> to v6.1.0 to pick up <a
href="https://redirect.github.com/actions/toolkit/pull/2435">actions/toolkit#2435
Handle cache write error due to read-only token</a></li>
<li>Switch redundant &quot;Cache save failed&quot; warning to debug log
in save-only</li>
</ul>
<h3>6.0.0</h3>
<ul>
<li>Updated <code>@actions/cache</code> to ^6.0.1,
<code>@actions/core</code> to ^3.0.1, <code>@actions/exec</code> to
^3.0.0, <code>@actions/io</code> to ^3.0.2</li>
<li>Migrated to ESM module system</li>
<li>Upgraded Jest to v30 and test infrastructure to be ESM
compatible</li>
</ul>
<h3>5.0.4</h3>
<ul>
<li>Bump <code>minimatch</code> to v3.1.5 (fixes ReDoS via globstar
patterns)</li>
<li>Bump <code>undici</code> to v6.24.1 (WebSocket decompression bomb
protection, header validation fixes)</li>
<li>Bump <code>fast-xml-parser</code> to v5.5.6</li>
</ul>
<h3>5.0.3</h3>
<ul>
<li>Bump <code>@actions/cache</code> to v5.0.5 (Resolves: <a
href="https://github.com/actions/cache/security/dependabot/33">https://github.com/actions/cache/security/dependabot/33</a>)</li>
<li>Bump <code>@actions/core</code> to v2.0.3</li>
</ul>
<h3>5.0.2</h3>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="https://github.com/actions/cache/commit/55cc8345863c7cc4c66a329aec7e433d2d1c52a9"><code>55cc834</code></a>
Merge pull request <a
href="https://redirect.github.com/actions/cache/issues/1768">#1768</a>
from jasongin/readonly-cache</li>
<li><a
href="https://github.com/actions/cache/commit/d8cd72f230726cdf4457ebb61ec1b593a8d12337"><code>d8cd72f</code></a>
Bump <code>@​actions/cache</code> to v6.1.0 - handle cache write error
due to RO token</li>
<li><a
href="https://github.com/actions/cache/commit/2c8a9bd7457de244a408f35966fab2fb45fda9c8"><code>2c8a9bd</code></a>
Merge pull request <a
href="https://redirect.github.com/actions/cache/issues/1760">#1760</a>
from actions/samirat/esm_migration_and_package_update</li>
<li><a
href="https://github.com/actions/cache/commit/e9b91fdc3fea7d79165fceb79042ef45c2d51023"><code>e9b91fd</code></a>
Prettier fixes</li>
<li><a
href="https://github.com/actions/cache/commit/e4884b8ff7f92ef6b52c79eda480bbc86e685adb"><code>e4884b8</code></a>
Rebuild dist</li>
<li><a
href="https://github.com/actions/cache/commit/10baf0191a3c426ea0fa4a3253a5c04233b6e18f"><code>10baf01</code></a>
Fixed licenses</li>
<li><a
href="https://github.com/actions/cache/commit/e39b386c9004d72a15d864ade8c0b3a702d47a37"><code>e39b386</code></a>
Fix test mock return order</li>
<li><a
href="https://github.com/actions/cache/commit/b6928203372a8571ff984c0c883ef3a1adfb0c06"><code>b692820</code></a>
PR feedback</li>
<li><a
href="https://github.com/actions/cache/commit/60749128a44d25d3c520a489e576380cf00ff3f1"><code>6074912</code></a>
Rebuild dist bundles as ESM to match type:module</li>
<li><a
href="https://github.com/actions/cache/commit/5a912e8b4af820fa082a0e75cfd2c782f8fbfe0e"><code>5a912e8</code></a>
Fix lint and jest issues</li>
<li>Additional commits viewable in <a
href="https://github.com/actions/cache/compare/v5...v6">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=actions/cache&package-manager=github_actions&previous-version=5&new-version=6)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>
)

While upstreaming those patches, I've been asked to adjust them. This
backports those fixes.

Of course, the _real_ reason to do this _now_ is that I need _some_ PR
to make a new Git for Windows release (to address [the
NTLM](git-for-windows#6308) issue).
Mirror what git survey already reports: lightweight tags
(pointing straight at a commit/tree/blob) and annotated tags
(pointing at an OBJ_TAG that is itself stored as a separate
object) are different things in many monorepo contexts, and one
of the differences git survey users routinely care about. Add
an annotated_tags counter to struct ref_stats, populate it in
count_references() by peeking at the ref OID's object type, and
expose it as a sub-row under Tags in the table output and as
references.tags.annotated.count in the machine-readable formats.

Step toward pivoting the standalone git survey command onto
git repo structure; this fills the first of the four feature
gaps documented in the assessment.

Tests in t1901 widened to assert the new row and key.

Assisted-by: Opus 4.7
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
`git repo structure` walks every reference enumerated by
`refs_for_each_ref()` and feeds each reference's tip into the path
walk that produces the object counts. There is no way to scope the
inquiry to a subset of refs, even though that is the most common
need when an operator is investigating what part of the history is
driving cost: only branches, only release tags, only one remote's
view, etc.

Add a single `--ref-filter=<pattern>` option that, when given,
restricts both the reference count and the object walk to refs whose
full name matches one of the patterns. The option is repeatable;
multiple patterns form a union, so `--ref-filter='refs/heads/*'
--ref-filter='refs/tags/v*'` includes local branches and tags whose
short name starts with `v`. Patterns use `wildmatch()` with
`WM_PATHNAME` semantics so a `*` does not cross `/`, matching the
convention used by `git for-each-ref` positional arguments.

Choosing a single flexible filter, rather than a proliferation of
per-kind flags like `--branches`, `--tags`, `--remotes`, keeps the
option surface small and lets the same mechanism express
narrow selections the per-kind flags could not, such as "only release
tags" (`'refs/tags/v*'`) or "only one remote's branches"
(`'refs/remotes/origin/*'`). Without `--ref-filter`, behaviour is
unchanged: every ref `refs_for_each_ref()` enumerates contributes.

Both the reference counter and the path-walk seeding (via
`add_pending_oid()`) sit on the same callback, so an early return
when no pattern matches naturally excludes a ref from both. No
separate object-walk machinery is needed.

Cover the two interesting code paths with tests in t1901: a single
filter narrowing to branches, and two filters unioning to include
both branches and tags.

Assisted-by: Opus 4.7
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
`git survey` distinguishes itself from `git repo structure` largely by
its path-level reporting: in addition to whole-repo totals it lists the
paths whose object histories dominate the repository, ranked by raw
count, on-disk size, and inflated size, separately for trees and blobs.
That is often the most actionable output from `git survey`, since it
points an operator at the directories and files that should be reviewed
for cleanup, sparse-checkout exclusion, or rewriting.

`git repo structure` already drives the same path-walk traversal that
`git survey` uses to gather its per-path numbers; the callback simply
discards the path. Aggregate per-(path, type) summaries inside that
existing callback and add a bounded, descending-sorted "top-N" table
keyed by each of the three axes. Gate the feature behind a new
`--top=<n>` option, defaulting to 0, so unadorned invocations are
unaffected and pay no extra work for the top-N tracking.

Mirror the sort and eviction strategy from `builtin/survey.c`: keep an
array of at most N entries sorted from largest to smallest, walk it
from the bottom on each candidate, and shift entries down when a new
one belongs. Compared to `builtin/survey.c`, drop the void-pointer
indirection in the table data, type the comparator's arguments, and
fold the trivial comparators into the `(a > b) - (a < b)` idiom.

For the human-readable `table` output, extend the existing nested
bullet layout with two new top-level sections, `* Top trees` and
`* Top blobs`, each containing three sub-tables (`Top by count`,
`Top by disk size`, `Top by inflated size`). The path becomes the row
name and the relevant scalar becomes the value, reusing
`stats_table_count_addf` and `stats_table_size_addf` so units and
column alignment match the rest of the table.

For the `lines`/`nul` key-value formats, emit one
`objects.<type>.top.by_<axis>.<rank>.path=<path>` entry alongside an
`objects.<type>.top.by_<axis>.<rank>.<axis>=<value>` entry per ranked
path, so consumers can dispatch by axis without parsing the schema.
The root tree's path is the empty string as produced by the path-walk
machinery; preserve that as-is to stay faithful to the upstream
representation rather than fabricating a placeholder.

This is the first piece of folding `git survey`'s functionality into
`git repo structure`. Subsequent commits will add the corresponding
configuration knob and, eventually, turn `git survey` into a thin
deprecated shim over `git repo structure`.

Assisted-by: Opus 4.7
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
The preceding commit added `--top=<n>` to `git repo structure`,
reporting the top-N paths per type ranked by count, on-disk size, and
inflated size. Cover the three behaviors that matter for that option:

  * Without `--top`, the key-value output emits no `top.*` keys, so
    existing parsers stay unaffected.

  * `--top=N` produces exactly N ranked entries on each of the six
    `objects.<type>.top.by_<axis>` axes (count/disk_size/inflated_size
    crossed with trees/blobs), and a constructed input where one blob
    is several orders of magnitude bigger than the other lets us
    assert the ordering on the disk-size and inflated-size axes.

  * A negative `--top` is rejected with a non-zero exit and a message
    naming the constraint, so a typo cannot silently degrade into the
    default zero.

Avoid grep patterns starting with `--`; grep would parse the leading
double dash as an option terminator.

Assisted-by: Opus 4.7
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
`git survey` exposes its `--top` default via `survey.top` so that a
site or per-repository operator can switch the detail tables on once
and have every subsequent invocation include them. Mirror that
ergonomics for `git repo structure` so that, as `git survey`'s
functionality is folded into `git repo structure`, the configuration
side of the migration story stays equivalent.

Add a small `git_config_int` callback bound to `repo.structure.top`
and invoke it before `parse_options()`, so a `--top=<N>` on the
command line cleanly overrides the configured default (including
`--top=0` to opt out of the detail tables when configuration enables
them). Reject negative configured values with the same wording as the
command-line guard, since `git_config_int()` happily returns negative
integers.

Document the new variable in a fresh `Documentation/config/repo.adoc`
and wire it into the alphabetical includes in `Documentation/config.adoc`
between `repack.adoc` and `rerere.adoc`. Cover the precedence
behaviour with a t1901 test: a configured value enables the tables by
default, and a command-line `--top=0` suppresses them again.

Note that the reported paths respect the `core.quotePath` setting.

Assisted-by: Opus 4.7
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
`git survey` started life as an experimental scale-measurement tool;
the preceding commits give `git repo structure` the path-level detail
tables and ref-scoping mechanism that were `git survey`'s main draw,
so the two now overlap substantially. Plan the migration explicitly:
add a short notice at the top of the description making clear which
of `git survey`'s knobs map to which `git repo structure` option, and
state that a future release will turn `git survey` into a thin shim
over `git repo structure`.

Putting the notice in the description (rather than only the synopsis)
ensures it shows up in `git help survey` rendering before the reader
sees any option specifics, so an operator skimming the page learns
about the replacement before adopting any survey-specific flags.

Assisted-by: Opus 4.7
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
`git survey` was an experimental scale-measurement tool whose
distinctive features (ref-kind filters, top-N path tables) are now
all available in `git repo structure`. With the path-level reporting
in place (commits "repo: filter the structure scope via
--ref-filter=<pattern>" and "repo: report top-N paths by count, disk,
and inflated size in structure"), there is no functionality `git
survey` provides that `git repo structure` cannot.

Replace the 764-line `git survey` implementation with a roughly
hundred-line shim that:

  * Accepts the existing `git survey` command line so callers in
    scripts continue to parse without changes.
  * Emits a deprecation warning naming the replacement command, so
    interactive users learn about the migration target.
  * Translates the survey-specific knobs into the equivalent
    `git repo structure` invocation and re-execs the canonical
    command via `execv_git_cmd()`. Per-kind ref selectors fan out
    into the corresponding `refs/heads/*`, `refs/tags/*`, etc.
    `--ref-filter` patterns; `--top=<N>` is forwarded directly;
    `--all-refs` becomes the absence of any `--ref-filter`.

Two survey options have no `git repo structure` counterpart:
`--verbose` controlled per-step trace output the new command does
not emit, and `--detached` selected the detached HEAD which
`git repo structure` does not enumerate separately. Both are
silently accepted and produce a single warning each, so old
invocations keep working while the absence of these knobs in `git
repo structure` is made visible.

Rewrite t8100 to assert the shim's contract: the deprecation
warning is printed, the output is byte-identical to a corresponding
`git repo structure` invocation, and the per-kind selector
translation produces the right `--ref-filter` pattern. The
preceding survey-specific output assertions (the multi-column
plaintext tables) no longer apply, since `git repo structure`'s
output format is now the canonical one and is covered by t1901.

The `survey.*` configuration keys (`survey.top`, `survey.progress`,
`survey.verbose`) are no longer honored by the shim. They were
mirrored by the preceding `repo.structure.top` work for the most
useful knob; users with `survey.top` set in config should migrate
to `repo.structure.top`. This is a backward-incompatible removal
documented by the deprecation notice in `git-survey.adoc`.

Assisted-by: Opus 4.7
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Git for Windows dropped Windows 7 support a long time ago. This patch
was carried in Git for Windows without making it upstream, and exists
exclusively to support Windows 7 users. Therefore it can now go enjoy
its retirement.

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

`git survey` was always experimental, and I never got around to
upstreaming it to make it non-experimental.

In the meantime, the `git repo structure` command was upstreamed
upstream, which covers most of the same ground with a cleaner option
surface and a stable output contract. This PR closes the remaining gap
(annotated-tag breakdown, ref scoping, top-N paths by
count/disk/inflated, and the corresponding configuration knob) and then
turns `git survey` into a thin shim that warns about deprecation,
translates its old command line into the equivalent `git repo structure`
invocation, and re-execs the canonical command. Net result: one
user-facing tool to maintain and to teach instead of two.

The intent is that scripts pinned to `git survey` keep working (a
warning aside), and that operators have a single answer when they ask
"how do I see what's making my repository large?". The `survey.*`
configuration keys are intentionally dropped; the only one that
mattered, `survey.top`, has a direct replacement in
`repo.structure.top`.
Git for Windows dropped Windows 7 support a long time ago.

There is a patch (introduced in
git-for-windows#5042 and in git-for-windows#5059) to detect
when Git LFS failed to start because of lack of Windows 7 support (which
was lost somewhat surprisingly, via a Go upgrade that slipped that
change in), and to provid a helpful message to the user in that
instance.

Since Git for Windows itself does not support Windows 7 anymore, that
patch is no longer necessary, either.
Git for Windows v2.55.0(3)

Changes since Git for Windows v2.55.0(2) (July 2nd 2026):

New Features

  * Comes with Git Credential Manager v2.9.0.

Bug Fixes

  * Fixes heap overflows in the credential helper wincred, see
    GHSA-rxqw-wxqg-g7hw for full details.
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.