Skip to content

Conversation

@dscho
Copy link
Member

@dscho dscho commented Jan 28, 2026

This PR rebases Git for Windows patches onto Git v2.53.0-rc2.

Previous merging-rebase: 3de3111

Range-diff relative to main
  • 1: b7572cc = 1: 72f5de3 sideband: mask control characters

  • 2: c9101ec = 2: 69ad776 sideband: introduce an "escape hatch" to allow control characters

  • 3: 201a9e8 = 3: ed536c9 sideband: do allow ANSI color sequences by default

  • 4: e2b8e90 = 4: 2cd5611 unix-socket: avoid leak when initialization fails

  • 5: 0db877b = 5: 154c3b8 grep: prevent ^$ false match at end of file

  • 6: e5598f4 = 6: 61ca56a t9350: point out that refs are not updated correctly

  • 7: 3d87e0a = 7: ae83d57 transport-helper: add trailing --

  • 9: ddd5b65 = 8: baaf717 remote-helper: check helper status after import/export

  • 10: 50eaec4 = 9: 579319b clean: do not traverse mount points

  • 12: 2fc76a5 = 10: f0d3793 Always auto-gc after calling a fast-import transport

  • 13: e428fcd = 11: f5f40f3 mingw: prevent regressions with "drive-less" absolute paths

  • 8: c132a44 = 12: 5d6daee mingw: include the Python parts in the build

  • 11: 77e482b = 13: 2f738e4 win32/pthread: avoid name clashes with winpthread

  • 15: 6af4208 = 14: 0f84586 git-compat-util: avoid redeclaring _DEFAULT_SOURCE

  • 92: 6ea9c7b = 15: e7cdf87 Import the source code of mimalloc v2.2.7

  • 93: 9e36739 = 16: 2f285ae mimalloc: adjust for building inside Git

  • 94: 8fec3de = 17: 7e3722c mimalloc: offer a build-time option to enable it

  • 16: b6ed1cc = 18: 299cf47 mingw: demonstrate a git add issue with NTFS junctions

  • 95: e12539b = 19: 9c43955 mingw: use mimalloc

  • 14: 64cc5c0 = 20: ee43a66 clean: remove mount points when possible

  • 18: 8d3faa1 = 21: 6f6e8f4 transport: optionally disable side-band-64k

  • 19: 7b837f5 = 22: 2c41f19 mingw: fix fatal error working on mapped network drives on Windows

  • 20: dafc08f = 23: 9632313 clink.pl: fix MSVC compile script to handle libcurl-d.lib

  • 22: ba8efe4 = 24: 71dccee vcpkg_install: detect lack of Git

  • 24: 1a46563 = 25: ea8a6b7 vcpkg_install: add comment regarding slow network connections

  • 17: 8efcfa2 = 26: ddf039e strbuf_realpath(): use platform-dependent API if available

  • 23: 52fa2ff = 27: 14dc736 t5505/t5516: allow running without .git/branches/ in the templates

  • 31: 8d6eca9 = 28: e94d827 vcbuild: install ARM64 dependencies when building ARM64 binaries

  • 25: 9931022 = 29: 69135d8 http: use new "best effort" strategy for Secure Channel revoke checking

  • 21: a69a076 = 30: 065aaec mingw: implement a platform-specific strbuf_realpath()

  • 26: d941d76 = 31: db0e354 t5505/t5516: fix white-space around redirectors

  • 27: feb30ec = 32: 0924bbd t3701: verify that we can add lots of files interactively

  • 28: 49bb910 = 33: d00df93 commit: accept "scissors" with CR/LF line endings

  • 29: 9a3cde1 = 34: 26563b2 t0014: fix indentation

  • 30: 977e14f = 35: 63e838f git-gui: accommodate for intent-to-add files

  • 32: b9a643e = 36: c3c19be vcbuild: add an option to install individual 'features'

  • 33: b74f300 = 37: 7262616 cmake: allow building for Windows/ARM64

  • 34: deee242 = 38: 8bea01b ci(vs-build) also build Windows/ARM64 artifacts

  • 35: 15d3496 = 39: 18aa03f Add schannel to curl installation

  • 36: 981b752 = 40: 702dc26 cmake(): allow setting HOST_CPU for cross-compilation

  • 41: 1c43a63 = 41: 88a65bf CMake: default Visual Studio generator has changed

  • 40: 26d62a9 = 42: 1c0fe1a hash-object: demonstrate a >4GB/LLP64 problem

  • 43: 12cda97 = 43: ee8cdf0 .gitignore: add Visual Studio CMakeSetting.json file

  • 42: 6a4b7be = 44: da87446 object-file.c: use size_t for header lengths

  • 45: ea7b2b4 = 45: 6057555 subtree: update contrib/subtree test target

  • 46: d7f4f1e = 46: 24849e3 CMakeLists: add default "x64-windows" arch for Visual Studio

  • 44: bf99aaf = 47: d5fab9b hash algorithms: use size_t for section lengths

  • 37: e618f99 = 48: f154867 mingw: allow for longer paths in parse_interpreter()

  • 38: 2d23682 = 49: 92b17b1 compat/vcbuild: document preferred way to build in Visual Studio

  • 39: 378c4b1 = 50: 6d4c9d6 http: optionally send SSL client certificate

  • 48: 24dcc3d = 51: 757a2c9 ci: run contrib/subtree tests in CI builds

  • 49: c19744f = 52: 23246b4 CMake: show Win32 and Generator_platform build-option values

  • 47: 59957d3 = 53: 28101c6 hash-object --stdin: verify that it works with >4GB/LLP64

  • 50: 35f6b16 = 54: 770dec4 hash-object: add another >4GB/LLP64 test case

  • 51: a0c7290 = 55: dbcd712 setup: properly use "%(prefix)/" when in WSL

  • 52: 3f5f177 = 56: 10f0986 Add config option windows.appendAtomically

  • 53: 536a9c2 = 57: 9ea1060 hash-object: add a >4GB/LLP64 test case using filtered input

  • 54: cd35bf4 = 58: d8f746f compat/mingw.c: do not warn when failing to get owner

  • 55: 3b71603 = 59: cb452cf mingw: $env:TERM="xterm-256color" for newer OSes

  • 56: 51a43ee = 60: 53be802 winansi: check result and Buffer before using Name

  • 58: 8b99bae ! 61: 6a8a5a9 mingw: change core.fsyncObjectFiles = 1 by default

    @@ compat/mingw.c
      #include <conio.h>
      #include <sddl.h>
     @@ compat/mingw.c: int wmain(int argc, const wchar_t **wargv)
    - #endif
      
      	maybe_redirect_std_handles();
    + 	adjust_symlink_flags();
     +	fsync_object_files = 1;
      
      	/* determine size of argv and environ conversion buffer */
  • 57: 9a55aac = 62: 4f2721c MinGW: link as terminal server aware

  • 59: 26f1d08 = 63: 4337ef0 Fix Windows version resources

  • 60: e30b81f = 64: 906ddd0 status: fix for old-style submodules with commondir

  • 96: f474630 = 65: 55d1066 windows: skip linking git-<command> for built-ins

  • 97: c1ef2a6 = 66: dd3b541 mingw: stop hard-coding CC = gcc

  • 98: 05de8af = 67: 6855ef0 mingw: drop the -D_USE_32BIT_TIME_T option

  • 99: 918ba07 = 68: fcae0f8 mingw: only use -Wl,--large-address-aware for 32-bit builds

  • 100: 1aa5301 = 69: fb3404d mingw: avoid over-specifying --pic-executable

  • 101: 72e167c = 70: 3471074 mingw: set the prefix and HOST_CPU as per MSYS2's settings

  • 102: 0b2e0b1 = 71: 75886a3 mingw: only enable the MSYS2-specific stuff when compiling in MSYS2

  • 103: d9d089e = 72: 71c1841 mingw: rely on MSYS2's metadata instead of hard-coding it

  • 104: 296bcb1 = 73: d1f0a5b mingw: always define ETC_* for MSYS2 environments

  • -: ---------- > 74: e23ad91 max_tree_depth: lower it for clang builds in general on Windows

  • 61: 5e3de95 = 75: 7af555c http: optionally load libcurl lazily

  • 62: 34ee368 = 76: 5ef2a8d http: support lazy-loading libcurl also on Windows

  • 67: d9992b0 = 77: 7238dd9 ci: work around a problem with HTTP/2 vs libcurl v8.10.0

  • 63: 6fa7c1f = 78: dd918bd http: when loading libcurl lazily, allow for multiple SSL backends

  • 68: 0ca7e76 = 79: ad2b49e revision: create mark_trees_uninteresting_dense()

  • 64: b7e2064 = 80: 9e5b795 mingw: do load libcurl dynamically by default

  • 65: 61df8a7 = 81: 11ef03e Add a GitHub workflow to verify that Git/Scalar work in Nano Server

  • 66: 3ee2cd6 = 82: 0a76992 mingw: suggest windows.appendAtomically in more cases

  • 69: 8af6f16 = 83: 650a165 win32: use native ANSI sequence processing, if possible

  • 70: 503d48a = 84: 9da49ca common-main.c: fflush stdout buffer upon exit

  • 71: 232239b = 85: 025e9a8 t5601/t7406(mingw): do run tests with symlink support

  • 72: 5c8e9d6 = 86: e4e770c win32: ensure that localtime_r() is declared even in i686 builds

  • 73: 95025b7 = 87: 3e9b12f Fallback to AppData if XDG_CONFIG_HOME is unset

  • 74: 4b35363 = 88: 70b9ce9 run-command: be helpful with Git LFS fails on Windows 7

  • 75: 1e07325 = 89: c99f450 survey: stub in new experimental 'git-survey' command

  • 76: 64e2fe8 = 90: ac99a8f survey: add command line opts to select references

  • 77: 9ffe2fa = 91: 949cf92 survey: start pretty printing data in table form

  • 78: 07d5439 = 92: 1743754 survey: add object count summary

  • 79: cb3a649 = 93: 03f77f8 survey: summarize total sizes by object type

  • 80: aff3c05 = 94: 7879885 survey: show progress during object walk

  • 82: f68c874 = 95: c797e5a mingw: make sure errno is set correctly when socket operations fail

  • 81: 825465c = 96: 3dcc8da survey: add ability to track prioritized lists

  • 84: 59cf350 = 97: 6358efd compat/mingw: handle WSA errors in strerror

  • 83: 9236c29 = 98: 338e9b9 survey: add report of "largest" paths

  • 86: ab302c5 = 99: 79c8bcc compat/mingw: drop outdated comment

  • 85: 72e6d68 = 100: 07beb8f survey: add --top= option and config

  • 88: 3c8010b = 101: 3ce045c t0301: actually test credential-cache on Windows

  • 87: a7462d2 = 102: e04c273 survey: clearly note the experimental nature in the output

  • 89: 2058ce7 = 103: fdc5dd8 credential-cache: handle ECONNREFUSED gracefully

  • 90: 7cd468e = 104: 746fc5e reftable: do make sure to use custom allocators

  • 91: 8d4233e = 105: e1a6400 check-whitespace: avoid alerts about upstream commits

  • 105: 04aa4bc < -: ---------- max_tree_depth: lower it for clang builds in general on Windows

  • 106: 28dd1b6 < -: ---------- mingw: ensure valid CTYPE

  • 220: c9aea16 = 106: 541d54b t/t5571-prep-push-hook.sh: Add test with writing to stderr

  • -: ---------- > 107: b53fe0e mingw: ensure valid CTYPE

  • 107: 32b25ff ! 108: 8e2d9a9 mingw: allow git.exe to be used instead of the "Git wrapper"

    @@ 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
  • 108: 8225152 = 109: 9a0a9c1 mingw: ignore HOMEDRIVE/HOMEPATH if it points to Windows' system directory

  • 109: 50fbcd2 = 110: b37402a clink.pl: fix libexpatd.lib link error when using MSVC

  • 110: 725cb58 = 111: eb66711 Makefile: clean up .ilk files when MSVC=1

  • 111: f19d985 = 112: 26af834 vcbuild: add support for compiling Windows resource files

  • 112: c6db63d = 113: 4d1cc40 config.mak.uname: add git.rc to MSVC builds

  • 113: edbffbb = 114: 4a2e42a clink.pl: ignore no-stack-protector arg on MSVC=1 builds

  • 114: 2f01002 = 115: a127f48 clink.pl: move default linker options for MSVC=1 builds

  • 115: 0f05ae1 = 116: 2910ae0 cmake: install headless-git.

  • 116: 5f10768 = 117: 97118b0 git.rc: include winuser.h

  • 117: f5ec36e = 118: a01bd81 git-svn: mark it as unsupported by the Git for Windows project

  • 118: e9815f7 = 119: 76c3bf3 ci(macos): skip the git p4 tests

  • 121: 7f7c792 = 120: 91dcc05 Win32: make FILETIME conversion functions public

  • 122: 91f7f63 = 121: 73c6e63 Win32: dirent.c: Move opendir down

  • 123: 9f7087c ! 122: c65ad57 mingw: make the dirent implementation pluggable

    @@ compat/win32/dirent.c
     +	xwcstoutf(ent->d_name, fdata->cFileName, MAX_PATH * 3);
      
      	/* Set file type, based on WIN32_FIND_DATA */
    - 	if (fdata->dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
    + 	if ((fdata->dwFileAttributes & FILE_ATTRIBUTE_REPARSE_POINT)
     @@ compat/win32/dirent.c: static inline void finddata2dirent(struct dirent *ent, WIN32_FIND_DATAW *fdata)
      		ent->d_type = DT_REG;
      }
  • 124: b7965da ! 123: cb36770 Win32: make the lstat implementation pluggable

    @@ compat/mingw-posix.h: int mingw_fstat(int fd, struct stat *buf);
      int mingw_utime(const char *file_name, const struct utimbuf *times);
     
      ## compat/mingw.c ##
    -@@ compat/mingw.c: static int do_stat_internal(int follow, const char *file_name, struct stat *buf)
    - 	return do_lstat(follow, alt_name, buf);
    +@@ compat/mingw.c: int mingw_lstat(const char *file_name, struct stat *buf)
    + 	return -1;
      }
      
     +int (*lstat)(const char *file_name, struct stat *buf) = mingw_lstat;
  • 125: 84d3560 = 124: 5ded7b7 mingw: add infrastructure for read-only file system level caches

  • 126: 7c775c7 ! 125: bf9f0e7 mingw: add a cache below mingw's lstat and dirent implementations

    @@ compat/win32/fscache.c (new)
     +
     +	fse = fsentry_alloc(list, buf, len);
     +
    -+	fse->st_mode = file_attr_to_st_mode(fdata->dwFileAttributes);
    -+	fse->dirent.d_type = S_ISDIR(fse->st_mode) ? DT_DIR : DT_REG;
    ++	fse->st_mode = file_attr_to_st_mode(fdata->FileAttributes,
    ++					    fdata->EaSize);
    ++	fse->dirent.d_type = S_ISREG(fse->st_mode) ? DT_REG :
    ++			S_ISDIR(fse->st_mode) ? DT_DIR : DT_LNK;
     +	fse->u.s.st_size = (((off64_t) (fdata->nFileSizeHigh)) << 32)
     +			| fdata->nFileSizeLow;
     +	filetime_to_timespec(&(fdata->ftLastAccessTime), &(fse->u.s.st_atim));
    @@ compat/win32/fscache.c (new)
     +		return -1;
     +	}
     +
    ++	/*
    ++	 * Special case symbolic links: FindFirstFile()/FindNextFile() did not
    ++	 * provide us with the length of the target path.
    ++	 */
    ++	if (fse->u.s.st_size == MAX_PATH && S_ISLNK(fse->st_mode)) {
    ++		char buf[MAX_LONG_PATH];
    ++		int len = readlink(filename, buf, sizeof(buf) - 1);
    ++
    ++		if (len > 0)
    ++			fse->u.s.st_size = len;
    ++	}
    ++
     +	/* copy stat data */
     +	st->st_ino = 0;
     +	st->st_gid = 0;
  • 127: 4571143 = 126: fb4c6a5 fscache: load directories only once

  • 128: e51b4ed = 127: d3105b4 fscache: add key for GIT_TRACE_FSCACHE

  • 129: 7db33ae = 128: 4650e13 fscache: remember not-found directories

  • 130: 3c86624 = 129: bba3243 fscache: add a test for the dir-not-found optimization

  • 131: cc29af6 = 130: 89545a1 add: use preload-index and fscache for performance

  • 132: bebad96 = 131: 89d3cb2 dir.c: make add_excludes aware of fscache during status

  • 133: b922002 = 132: dd81725 fscache: make fscache_enabled() public

  • 119: e644b3c = 133: 0bad704 git-gui--askyesno: fix funny text wrapping

  • 134: 14874a1 = 134: d74b0b0 dir.c: regression fix for add_excludes with fscache

  • 120: 1459c28 = 135: 31ddaed git-gui--askyesno (mingw): use Git for Windows' icon, if available

  • 135: 92c2cee = 136: 147e663 fetch-pack.c: enable fscache for stats under .git/objects

  • 136: a583117 = 137: 38e3b0b checkout.c: enable fscache for checkout again

  • 137: 183a9fd = 138: 9c26251 Enable the filesystem cache (fscache) in refresh_index().

  • 138: 57a05d9 = 139: 1064175 fscache: use FindFirstFileExW to avoid retrieving the short name

  • 139: 1623b4b = 140: 8f3d874 fscache: add GIT_TEST_FSCACHE support

  • 140: 80ad05d = 141: ed9e62e fscache: add fscache hit statistics

  • 141: 9087916 = 142: 16a1f18 unpack-trees: enable fscache for sparse-checkout

  • 142: f80f122 = 143: a919310 status: disable and free fscache at the end of the status command

  • 143: d677459 = 144: 3dd272a mem_pool: add GIT_TRACE_MEMPOOL support

  • 144: 5a61851 = 145: 86df8be fscache: fscache takes an initial size

  • 145: d3f50e9 = 146: 7ba4643 fscache: update fscache to be thread specific instead of global

  • 146: 06d8c74 ! 147: 7588ad5 fscache: teach fscache to use mempool

    @@ compat/win32/fscache.c: static struct fsentry *fseentry_create_entry(struct fsen
     -	fse = fsentry_alloc(list, buf, len);
     +	fse = fsentry_alloc(cache, list, buf, len);
      
    - 	fse->st_mode = file_attr_to_st_mode(fdata->dwFileAttributes);
    - 	fse->dirent.d_type = S_ISDIR(fse->st_mode) ? DT_DIR : DT_REG;
    + 	fse->st_mode = file_attr_to_st_mode(fdata->FileAttributes,
    + 					    fdata->EaSize);
     @@ compat/win32/fscache.c: static struct fsentry *fseentry_create_entry(struct fsentry *list,
       * Dir should not contain trailing '/'. Use an empty string for the current
       * directory (not "."!).
  • 147: afa186d ! 148: 260041f fscache: make fscache_enable() thread safe

    @@ compat/mingw.c
      #include "wrapper.h"
      #include "write-or-die.h"
     @@ compat/mingw.c: int wmain(int argc, const wchar_t **wargv)
    - 	/* initialize critical section for waitpid pinfo_t list */
      	InitializeCriticalSection(&pinfo_cs);
    + 	InitializeCriticalSection(&phantom_symlinks_cs);
      
     +	/* initialize critical section for fscache */
     +	InitializeCriticalSection(&fscache_cs);
  • 148: a017334 ! 149: 4aa340b fscache: teach fscache to use NtQueryDirectoryFile

    @@ compat/win32/fscache.c: static void fsentry_release(struct fsentry *fse)
      
      	fse = fsentry_alloc(cache, list, buf, len);
      
    --	fse->st_mode = file_attr_to_st_mode(fdata->dwFileAttributes);
    -+	fse->st_mode = file_attr_to_st_mode(fdata->FileAttributes);
    - 	fse->dirent.d_type = S_ISDIR(fse->st_mode) ? DT_DIR : DT_REG;
    +@@ compat/win32/fscache.c: static struct fsentry *fseentry_create_entry(struct fscache *cache,
    + 					    fdata->EaSize);
    + 	fse->dirent.d_type = S_ISREG(fse->st_mode) ? DT_REG :
    + 			S_ISDIR(fse->st_mode) ? DT_DIR : DT_LNK;
     -	fse->u.s.st_size = (((off64_t) (fdata->nFileSizeHigh)) << 32)
     -			| fdata->nFileSizeLow;
     -	filetime_to_timespec(&(fdata->ftLastAccessTime), &(fse->u.s.st_atim));
     -	filetime_to_timespec(&(fdata->ftLastWriteTime), &(fse->u.s.st_mtim));
     -	filetime_to_timespec(&(fdata->ftCreationTime), &(fse->u.s.st_ctim));
    -+	fse->u.s.st_size = fdata->EndOfFile.LowPart |
    -+		(((off_t)fdata->EndOfFile.HighPart) << 32);
    ++	fse->u.s.st_size = S_ISLNK(fse->st_mode) ? MAX_PATH :
    ++			fdata->EndOfFile.LowPart |
    ++			(((off_t)fdata->EndOfFile.HighPart) << 32);
     +	filetime_to_timespec((FILETIME *)&(fdata->LastAccessTime),
     +			     &(fse->u.s.st_atim));
     +	filetime_to_timespec((FILETIME *)&(fdata->LastWriteTime),
  • 149: 664e5ab ! 150: 91ce9a8 fscache: remember the reparse tag for each entry

    @@ compat/win32/fscache.c: static struct fsentry *fseentry_create_entry(struct fsca
     +		fdata->FileAttributes & FILE_ATTRIBUTE_REPARSE_POINT ?
     +		fdata->EaSize : 0;
     +
    - 	fse->st_mode = file_attr_to_st_mode(fdata->FileAttributes);
    - 	fse->dirent.d_type = S_ISDIR(fse->st_mode) ? DT_DIR : DT_REG;
    - 	fse->u.s.st_size = fdata->EndOfFile.LowPart |
    + 	fse->st_mode = file_attr_to_st_mode(fdata->FileAttributes,
    + 					    fdata->EaSize);
    + 	fse->dirent.d_type = S_ISREG(fse->st_mode) ? DT_REG :
  • 150: 463483a = 151: a08c6ea fscache: implement an FSCache-aware is_mount_point()

  • 151: ed191e3 = 152: 691bc35 clean: make use of FSCache

  • 152: 2183eb6 = 153: 519b619 pack-objects (mingw): demonstrate a segmentation fault with large deltas

  • 153: 0d86933 ! 154: 0b0dc0f mingw: support long paths

    @@ compat/mingw.c: static enum hide_dotfiles_type hide_dotfiles = HIDE_DOTFILES_DOT
      int mingw_core_config(const char *var, const char *value,
      		      const struct config_context *ctx UNUSED,
      		      void *cb UNUSED)
    +@@ compat/mingw.c: process_phantom_symlink(const wchar_t *wtarget, const wchar_t *wlink)
    + {
    + 	HANDLE hnd;
    + 	BY_HANDLE_FILE_INFORMATION fdata;
    +-	wchar_t relative[MAX_PATH];
    ++	wchar_t relative[MAX_LONG_PATH];
    + 	const wchar_t *rel;
    + 
    + 	/* check that wlink is still a file symlink */
     @@ compat/mingw.c: static wchar_t *normalize_ntpath(wchar_t *wbuf)
      int mingw_unlink(const char *pathname, int handle_in_use_error)
      {
    - 	int ret, tries = 0;
    + 	int tries = 0;
     -	wchar_t wpathname[MAX_PATH];
     -	if (xutftowcs_path(wpathname, pathname) < 0)
     +	wchar_t wpathname[MAX_LONG_PATH];
    @@ compat/mingw.c: static int is_dir_empty(const wchar_t *wpath)
     @@ compat/mingw.c: static int is_dir_empty(const wchar_t *wpath)
      int mingw_rmdir(const char *pathname)
      {
    - 	int ret, tries = 0;
    + 	int tries = 0;
     -	wchar_t wpathname[MAX_PATH];
     +	wchar_t wpathname[MAX_LONG_PATH];
      	struct stat st;
    @@ compat/mingw.c: int mingw_rmdir(const char *pathname)
     +	if (xutftowcs_long_path(wpathname, pathname) < 0)
      		return -1;
      
    - 	while ((ret = _wrmdir(wpathname)) == -1 && tries < ARRAY_SIZE(delay)) {
    + 	do {
     @@ compat/mingw.c: static int set_hidden_flag(const wchar_t *path, int set)
      int mingw_mkdir(const char *path, int mode UNUSED)
      {
    @@ compat/mingw.c: static int set_hidden_flag(const wchar_t *path, int set)
      		return -1;
     +
      	ret = _wmkdir(wpath);
    - 	if (!ret && needs_hiding(path))
    - 		return set_hidden_flag(wpath, 1);
    + 	if (!ret)
    + 		process_phantom_symlinks();
     @@ compat/mingw.c: int mingw_open (const char *filename, int oflags, ...)
      	va_list args;
      	unsigned mode;
    @@ compat/mingw.c: ssize_t mingw_write(int fd, const void *buf, size_t len)
      int mingw_chdir(const char *dirname)
      {
     -	wchar_t wdirname[MAX_PATH];
    +-
     -	if (xutftowcs_path(wdirname, dirname) < 0)
     +	int result;
     +	wchar_t wdirname[MAX_LONG_PATH];
     +	if (xutftowcs_long_path(wdirname, dirname) < 0)
      		return -1;
    --	return _wchdir(wdirname);
    -+	result = _wchdir(wdirname);
    + 
    + 	if (has_symlinks) {
    +@@ compat/mingw.c: int mingw_chdir(const char *dirname)
    + 		CloseHandle(hnd);
    + 	}
    + 
    +-	return _wchdir(normalize_ntpath(wdirname));
    ++	result = _wchdir(normalize_ntpath(wdirname));
     +	current_directory_len = GetCurrentDirectoryW(0, NULL);
     +	return result;
      }
    @@ compat/mingw.c: ssize_t mingw_write(int fd, const void *buf, size_t len)
      		return -1;
      	return _wchmod(wfilename, mode);
      }
    -@@ compat/mingw.c: static int has_valid_directory_prefix(wchar_t *wfilename)
    - static int do_lstat(int follow, const char *file_name, struct stat *buf)
    - {
    +@@ compat/mingw.c: int mingw_lstat(const char *file_name, struct stat *buf)
      	WIN32_FILE_ATTRIBUTE_DATA fdata;
    + 	DWORD reparse_tag = 0;
    + 	int link_len = 0;
     -	wchar_t wfilename[MAX_PATH];
    --	if (xutftowcs_path(wfilename, file_name) < 0)
    +-	int wlen = xutftowcs_path(wfilename, file_name);
     +	wchar_t wfilename[MAX_LONG_PATH];
    -+	if (xutftowcs_long_path(wfilename, file_name) < 0)
    ++	int wlen = xutftowcs_long_path(wfilename, file_name);
    + 	if (wlen < 0)
      		return -1;
      
    +@@ compat/mingw.c: int mingw_lstat(const char *file_name, struct stat *buf)
      	if (GetFileAttributesExW(wfilename, GetFileExInfoStandard, &fdata)) {
    + 		/* for reparse points, get the link tag and length */
    + 		if (fdata.dwFileAttributes & FILE_ATTRIBUTE_REPARSE_POINT) {
    +-			char tmpbuf[MAX_PATH];
    ++			char tmpbuf[MAX_LONG_PATH];
    + 
    + 			if (read_reparse_point(wfilename, FALSE, tmpbuf,
    + 					       &link_len, &reparse_tag) < 0)
    +@@ compat/mingw.c: static int get_file_info_by_handle(HANDLE hnd, struct stat *buf)
    + 
    + int mingw_stat(const char *file_name, struct stat *buf)
    + {
    +-	wchar_t wfile_name[MAX_PATH];
    ++	wchar_t wfile_name[MAX_LONG_PATH];
    + 	HANDLE hnd;
    + 	int result;
    + 
    + 	/* open the file and let Windows resolve the links */
    +-	if (xutftowcs_path(wfile_name, file_name) < 0)
    ++	if (xutftowcs_long_path(wfile_name, file_name) < 0)
    + 		return -1;
    + 	hnd = CreateFileW(wfile_name, 0,
    + 			FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, NULL,
     @@ compat/mingw.c: int mingw_utime (const char *file_name, const struct utimbuf *times)
      	FILETIME mft, aft;
      	int rc;
    @@ compat/mingw.c: static pid_t mingw_spawnve_fd(const char *cmd, const char **argv
      	if (dir && xutftowcs_path(wdir, dir) < 0)
     @@ compat/mingw.c: int mingw_rename(const char *pold, const char *pnew)
      	static int supports_file_rename_info_ex = 1;
    - 	DWORD attrs, gle;
    + 	DWORD attrs = INVALID_FILE_ATTRIBUTES, gle;
      	int tries = 0;
     -	wchar_t wpold[MAX_PATH], wpnew[MAX_PATH];
     +	wchar_t wpold[MAX_LONG_PATH], wpnew[MAX_LONG_PATH];
    @@ compat/mingw.c: int mingw_raise(int sig)
      		return -1;
      
      	if (!CreateHardLinkW(wnewpath, woldpath, NULL)) {
    +@@ compat/mingw.c: int link(const char *oldpath, const char *newpath)
    + 
    + int symlink(const char *target, const char *link)
    + {
    +-	wchar_t wtarget[MAX_PATH], wlink[MAX_PATH];
    ++	wchar_t wtarget[MAX_LONG_PATH], wlink[MAX_LONG_PATH];
    + 	int len;
    + 
    + 	/* fail if symlinks are disabled or API is not supported (WinXP) */
    +@@ compat/mingw.c: int symlink(const char *target, const char *link)
    + 		return -1;
    + 	}
    + 
    +-	if ((len = xutftowcs_path(wtarget, target)) < 0
    +-			|| xutftowcs_path(wlink, link) < 0)
    ++	if ((len = xutftowcs_long_path(wtarget, target)) < 0
    ++			|| xutftowcs_long_path(wlink, link) < 0)
    + 		return -1;
    + 
    + 	/* convert target dir separators to backslashes */
    +@@ compat/mingw.c: int symlink(const char *target, const char *link)
    + 
    + int readlink(const char *path, char *buf, size_t bufsiz)
    + {
    +-	WCHAR wpath[MAX_PATH];
    +-	char tmpbuf[MAX_PATH];
    ++	WCHAR wpath[MAX_LONG_PATH];
    ++	char tmpbuf[MAX_LONG_PATH];
    + 	int len;
    + 	DWORD tag;
    + 
    +-	if (xutftowcs_path(wpath, path) < 0)
    ++	if (xutftowcs_long_path(wpath, path) < 0)
    + 		return -1;
    + 
    + 	if (read_reparse_point(wpath, TRUE, tmpbuf, &len, &tag) < 0)
     @@ compat/mingw.c: int mingw_is_mount_point(struct strbuf *path)
      {
      	WIN32_FIND_DATAW findbuf = { 0 };
    @@ compat/win32/fscache.c: static void fsentry_init(struct fsentry *fse, struct fse
      		BUG("Trying to allocate fsentry for long path '%.*s'",
      		    (int)len, name);
      	memcpy(fse->dirent.d_name, name, len);
    +@@ compat/win32/fscache.c: static struct fsentry *fseentry_create_entry(struct fscache *cache,
    + 		fdata->EaSize : 0;
    + 
    + 	fse->st_mode = file_attr_to_st_mode(fdata->FileAttributes,
    +-					    fdata->EaSize);
    ++					    fdata->EaSize, buf);
    + 	fse->dirent.d_type = S_ISREG(fse->st_mode) ? DT_REG :
    + 			S_ISDIR(fse->st_mode) ? DT_DIR : DT_LNK;
    +-	fse->u.s.st_size = S_ISLNK(fse->st_mode) ? MAX_PATH :
    ++	fse->u.s.st_size = S_ISLNK(fse->st_mode) ? MAX_LONG_PATH :
    + 			fdata->EndOfFile.LowPart |
    + 			(((off_t)fdata->EndOfFile.HighPart) << 32);
    + 	filetime_to_timespec((FILETIME *)&(fdata->LastAccessTime),
     @@ 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)
    @@ compat/win32/fscache.c: static struct fsentry *fsentry_create_list(struct fscach
      
      	/* handle CWD */
      	if (!wlen) {
    +@@ compat/win32/fscache.c: int fscache_lstat(const char *filename, struct stat *st)
    + 	 * Special case symbolic links: FindFirstFile()/FindNextFile() did not
    + 	 * provide us with the length of the target path.
    + 	 */
    +-	if (fse->u.s.st_size == MAX_PATH && S_ISLNK(fse->st_mode)) {
    ++	if (fse->u.s.st_size == MAX_LONG_PATH && S_ISLNK(fse->st_mode)) {
    + 		char buf[MAX_LONG_PATH];
    + 		int len = readlink(filename, buf, sizeof(buf) - 1);
    + 
     
      ## t/meson.build ##
     @@ t/meson.build: integration_tests = [
  • 154: 694f810 < -: ---------- Win32: fix 'lstat("dir/")' with long paths

  • 155: bc025c8 ! 155: 2b15f83 win32(long path support): leave drive-less absolute paths intact

    @@ Commit message
         Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
     
      ## compat/mingw.c ##
    -@@ compat/mingw.c: int mingw_core_config(const char *var, const char *value,
    - 	return 0;
    - }
    - 
    -+static inline int is_wdir_sep(wchar_t wchar)
    -+{
    -+	return wchar == L'/' || wchar == L'\\';
    -+}
    -+
    - /* Normalizes NT paths as returned by some low-level APIs. */
    - static wchar_t *normalize_ntpath(wchar_t *wbuf)
    - {
     @@ compat/mingw.c: int handle_long_path(wchar_t *path, int len, int max_path, int expand)
      	 * "cwd + path" doesn't due to '..' components)
      	 */
  • 156: f87de62 = 156: c25c3ab compat/fsmonitor/fsm-*-win32: support long paths

  • 157: 9943bd6 = 157: 6d5896b clean: suggest using core.longPaths if paths are too long to remove

  • 158: 88524ea = 158: 7bb8f5a mingw: Support git_terminal_prompt with more terminals

  • 159: 6b65235 = 159: 4b6c17c compat/terminal.c: only use the Windows console if bash 'read -r' fails

  • 160: cd6db54 = 160: 4081616 mingw (git_terminal_prompt): do fall back to CONIN$/CONOUT$ method

  • 161: 86581d6 (upstream: 3b96b99) < -: ---------- Win32: don't call GetFileAttributes twice in mingw_lstat()

  • 162: efb8e66 (upstream: 48bc509) < -: ---------- Win32: implement stat() with symlink support

  • 163: f30c79a (upstream: 882e5e0) < -: ---------- Win32: remove separate do_lstat() function

  • 164: e5004cc (upstream: 2c37842) < -: ---------- Win32: let mingw_lstat() error early upon problems with reparse points

  • 165: 8b0e6c1 (upstream: 8a4f413) < -: ---------- mingw: teach fscache and dirent about symlinks

  • 166: ee52791 < -: ---------- Win32: lstat(): return adequate stat.st_size for symlinks

  • 167: 6ceb5ef (upstream: b0b32ff) < -: ---------- Win32: factor out retry logic

  • 168: ae6ec2e (upstream: 1bf1ffa) < -: ---------- Win32: change default of 'core.symlinks' to false

  • 169: bd61874 (upstream: 9ac15c2) < -: ---------- Win32: add symlink-specific error codes

  • 170: 830ffac (upstream: ac41bfa) < -: ---------- Win32: mingw_unlink: support symlinks to directories

  • 171: 365d9ef (upstream: 5e88e98) < -: ---------- Win32: mingw_rename: support renaming symlinks

  • 172: ef76ad7 (upstream: 43745a7) < -: ---------- Win32: mingw_chdir: change to symlink-resolved directory

  • 173: 38cb381 (upstream: 543a91c) < -: ---------- Win32: implement readlink()

  • 174: 5540862 < -: ---------- mingw: lstat: compute correct size for symlinks

  • 175: c92295d (upstream: 593008b) < -: ---------- Win32: implement basic symlink() functionality (file symlinks only)

  • 176: 6c58ba2 (upstream: 97be7aa) < -: ---------- Win32: symlink: add support for symlinks to directories

  • 177: 797f4d2 (upstream: 6206f7a) < -: ---------- mingw: try to create symlinks without elevated permissions

  • 178: daac581 (upstream: 2cba574) < -: ---------- mingw: emulate stat() a little more faithfully

  • 179: 01d54a4 (upstream: 44af34b) < -: ---------- mingw: special-case index entries for symlinks with buggy size

  • 180: 4958bab = 161: f24db03 mingw: introduce code to detect whether we're inside a Windows container

  • 181: 1cb648f = 162: 379ec9d mingw: when running in a Windows container, try to rename() harder

  • 184: 8fddb92 ! 163: 1a6bf77 Win32: symlink: move phantom symlink creation to a separate function

    @@ compat/mingw.c: int symlink(const char *target, const char *link)
     -	switch (process_phantom_symlink(wtarget, wlink)) {
     -	case PHANTOM_SYMLINK_RETRY:	{
     -		/* if target doesn't exist, add to phantom symlinks list */
    --		wchar_t wfullpath[MAX_LONG_PATH];
    +-		wchar_t wfullpath[MAX_PATH];
     -		struct phantom_symlink_info *psi;
     -
     -		/* convert to absolute path to be independent of cwd */
    --		len = GetFullPathNameW(wlink, MAX_LONG_PATH, wfullpath, NULL);
    --		if (!len || len >= MAX_LONG_PATH) {
    +-		len = GetFullPathNameW(wlink, MAX_PATH, wfullpath, NULL);
    +-		if (!len || len >= MAX_PATH) {
     -			errno = err_win_to_posix(GetLastError());
     -			return -1;
     -		}
    @@ compat/mingw.c: int symlink(const char *target, const char *link)
     +	return create_phantom_symlink(wtarget, wlink);
      }
      
    - #ifndef _WINNT_H
    + int readlink(const char *path, char *buf, size_t bufsiz)
  • 182: a86a9ba = 164: 5dcce1a mingw: move the file_attr_to_st_mode() function definition

  • 186: ceb439c = 165: 0960f32 Introduce helper to create symlinks that knows about index_state

  • 183: eb05398 ! 166: baea4cf mingw: Windows Docker volumes are not symbolic links

    @@ compat/win32/fscache.c: static struct fsentry *fseentry_create_entry(struct fsca
     +	}
     +
      	fse->st_mode = file_attr_to_st_mode(fdata->FileAttributes,
    --					    fdata->EaSize);
    -+					    fdata->EaSize, buf);
    + 					    fdata->EaSize, buf);
      	fse->dirent.d_type = S_ISREG(fse->st_mode) ? DT_REG :
    - 			S_ISDIR(fse->st_mode) ? DT_DIR : DT_LNK;
    - 	fse->u.s.st_size = S_ISLNK(fse->st_mode) ? MAX_LONG_PATH :
  • 187: 2b8f87f ! 167: 12ea88b mingw: allow to specify the symlink type in .gitattributes

    @@ compat/mingw.c: int mingw_create_symlink(struct index_state *index UNUSED, const
     +	return -1;
      }
      
    - #ifndef _WINNT_H
    + int readlink(const char *path, char *buf, size_t bufsiz)
  • 185: 82b409f = 168: cee92a6 mingw: work around rename() failing on a read-only file

  • 188: 746dcb6 = 169: c7ac570 Win32: symlink: add test for symlink attribute

  • 189: 1d994c0 = 170: dd6f4f6 mingw: explicitly specify with which cmd to prefix the cmdline

  • 190: f694304 = 171: 119a7bd mingw: when path_lookup() failed, try BusyBox

  • 191: c39fd21 = 172: 5fff04d test-tool: learn to act as a drop-in replacement for iconv

  • 192: a3df806 = 173: 713de61 tests(mingw): if iconv is unavailable, use test-helper --iconv

  • 193: 06e2aff = 174: 83ce344 gitattributes: mark .png files as binary

  • 194: 1173e4b = 175: 7a10947 tests: move test PNGs into t/lib-diff/

  • 195: 5e360db = 176: 50e21b0 tests: only override sort & find if there are usable ones in /usr/bin/

  • 196: 4ff2d8e = 177: ab77ebf tests: use the correct path separator with BusyBox

  • 197: 1e820ff = 178: 6cd8117 mingw: only use Bash-ism builtin pwd -W when available

  • 198: 8a93857 = 179: 495bf8e tests (mingw): remove Bash-specific pwd option

  • 199: f77554d = 180: 61b0aea test-lib: add BUSYBOX prerequisite

  • 200: da2dc16 = 181: b29f110 t5003: use binary file from t/lib-diff/

  • 201: cf34617 = 182: bffa16e t5532: workaround for BusyBox on Windows

  • 202: 11fdc41 = 183: f1c208d t5605: special-case hardlink test for BusyBox-w32

  • 203: e52cd4a = 184: 19fc9e7 t5813: allow for $PWD to be a Windows path

  • 204: 25b6a2d = 185: 4161847 t9200: skip tests when $PWD contains a colon

  • 211: 4292bc3 = 186: 948a285 mingw: kill child processes in a gentler way

  • 205: 997c3b5 = 187: 49c3f4b mingw: optionally enable wsl compability file mode bits

  • 214: 5ab983f = 188: 5c2a5a3 mingw: really handle SIGINT

  • 215: 902e343 = 189: cb06418 Partially un-revert "editor: save and reset terminal after calling EDITOR"

  • 216: 51e1360 = 190: 4ac142d reset: reinstate support for the deprecated --stdin option

  • 206: 07fca2f = 191: 2b23277 Describe Git for Windows' architecture [no ci]

  • 207: e488bbd = 192: 8721a8b Modify the Code of Conduct for Git for Windows

  • 208: 6fdb617 = 193: 0a7316b CONTRIBUTING.md: add guide for first-time contributors

  • 209: ae44685 = 194: 9928623 README.md: Add a Windows-specific preamble

  • 210: e54f74d = 195: fa4ba97 Add an issue template

  • 212: 70d123f = 196: 58c2623 Add a GitHub workflow to monitor component updates

  • 213: 67eb5e4 = 197: 14a252e Modify the GitHub Pull Request template (to reflect Git for Windows)

  • 217: 5ea59fd = 198: aadd41a fsmonitor: reintroduce core.useBuiltinFSMonitor

  • 218: 95d9d1c = 199: 9e50816 dependabot: help keeping GitHub Actions versions up to date

  • 219: b810f3d = 200: 6fda530 SECURITY.md: document Git for Windows' policies

manbearian and others added 30 commits January 28, 2026 07:16
Co-authored-by: Dennis Ameling <dennis@dennisameling.com>
Signed-off-by: Ian Bearman <ianb@microsoft.com>
Signed-off-by: Dennis Ameling <dennis@dennisameling.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
There is a Win32 API function to resolve symbolic links, and we can use
that instead of resolving them manually. Even better, this function also
resolves NTFS junction points (which are somewhat similar to bind
mounts).

This fixes git-for-windows#2481.

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

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

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

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

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

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

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

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

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

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

This fixes git-for-windows#2779

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

A simple retry will usually resolve the issue.

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

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
In this context, a "feature" is a dependency combined with its own
dependencies.

Signed-off-by: Ian Bearman <ianb@microsoft.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Correct some wording and inform users regarding the Visual Studio
changes (from V16.6) to the default generator.

Subsequent commits ensure that Git for Windows can be directly
opened in modern Visual Studio without needing special configuration
of the CMakeLists settings.

It appeares that internally Visual Studio creates it's own version of the
.sln file (etc.) for extension tools that expect them.

The large number of references below document the shifting of Visual Studio
default and CMake setting options.

refs: https://docs.microsoft.com/en-us/search/?scope=C%2B%2B&view=msvc-150&terms=Ninja

1. https://docs.microsoft.com/en-us/cpp/linux/cmake-linux-configure?view=msvc-160
(note the linux bit)
 "In Visual Studio 2019 version 16.6 or later ***, Ninja is the default
generator for configurations targeting a remote system or WSL. For more
information, see this post on the C++ Team Blog
[https://devblogs.microsoft.com/cppblog/linux-development-with-visual-studio-first-class-support-for-gdbserver-improved-build-times-with-ninja-and-updates-to-the-connection-manager/].

For more information about these settings, see CMakeSettings.json reference
[https://docs.microsoft.com/en-us/cpp/build/cmakesettings-reference?view=msvc-160]."

2. https://docs.microsoft.com/en-us/cpp/build/cmake-presets-vs?view=msvc-160
"CMake supports two files that allow users to specify common configure,
build, and test options and share them with others: CMakePresets.json
and CMakeUserPresets.json."

" Both files are supported in Visual Studio 2019 version 16.10 or later.
***"
3. https://devblogs.microsoft.com/cppblog/linux-development-with-visual-studio-first-class-support-for-gdbserver-improved-build-times-with-ninja-and-updates-to-the-connection-manager/
" Ninja has been the default generator (underlying build system) for
CMake configurations targeting Windows for some time***, but in Visual
Studio 2019 version 16.6 Preview 3*** we added support for Ninja on Linux."

4. https://docs.microsoft.com/en-us/cpp/build/cmakesettings-reference?view=msvc-160
" `generator`: specifies CMake generator to use for this configuration.
May be one of:

    Visual Studio 2019 only:
        Visual Studio 16 2019
        Visual Studio 16 2019 Win64
        Visual Studio 16 2019 ARM

    Visual Studio 2017 and later:
        Visual Studio 15 2017
        Visual Studio 15 2017 Win64
        Visual Studio 15 2017 ARM
        Visual Studio 14 2015
        Visual Studio 14 2015 Win64
        Visual Studio 14 2015 ARM
        Unix Makefiles
        Ninja

Because Ninja is designed for fast build speeds instead of flexibility
and function, it is set as the default. However, some CMake projects may
be unable to correctly build using Ninja. If this occurs, you can
instruct CMake to generate Visual Studio projects instead.

To specify a Visual Studio generator in Visual Studio 2017, open the
settings editor from the main menu by choosing CMake | Change CMake
Settings. Delete "Ninja" and type "V". This activates IntelliSense,
which enables you to choose the generator you want."

"To specify a Visual Studio generator in Visual Studio 2019, right-click
on the CMakeLists.txt file in Solution Explorer and choose CMake
Settings for project > Show Advanced Settings > CMake Generator.

When the active configuration specifies a Visual Studio generator, by
default MSBuild.exe is invoked with` -m -v:minimal` arguments."

5. https://docs.microsoft.com/en-us/cpp/build/cmake-presets-vs?view=msvc-160#enable-cmakepresetsjson-integration-in-visual-studio-2019
"Enable CMakePresets.json integration in Visual Studio 2019

CMakePresets.json integration isn't enabled by default in Visual Studio
2019. You can enable it for all CMake projects in Tools > Options >
CMake > General: (tick a box)" ... see more.

6. https://docs.microsoft.com/en-us/cpp/build/cmakesettings-reference?view=msvc-140
(whichever v140 is..)
"CMake projects are supported in Visual Studio 2017 and later."

7. https://docs.microsoft.com/en-us/cpp/overview/what-s-new-for-cpp-2017?view=msvc-150
"Support added for the CMake Ninja generator."

8. https://docs.microsoft.com/en-us/cpp/overview/what-s-new-for-cpp-2017?view=msvc-150#cmake-support-via-open-folder
"CMake support via Open Folder
Visual Studio 2017 introduces support for using CMake projects without
converting to MSBuild project files (.vcxproj). For more information,
see CMake projects in Visual
Studio[https://docs.microsoft.com/en-us/cpp/build/cmake-projects-in-visual-studio?view=msvc-150].
Opening CMake projects with Open Folder automatically configures the
environment for C++ editing, building, and debugging." ... +more!

9. https://docs.microsoft.com/en-us/cpp/build/cmake-presets-vs?view=msvc-160#supported-cmake-and-cmakepresetsjson-versions
"Visual Studio reads and evaluates CMakePresets.json and
CMakeUserPresets.json itself and doesn't invoke CMake directly with the
--preset option. So, CMake version 3.20 or later isn't strictly required
when you're building with CMakePresets.json inside Visual Studio. We
recommend using CMake version 3.14 or later."

10. https://docs.microsoft.com/en-us/cpp/build/cmake-presets-vs?view=msvc-160#enable-cmakepresetsjson-integration-in-visual-studio-2019
"If you don't want to enable CMakePresets.json integration for all CMake
projects, you can enable CMakePresets.json integration for a single
CMake project by adding a CMakePresets.json file to the root of the open
folder. You must close and reopen the folder in Visual Studio to
activate the integration.

11. https://docs.microsoft.com/en-us/cpp/build/cmake-presets-vs?view=msvc-160#default-configure-presets
***(doesn't actually say which version..)
"Default Configure Presets
If no CMakePresets.json or CMakeUserPresets.json file exists, or if
CMakePresets.json or CMakeUserPresets.json is invalid, Visual Studio
will fall back*** on the following default Configure Presets:

Windows example
JSON
{
  "name": "windows-default",
  "displayName": "Windows x64 Debug",
  "description": "Sets Ninja generator, compilers, x64 architecture,
build and install directory, debug build type",
  "generator": "Ninja",
  "binaryDir": "${sourceDir}/out/build/${presetName}",
  "architecture": {
    "value": "x64",
    "strategy": "external"
  },
  "cacheVariables": {
    "CMAKE_BUILD_TYPE": "Debug",
    "CMAKE_INSTALL_PREFIX": "${sourceDir}/out/install/${presetName}"
  },
  "vendor": {
    "microsoft.com/VisualStudioSettings/CMake/1.0": {
      "hostOS": [ "Windows" ]
    }
  }
},
"

Signed-off-by: Philip Oakley <philipoakley@iee.email>
On LLP64 systems, such as Windows, the size of `long`, `int`, etc. is
only 32 bits (for backward compatibility). Git's use of `unsigned long`
for file memory sizes in many places, rather than size_t, limits the
handling of large files on LLP64 systems (commonly given as `>4GB`).

Provide a minimum test for handling a >4GB file. The `hash-object`
command, with the  `--literally` and without `-w` option avoids
writing the object, either loose or packed. This avoids the code paths
hitting the `bigFileThreshold` config test code, the zlib code, and the
pack code.

Subsequent patches will walk the test's call chain, converting types to
`size_t` (which is larger in LLP64 data models) where appropriate.

Signed-off-by: Philip Oakley <philipoakley@iee.email>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Dennis Ameling <dennis@dennisameling.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
The CMakeSettings.json file is tool generated. Developers may track it
should they provide additional settings.

Signed-off-by: Philip Oakley <philipoakley@iee.email>
Continue walking the code path for the >4GB `hash-object --literally`
test. The `hash_object_file_literally()` function internally uses both
`hash_object_file()` and `write_object_file_prepare()`. Both function
signatures use `unsigned long` rather than `size_t` for the mem buffer
sizes. Use `size_t` instead, for LLP64 compatibility.

While at it, convert those function's object's header buffer length to
`size_t` for consistency. The value is already upcast to `uintmax_t` for
print format compatibility.

Note: The hash-object test still does not pass. A subsequent commit
continues to walk the call tree's lower level hash functions to identify
further fixes.

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

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

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

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

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

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

Signed-off-by: Philip Oakley <philipoakley@iee.email>
Continue walking the code path for the >4GB `hash-object --literally`
test to the hash algorithm step for LLP64 systems.

This patch lets the SHA1DC code use `size_t`, making it compatible with
LLP64 data models (as used e.g. by Windows).

The interested reader of this patch will note that we adjust the
signature of the `git_SHA1DCUpdate()` function without updating _any_
call site. This certainly puzzled at least one reviewer already, so here
is an explanation:

This function is never called directly, but always via the macro
`platform_SHA1_Update`, which is usually called via the macro
`git_SHA1_Update`. However, we never call `git_SHA1_Update()` directly
in `struct git_hash_algo`. Instead, we call `git_hash_sha1_update()`,
which is defined thusly:

    static void git_hash_sha1_update(git_hash_ctx *ctx,
                                     const void *data, size_t len)
    {
        git_SHA1_Update(&ctx->sha1, data, len);
    }

i.e. it contains an implicit downcast from `size_t` to `unsigned long`
(before this here patch). With this patch, there is no downcast anymore.

With this patch, finally, the t1007-hash-object.sh "files over 4GB hash
literally" test case is fixed.

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

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

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

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

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

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

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

Let's let the `README` reflect this.

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

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

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

This fixes git-for-windows#3292

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

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

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

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

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

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

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

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

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

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

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

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

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

Signed-off-by: Philip Oakley <philipoakley@iee.email>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
dscho and others added 21 commits January 28, 2026 14:30
The Git for Windows project has grown quite complex over the years,
certainly much more complex than during the first years where the
`msysgit.git` repository was abusing Git for package management purposes
and the `git/git` fork was called `4msysgit.git`.

Let's describe the status quo in a thorough way.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
This was pull request git-for-windows#1645 from ZCube/master

Support windows container.

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

We adapt it slightly to Git for Windows.

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

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

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

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

Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
Includes touch-ups by 마누엘, Philip Oakley and 孙卓识.

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>
This patch introduces support to set special NTFS attributes that are
interpreted by the Windows Subsystem for Linux as file mode bits, UID
and GID.

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

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 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>
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>
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>
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>
…updates

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

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
@dscho dscho force-pushed the tentative/rebase-to-2.53.0-rc2 branch from de7c78c to 3832dd2 Compare January 28, 2026 13:34
@dscho
Copy link
Member Author

dscho commented Jan 28, 2026

/git-artifacts

The tag-git workflow run was started

@gitforwindowshelper
Copy link

Validate the installer manually

The installer was built successfully;
Please download, install, and run through the pre-flight check-list.
@dscho ☝️

@dscho
Copy link
Member Author

dscho commented Jan 28, 2026

/release

The release-git workflow run was started

@gitforwindowshelper
Copy link

@dscho, please Share on Bluesky and send the announcement email.

@gitforwindowshelper gitforwindowshelper bot merged commit 3832dd2 into git-for-windows:main Jan 28, 2026
42 checks passed
@dscho dscho deleted the tentative/rebase-to-2.53.0-rc2 branch January 28, 2026 14:22
@dscho dscho added this to the Next release milestone Jan 28, 2026
@dscho dscho self-assigned this Jan 28, 2026
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.

[New git version] v2.53.0-rc2