Skip to content

Rebase to v2.49.0 #5487

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 359 commits into from
Mar 17, 2025
Merged

Rebase to v2.49.0 #5487

merged 359 commits into from
Mar 17, 2025

Conversation

dscho
Copy link
Member

@dscho dscho commented Mar 14, 2025

Range-diff relative to main
  • 1: 1240cfe = 1: 328ff86 sideband: mask control characters
  • 2: 48428d7 = 2: ab2eb6c sideband: introduce an "escape hatch" to allow control characters
  • 3: 5b8e1b4 = 3: a369672 sideband: do allow ANSI color sequences by default
  • 4: d1f8c8f = 4: 26f9101 unix-socket: avoid leak when initialization fails
  • 5: 0c8ecff = 5: 965d249 grep: prevent ^$ false match at end of file
  • 6: dc465c4 = 6: a119a57 t9350: point out that refs are not updated correctly
  • 7: b324164 = 7: dfef238 ci: stop linking the prove cache
  • 8: 25a3a0d = 8: ca0d213 transport-helper: add trailing --
  • 9: 2eeeea5 = 9: 1c7fffe contrib/buildsystems: drop support for building .vcproj/.vcxproj files
  • 10: d30aad4 = 10: 5c933d6 remote-helper: check helper status after import/export
  • 12: f0cb006 = 11: 09eff7e config.mak.uname: drop the vcxproj target
  • 13: 6faecb6 = 12: 7b7d20c Always auto-gc after calling a fast-import transport
  • 15: c0ffa19 = 13: 5aee711 mingw: include the Python parts in the build
  • 16: 99b7daa = 14: c75c3ec win32/pthread: avoid name clashes with winpthread
  • 17: 281b6fb = 15: a1f4e5f git-compat-util: avoid redeclaring _DEFAULT_SOURCE
  • 18: 5971c3d = 16: b30d3b2 Import the source code of mimalloc v2.1.2
  • 11: 14ed3bc = 17: fb6af4f mingw: demonstrate a problem with certain absolute paths
  • 22: c5761cc = 18: 0356006 clean: do not traverse mount points
  • 19: 45a2fd8 = 19: d7b9349 mimalloc: adjust for building inside Git
  • 14: 5d1c542 = 20: 5951297 mingw: allow absolute paths without drive prefix
  • 24: d6ae4d0 = 21: 0baebe3 clean: remove mount points when possible
  • 20: b935f58 = 22: 0cd275e mimalloc: offer a build-time option to enable it
  • 29: 4c3f5c3 = 23: 15788f1 mingw: demonstrate a git add issue with NTFS junctions
  • 28: 8e69e5f = 24: efd11ee mingw: ensure valid CTYPE
  • 21: 81c4c44 = 25: b29ef59 mimalloc: use "weak" random seed when statically linked
  • 32: d8983c9 = 26: a507335 strbuf_realpath(): use platform-dependent API if available
  • 30: 00932a2 = 27: e7cafe9 mingw: allow git.exe to be used instead of the "Git wrapper"
  • 23: 3e5fd90 = 28: e142c7d mingw: use mimalloc
  • 25: 228fc10 = 29: 50141b6 transport: optionally disable side-band-64k
  • 26: b1a6666 = 30: dfae88e mingw: do resolve symlinks in getcwd()
  • 27: 9c84f95 = 31: e5ed427 mingw: fix fatal error working on mapped network drives on Windows
  • 36: 0d79dc7 = 32: 7f26170 clink.pl: fix MSVC compile script to handle libcurl-d.lib
  • 37: 1a828e5 = 33: 71f4691 mingw: implement a platform-specific strbuf_realpath()
  • 31: 02fd27a = 34: e68d065 t5505/t5516: allow running without .git/branches/ in the templates
  • 33: 5cf32c7 = 35: 4f063aa mingw: ignore HOMEDRIVE/HOMEPATH if it points to Windows' system directory
  • 34: 31dfabf = 36: 0d93c66 t5505/t5516: fix white-space around redirectors
  • 35: bc1a422 = 37: b4859e8 http: use new "best effort" strategy for Secure Channel revoke checking
  • 38: 18ee827 = 38: 3503c1c t3701: verify that we can add lots of files interactively
  • 43: a8efd0b = 39: fe3e223 git add -i: handle CR/LF line endings in the interactive input
  • 44: d246e80 = 40: efcc9f8 commit: accept "scissors" with CR/LF line endings
  • 45: deed389 = 41: 56773d3 t0014: fix indentation
  • 39: efefd04 = 42: 8b8b511 clink.pl: fix libexpatd.lib link error when using MSVC
  • 40: 94d1bf6 = 43: 5df9a49 Makefile: clean up .ilk files when MSVC=1
  • 41: cc9b967 = 44: 019f311 vcbuild: add support for compiling Windows resource files
  • 42: 0c8c602 = 45: 58ec679 config.mak.uname: add git.rc to MSVC builds
  • 52: 0911d8c = 46: db6fa8d clink.pl: ignore no-stack-protector arg on MSVC=1 builds
  • 54: 3c5d4e3 = 47: e002ab3 clink.pl: move default linker options for MSVC=1 builds
  • 46: 79097ec = 48: dc82323 git-gui: accommodate for intent-to-add files
  • 56: eb0ac4c = 49: 4c94afc cmake: install headless-git.
  • 47: e3e58b6 = 50: cb368c9 vcpkg_install: detect lack of Git
  • 48: 42994a3 = 51: cd6fa37 vcpkg_install: add comment regarding slow network connections
  • 49: c0e81c0 = 52: 14beae6 vcbuild: install ARM64 dependencies when building ARM64 binaries
  • 50: b734608 = 53: 1d88f5f vcbuild: add an option to install individual 'features'
  • 51: 3efbb50 = 54: 33f017b cmake: allow building for Windows/ARM64
  • 53: 52b0a9e = 55: df54c4a ci(vs-build) also build Windows/ARM64 artifacts
  • 55: bbeca03 = 56: 9aeff06 Add schannel to curl installation
  • 57: 88e7bac = 57: 1cbc98e cmake(): allow setting HOST_CPU for cross-compilation
  • 58: 7d2f291 = 58: 165c32d CMake: default Visual Studio generator has changed
  • 59: 8e87931 = 59: c59ac5b .gitignore: add Visual Studio CMakeSetting.json file
  • 60: f238f4e = 60: 9080f21 subtree: update contrib/subtree test target
  • 61: cf7c114 = 61: f1a9157 CMakeLists: add default "x64-windows" arch for Visual Studio
  • 62: 3d2699a = 62: 765ae0e mingw: allow for longer paths in parse_interpreter()
  • 63: c493868 = 63: 898e9a5 compat/vcbuild: document preferred way to build in Visual Studio
  • 64: 1f5dfe8 = 64: e73268d http: optionally send SSL client certificate
  • 65: c8f5ffc = 65: b45aa3f ci: run contrib/subtree tests in CI builds
  • 66: c733f85 = 66: 5b51249 CMake: show Win32 and Generator_platform build-option values
  • 68: a76d967 = 67: 24571ca hash-object: demonstrate a >4GB/LLP64 problem
  • 69: bc532ac = 68: 62a86b8 write_object_file_literally(): use size_t
  • 70: a4821e7 = 69: 5ef6407 object-file.c: use size_t for header lengths
  • 71: 73f1c2e = 70: d611ed8 hash algorithms: use size_t for section lengths
  • 72: a0d9eba = 71: 3f79b30 hash-object --stdin: verify that it works with >4GB/LLP64
  • 73: dc7a0ae = 72: 43f9bbd hash-object: add another >4GB/LLP64 test case
  • 74: d72ac16 = 73: 37089cb setup: properly use "%(prefix)/" when in WSL
  • 67: f05ffbe = 74: eb2c4b4 init: do parse all core.* settings early
  • 77: 4e53e83 = 75: 721f99a hash-object: add a >4GB/LLP64 test case using filtered input
  • 78: a37cf6e = 76: 8537e4e compat/mingw.c: do not warn when failing to get owner
  • 79: 7e994f9 = 77: 11f6fbd mingw: $env:TERM="xterm-256color" for newer OSes
  • 80: b769506 = 78: beeb830 winansi: check result and Buffer before using Name
  • 82: da7eb94 = 79: 551cfe6 config.mak.uname: add support for clangarm64
  • 83: 3fd5dff = 80: 6d3e5cf msvc: do handle builds on Windows/ARM64
  • 75: 461b256 = 81: e88076e Add config option windows.appendAtomically
  • 76: 1d2d350 = 82: 5046722 MinGW: link as terminal server aware
  • 84: cba5b4b = 83: d31e375 mingw(arm64): do move the /etc/git* location
  • 81: 7fabd87 = 84: 5398cd9 mingw: change core.fsyncObjectFiles = 1 by default
  • 85: e52c273 = 85: e9e45cb Fix Windows version resources
  • 86: dd00e9b = 86: e6aed4b bswap.h: add support for built-in bswap functions
  • 89: 1dd6dc8 = 87: 905c9fd http: optionally load libcurl lazily
  • 90: dbc9b92 = 88: 14f7f33 http: support lazy-loading libcurl also on Windows
  • 91: c937d81 = 89: de2514d http: when loading libcurl lazily, allow for multiple SSL backends
  • 87: e7f0009 = 90: 418bbe6 status: fix for old-style submodules with commondir
  • 88: fd6be1d = 91: f7f17bc windows: skip linking git-<command> for built-ins
  • 92: cbd8781 = 92: 285ca8a windows: fix Repository>Explore Working Copy
  • 93: 1300c44 = 93: f541881 mingw: do load libcurl dynamically by default
  • 94: a6e6c53 = 94: 1133396 Add a GitHub workflow to verify that Git/Scalar work in Nano Server
  • 95: b7300e3 = 95: 738b64d mingw: suggest windows.appendAtomically in more cases
  • 96: fbfeb1a = 96: b554f2b win32: use native ANSI sequence processing, if possible
  • 101: bc957df = 97: 9c7962f ci: work around a problem with HTTP/2 vs libcurl v8.10.0
  • 97: 412c6b0 = 98: 0c97108 git.rc: include winuser.h
  • 98: 38429d9 = 99: 32e6593 common-main.c: fflush stdout buffer upon exit
  • 99: 07bb892 = 100: 83013cc t5601/t7406(mingw): do run tests with symlink support
  • 100: ac4bc06 = 101: 31f14a7 win32: ensure that localtime_r() is declared even in i686 builds
  • 112: e4926c1 = 102: d6aa1bb Fallback to AppData if XDG_CONFIG_HOME is unset
  • 113: 24000e5 = 103: e28c964 run-command: be helpful with Git LFS fails on Windows 7
  • 102: ceb530a = 104: 8bc5a28 revision: create mark_trees_uninteresting_dense()
  • 103: 9e0b936 = 105: 977c6d6 pack-objects: extract should_attempt_deltas()
  • 104: ff75aa0 = 106: f9dec41 pack-objects: add --path-walk option
  • 105: 26fe7cd = 107: 9388ecb pack-objects: introduce GIT_TEST_PACK_PATH_WALK
  • 106: d4de651 = 108: ba06d19 repack: add --path-walk option
  • 107: aa3935a = 109: b74589a pack-objects: enable --path-walk via config
  • 108: 442c147 = 110: 1e79420 scalar: enable path-walk during push via config
  • 109: 01f3d7a = 111: 5debbd0 pack-objects: refactor path-walk delta phase
  • 110: 9010c8e = 112: ad79f1d pack-objects: thread the path-based compression
  • 111: ea98510 = 113: 60b7fa0 survey: stub in new experimental 'git-survey' command
  • 114: 5e757f3 = 114: 0abf509 survey: add command line opts to select references
  • 115: 2474c18 = 115: d5f73ce survey: start pretty printing data in table form
  • 116: da5dcd0 = 116: af65f40 survey: add object count summary
  • 117: 2d78225 = 117: 994c459 survey: summarize total sizes by object type
  • 118: 4727c24 = 118: c655a26 survey: show progress during object walk
  • 119: 2504287 = 119: c596bba survey: add ability to track prioritized lists
  • 120: bf0e64d = 120: 65fef57 survey: add report of "largest" paths
  • 121: a7084e7 = 121: ace0427 survey: add --top= option and config
  • 123: ca4e6a8 = 122: 628589f survey: clearly note the experimental nature in the output
  • 122: 6c5ad8b = 123: 2fa60ca mingw: make sure errno is set correctly when socket operations fail
  • 124: aa86f6a = 124: 6791d35 compat/mingw: handle WSA errors in strerror
  • 125: 6792f63 = 125: 968cfcc compat/mingw: drop outdated comment
  • 126: 0627578 = 126: 5f9ffaa t0301: actually test credential-cache on Windows
  • 127: 82276d4 = 127: 4a9d6d6 mingw_open_existing: handle directories better
  • 128: 72848f7 = 128: 021de74 credential-cache: handle ECONNREFUSED gracefully
  • 129: 0cee190 = 129: 8acd72b mingw: drop Windows 7-specific work-around
  • 130: ccade01 = 130: 7363c2b git-gui: provide question helper for retry fallback on Windows
  • 131: 09be28b = 131: 4be9421 git gui: set GIT_ASKPASS=git-gui--askpass if not set yet
  • 132: 01418e6 = 132: df67db2 git-gui--askyesno: fix funny text wrapping
  • 133: 3537dc1 = 133: fa2cda4 git-gui--askyesno: allow overriding the window title
  • 134: b3b002d = 134: b05e566 git-gui--askyesno (mingw): use Git for Windows' icon, if available
  • 135: 687e89c = 135: 0755621 Win32: make FILETIME conversion functions public
  • 136: b065c8a = 136: 68638b9 Win32: dirent.c: Move opendir down
  • 137: 10aedc2 = 137: a09db7d mingw: make the dirent implementation pluggable
  • 138: 3ee12ed = 138: 88e53ce Win32: make the lstat implementation pluggable
  • 139: 15afbab = 139: 56bbe10 mingw: add infrastructure for read-only file system level caches
  • 140: 5dcdd49 = 140: 071b8b0 mingw: add a cache below mingw's lstat and dirent implementations
  • 141: f224832 = 141: a0b1352 fscache: load directories only once
  • 142: eaf83e3 = 142: 3f45f86 fscache: add key for GIT_TRACE_FSCACHE
  • 143: 70306d2 = 143: e016a0b fscache: remember not-found directories
  • 144: eec3ccc = 144: a42a6e5 fscache: add a test for the dir-not-found optimization
  • 145: ed90bb5 = 145: afe18dd add: use preload-index and fscache for performance
  • 146: 26c0ce0 = 146: 3b09015 dir.c: make add_excludes aware of fscache during status
  • 147: b8e1a65 = 147: 0787452 fscache: make fscache_enabled() public
  • 148: fb29483 = 148: ac9e067 dir.c: regression fix for add_excludes with fscache
  • 149: 7b74947 = 149: 95a906b fetch-pack.c: enable fscache for stats under .git/objects
  • 150: cf583a8 = 150: 4ae43da checkout.c: enable fscache for checkout again
  • 151: fd86e80 = 151: ce263d4 Enable the filesystem cache (fscache) in refresh_index().
  • 152: 8cd9936 = 152: c53ce36 fscache: use FindFirstFileExW to avoid retrieving the short name
  • 153: 61936c5 = 153: 349641e fscache: add GIT_TEST_FSCACHE support
  • 154: 285899f = 154: 7b2c47a fscache: add fscache hit statistics
  • 155: 37f6dfe = 155: d5c0eb4 unpack-trees: enable fscache for sparse-checkout
  • 156: b271a13 = 156: eb393f9 status: disable and free fscache at the end of the status command
  • 157: b876541 = 157: 07a0f2e mem_pool: add GIT_TRACE_MEMPOOL support
  • 158: d4232b6 = 158: d03d04d fscache: fscache takes an initial size
  • 159: 685bd9c = 159: 6de6c6f fscache: update fscache to be thread specific instead of global
  • 160: f258d66 = 160: 071cd0d fscache: teach fscache to use mempool
  • 161: c406ca8 = 161: b03c3b4 fscache: make fscache_enable() thread safe
  • 162: 526ab1a = 162: 70277eb fscache: teach fscache to use NtQueryDirectoryFile
  • 163: ed29eea = 163: 13c7c9e fscache: remember the reparse tag for each entry
  • 164: b317341 = 164: c3810de fscache: implement an FSCache-aware is_mount_point()
  • 165: 3c02560 = 165: dc52e01 clean: make use of FSCache
  • 166: 8b56854 = 166: 2994178 pack-objects (mingw): demonstrate a segmentation fault with large deltas
  • 167: 505ceb9 = 167: c8b6c1d mingw: support long paths
  • 168: 5d5cda0 = 168: a2ae917 Win32: fix 'lstat("dir/")' with long paths
  • 169: d6b17d1 = 169: bb23023 win32(long path support): leave drive-less absolute paths intact
  • 170: 33549e8 = 170: 197de64 compat/fsmonitor/fsm-*-win32: support long paths
  • 171: e4534c8 = 171: 978fa72 clean: suggest using core.longPaths if paths are too long to remove
  • 172: 0cb2520 = 172: 8e8d76f mingw: Support git_terminal_prompt with more terminals
  • 173: f7d94bc = 173: c565315 compat/terminal.c: only use the Windows console if bash 'read -r' fails
  • 174: a16d7f3 = 174: c2dd4e2 mingw (git_terminal_prompt): do fall back to CONIN$/CONOUT$ method
  • 175: 2e24067 = 175: e00bc5a strbuf_readlink: don't call readlink twice if hint is the exact link size
  • 176: e0bf95d = 176: 5fa006e strbuf_readlink: support link targets that exceed PATH_MAX
  • 177: e6228e6 = 177: 8eda664 lockfile.c: use is_dir_sep() instead of hardcoded '/' checks
  • 178: 625770c = 178: 818823b Win32: don't call GetFileAttributes twice in mingw_lstat()
  • 179: f88737f = 179: d1ad364 Win32: implement stat() with symlink support
  • 180: b32eff9 = 180: 1ecc275 Win32: remove separate do_lstat() function
  • 181: c3e4ddb = 181: 8811b6d Win32: let mingw_lstat() error early upon problems with reparse points
  • 182: aec0db1 = 182: db6bdb0 mingw: teach fscache and dirent about symlinks
  • 183: 8ea6248 = 183: 75d0b1e Win32: lstat(): return adequate stat.st_size for symlinks
  • 184: dba1473 = 184: 2e5b30c Win32: factor out retry logic
  • 185: da08b17 = 185: 303962a Win32: change default of 'core.symlinks' to false
  • 186: e493bf7 = 186: 0dac521 Win32: add symlink-specific error codes
  • 187: 468b5d4 = 187: a8e6d38 Win32: mingw_unlink: support symlinks to directories
  • 188: a831f01 = 188: 7d7b851 Win32: mingw_rename: support renaming symlinks
  • 189: 12e7db5 = 189: 771b29b Win32: mingw_chdir: change to symlink-resolved directory
  • 190: 2fa3264 = 190: 3e708df Win32: implement readlink()
  • 191: 1b4cc06 = 191: 0cfb182 mingw: lstat: compute correct size for symlinks
  • 192: 52e622d = 192: 2a949ab Win32: implement basic symlink() functionality (file symlinks only)
  • 193: afa8cb7 = 193: 7f97720 Win32: symlink: add support for symlinks to directories
  • 194: 3b895a5 = 194: 354b1de mingw: try to create symlinks without elevated permissions
  • 195: 804727e = 195: 863e023 mingw: emulate stat() a little more faithfully
  • 196: d207441 = 196: f3f6cfd mingw: special-case index entries for symlinks with buggy size
  • 197: 5093624 = 197: b42db30 mingw: introduce code to detect whether we're inside a Windows container
  • 201: 9d2ba10 = 198: 3b5712f Win32: symlink: move phantom symlink creation to a separate function
  • 198: b453d77 = 199: 45c559a mingw: when running in a Windows container, try to rename() harder
  • 203: a1e3aae = 200: 1051024 Introduce helper to create symlinks that knows about index_state
  • 199: 72b99df = 201: 81a88ce mingw: move the file_attr_to_st_mode() function definition
  • 204: 49145fc = 202: 10a1507 mingw: allow to specify the symlink type in .gitattributes
  • 200: 97f1cec = 203: 24f9cec mingw: Windows Docker volumes are not symbolic links
  • 205: e8b98fa = 204: 3166868 Win32: symlink: add test for symlink attribute
  • 202: 2e6f9cb = 205: 177b60f mingw: work around rename() failing on a read-only file
  • 206: f7645c1 = 206: 0d74aa1 mingw: explicitly specify with which cmd to prefix the cmdline
  • 207: 33bca21 = 207: 0a609c2 mingw: when path_lookup() failed, try BusyBox
  • 208: 797f87a = 208: 158a333 test-lib: avoid unnecessary Perl invocation
  • 209: d1ce5f6 = 209: cfe9431 test-tool: learn to act as a drop-in replacement for iconv
  • 210: abeeea5 = 210: a03d63f tests(mingw): if iconv is unavailable, use test-helper --iconv
  • 211: dcaab7c = 211: bf1d189 gitattributes: mark .png files as binary
  • 212: 64c5feb = 212: 41dacb8 tests: move test PNGs into t/lib-diff/
  • 213: dac85a4 = 213: 6fa7afa tests: only override sort & find if there are usable ones in /usr/bin/
  • 214: 4290814 = 214: 40d4e2b tests: use the correct path separator with BusyBox
  • 215: c91e5d1 = 215: 76db262 mingw: only use Bash-ism builtin pwd -W when available
  • 216: 079e4ef = 216: 2605cd8 tests (mingw): remove Bash-specific pwd option
  • 217: d3e383b = 217: d936053 test-lib: add BUSYBOX prerequisite
  • 218: 7ad9402 = 218: b66cfb1 t5003: use binary file from t/lib-diff/
  • 219: cbfab2a = 219: 96966a1 t5532: workaround for BusyBox on Windows
  • 220: fb0fcdf = 220: 92b3ea6 t5605: special-case hardlink test for BusyBox-w32
  • 221: af78209 = 221: ad7b67b t5813: allow for $PWD to be a Windows path
  • 222: 1a75300 = 222: 73b311d t9200: skip tests when $PWD contains a colon
  • 223: 59c590e = 223: 56f2019 mingw: add a Makefile target to copy test artifacts
  • 225: 4443a99 = 224: 3761c2d mingw: kill child processes in a gentler way
  • 224: 14ca6f6 = 225: 112624d mingw: optionally enable wsl compability file mode bits
  • 226: 3188788 = 226: 1be24cc mingw: do not call xutftowcs_path in mingw_mktemp
  • 231: 2b6eed6 = 227: edc7961 Add a GitHub workflow to monitor component updates
  • 227: 60a21f8 = 228: b7b5f50 mingw: really handle SIGINT
  • 228: 37059ad = 229: 482bb59 Partially un-revert "editor: save and reset terminal after calling EDITOR"
  • 229: ece8847 = 230: 47d6871 reset: reinstate support for the deprecated --stdin option
  • 233: 93b924e = 231: 11128ac fsmonitor: reintroduce core.useBuiltinFSMonitor
  • 234: d2f3bcf = 232: 05bf987 dependabot: help keeping GitHub Actions versions up to date
  • 230: 66978e3 = 233: d27a317 Describe Git for Windows' architecture [no ci]
  • 232: 8a0b66a = 234: 157d7fa Modify the Code of Conduct for Git for Windows
  • 235: 4e9a794 = 235: a828efd CONTRIBUTING.md: add guide for first-time contributors
  • 236: bd5a661 = 236: e4d3adf README.md: Add a Windows-specific preamble
  • 237: 6aee99a = 237: 9f4ea73 Add an issue template
  • 238: ce03085 = 238: d56c12f Modify the GitHub Pull Request template (to reflect Git for Windows)
  • 239: 280cbf2 = 239: 4341a3f SECURITY.md: document Git for Windows' policies

PhilipOakley and others added 30 commits March 14, 2025 22:30
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 <[email protected]>
Signed-off-by: Johannes Schindelin <[email protected]>
In Git for Windows, `has_symlinks` is set to 0 by default. Therefore, we
need to parse the config setting `core.symlinks` to know if it has been
set to `true`. In `git init`, we must do that before copying the
templates because they might contain symbolic links.

Even if the support for symbolic links on Windows has not made it to
upstream Git yet, we really should make sure that all the `core.*`
settings are parsed before proceeding, as they might very well change
the behavior of `git init` in a way the user intended.

This fixes #3414

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

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

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

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

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

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

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

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

This is the same heuristic used by the Cygwin runtime.

Signed-off-by: Rafael Kitover <[email protected]>
Signed-off-by: Johannes Schindelin <[email protected]>
NtQueryObject under Wine can return a success but fill out no name.
In those situations, Wine will set Buffer to NULL, and set result to
the sizeof(OBJECT_NAME_INFORMATION).

Running a command such as

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

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

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

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

Signed-off-by: Christopher Degawa <[email protected]>
CLANGARM64 is a relatively new MSYSTEM added by the MSYS2 team. In order
to have Git build correctly for this platform, let's add some
configuration for it to config.mak.uname.

Signed-off-by: Dennis Ameling <[email protected]>
Git for Windows/ARM64 settled on using `clang` to compile `git.exe`, and
hence needs to run in a system where `MSYSTEM` is set to `CLANGARM64`
and the prefix to use is `/clangarm64`.

We already did that in the `MINGW` arm, i.e. for regular Git for Windows
builds using MINGW GCC (or `clang`'s shim pretending to be GCC), now it
is time to do the same in the MS Visual C part.

Signed-off-by: Johannes Schindelin <[email protected]>
Atomic append on windows is only supported on local disk files, and it may
cause errors in other situations, e.g. network file system. If that is the
case, this config option should be used to turn atomic append off.

Co-Authored-By: Johannes Schindelin <[email protected]>
Signed-off-by: 孙卓识 <[email protected]>
Signed-off-by: Johannes Schindelin <[email protected]>
From the documentation of said setting:

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

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

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

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

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

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

This partially addresses #3935.

Signed-off-by: Matthias Aßhauer <[email protected]>
Add FileVersion, which is a required field
As not all required fields were present, none were being included
Fixes #4090

Signed-off-by: Kiel Hurley <[email protected]>
Newer compiler versions, like GCC 10 and Clang 12, have built-in
functions for bswap32 and bswap64. This comes in handy, for example,
when targeting CLANGARM64 on Windows, which would not be supported
without this logic.

Signed-off-by: Dennis Ameling <[email protected]>
In fb5e337 (mingw: move Git for Windows' system config where users
expect it, 2021-06-22), I moved the location of Git for Windows' system
config and system Git attributes file to the top-level `/etc/` directory
(because it is a much more obvious location than, say, `/mingw64/etc/`).

The patch relied on a very specific scenario that the newly-supported
Windows/ARM64 builds of `git.exe` fails to fall into. So let's broaden
the condition a bit, so that Windows/ARM64 builds also use that location
(instead of the even more obscure `/clangarm64/etc/` directory).

This fixes #5431.

Signed-off-by: Johannes Schindelin <[email protected]>
This compile-time option allows to ask Git to load libcurl dynamically
at runtime.

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

Signed-off-by: Johannes Schindelin <[email protected]>
This implements the Windows-specific support code, because everything is
slightly different on Windows, even loading shared libraries.

Note: I specifically do _not_ use the code from
`compat/win32/lazyload.h` here because that code is optimized for
loading individual functions from various system DLLs, while we
specifically want to load _many_ functions from _one_ DLL here, and
distinctly not a system DLL (we expect libcurl to be located outside
`C:\Windows\system32`, something `INIT_PROC_ADDR` refuses to work with).
Also, the `curl_easy_getinfo()`/`curl_easy_setopt()` functions are
declared as vararg functions, which `lazyload.h` cannot handle. Finally,
we are about to optionally override the exact file name that is to be
loaded, which is a goal contrary to `lazyload.h`'s design.

Signed-off-by: Johannes Schindelin <[email protected]>
The previous commits introduced a compile-time option to load libcurl
lazily, but it uses the hard-coded name "libcurl-4.dll" (or equivalent
on platforms other than Windows).

To allow for installing multiple libcurl flavors side by side, where
each supports one specific SSL/TLS backend, let's first look whether
`libcurl-<backend>-4.dll` exists, and only use `libcurl-4.dll` as a fall
back.

That will allow us to ship with a libcurl by default that only supports
the Secure Channel backend for the `https://` protocol. This libcurl
won't suffer from any dependency problem when upgrading OpenSSL to a new
major version (which will change the DLL name, and hence break every
program and library that depends on it).

This is crucial because Git for Windows relies on libcurl to keep
working when building and deploying a new OpenSSL package because that
library is used by `git fetch` and `git clone`.

Note that this feature is by no means specific to Windows. On Ubuntu,
for example, a `git` built using `LAZY_LOAD_LIBCURL` will use
`libcurl.so.4` for `http.sslbackend=openssl` and `libcurl-gnutls.so.4`
for `http.sslbackend=gnutls`.

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

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

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

This fixes #4083.

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

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

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

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

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

Signed-off-by: Johannes Schindelin <[email protected]>
Since Git v2.39.1, we are a bit more stringent in searching the PATH. In
particular, we specifically require the `.exe` suffix.

However, the `Repository>Explore Working Copy` command asks for
`explorer.exe` to be found on the `PATH`, which _already_ has that
suffix.

Let's unstartle the PATH-finding logic about this scenario.

This fixes #4356

Signed-off-by: Johannes Schindelin <[email protected]>
This will help with Git for Windows' maintenance going forward: It
allows Git for Windows to switch its primary libcurl to a variant
without the OpenSSL backend, while still loading an alternate when
setting `http.sslBackend = openssl`.

This is necessary to avoid maintenance headaches with upgrading OpenSSL:
its major version name is encoded in the shared library's file name and
hence major version updates (temporarily) break libraries that are
linked against the OpenSSL library.

Signed-off-by: Johannes Schindelin <[email protected]>
In Git for Windows v2.39.0, we fixed a regression where `git.exe` would
no longer work in Windows Nano Server (frequently used in Docker
containers).

This GitHub workflow can be used to verify manually that the Git/Scalar
executables work in Nano Server.

Signed-off-by: Johannes Schindelin <[email protected]>
When running Git for Windows on a remote APFS filesystem, it would
appear that the `mingw_open_append()`/`write()` combination would fail
almost exactly like on some CIFS-mounted shares as had been reported in
#2753, albeit with a
different `errno` value.

Let's handle that `errno` value just the same, by suggesting to set
`windows.appendAtomically=false`.

Signed-off-by: David Lomas <[email protected]>
Signed-off-by: Johannes Schindelin <[email protected]>
Windows 10 version 1511 (also known as Anniversary Update), according to
https://learn.microsoft.com/en-us/windows/console/console-virtual-terminal-sequences
introduced native support for ANSI sequence processing. This allows
using colors from the entire 24-bit color range.

All we need to do is test whether the console's "virtual processing
support" can be enabled. If it can, we do not even need to start the
`console_thread` to handle ANSI sequences.

Or, almost all we need to do: When `console_thread()` does its work, it
uses the Unicode-aware `write_console()` function to write to the Win32
Console, which supports Git for Windows' implicit convention that all
text that is written is encoded in UTF-8. The same is not necessarily
true if native ANSI sequence processing is used, as the output is then
subject to the current code page. Let's ensure that the code page is set
to `CP_UTF8` as long as Git writes to it.

Signed-off-by: Johannes Schindelin <[email protected]>
winuser.h contains the definition of RT_MANIFEST that our LLVM based
toolchain needs to understand that we want to embed
compat/win32/git.manifest as an application manifest. It currently just
embeds it as additional data that Windows doesn't understand.

This also helps our GCC based toolchain understand that we only want one
copy embedded. It currently embeds one working assembly manifest and one
nearly identical, but useless copy as additional data.

This also teaches our Visual Studio based buildsystems to pick up the
manifest file from git.rc. This means we don't have to explicitly specify
it in contrib/buildsystems/Generators/Vcxproj.pm anymore. Slightly
counter-intuitively this also means we have to explicitly tell Cmake
not to embed a default manifest.

This fixes #4707

Signed-off-by: Matthias Aßhauer <[email protected]>
Signed-off-by: Johannes Schindelin <[email protected]>
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 <[email protected]>
Signed-off-by: Johannes Schindelin <[email protected]>
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 <[email protected]>
The `__MINGW64__` constant is defined, surprise, surprise, only when
building for a 64-bit CPU architecture.

Therefore using it as a guard to define `_POSIX_C_SOURCE` (so that
`localtime_r()` is declared, among other functions) is not enough, we
also need to check `__MINGW32__`.

Technically, the latter constant is defined even for 64-bit builds. But
let's make things a bit easier to understand by testing for both
constants.

Making it so fixes this compile warning (turned error in GCC v14.1):

  archive-zip.c: In function 'dos_time':
  archive-zip.c:612:9: error: implicit declaration of function 'localtime_r';
  did you mean 'localtime_s'? [-Wimplicit-function-declaration]
    612 |         localtime_r(&time, &tm);
        |         ^~~~~~~~~~~
        |         localtime_s

Signed-off-by: Johannes Schindelin <[email protected]>
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 <[email protected]>
shiftkey and others added 19 commits March 14, 2025 22:30
With improvements by Clive Chan, Adric Norris, Ben Bodenmiller and
Philip Oakley.

Helped-by: Clive Chan <[email protected]>
Helped-by: Adric Norris <[email protected]>
Helped-by: Ben Bodenmiller <[email protected]>
Helped-by: Philip Oakley <[email protected]>
Signed-off-by: Brendan Forster <[email protected]>
Signed-off-by: Johannes Schindelin <[email protected]>
These are Git for Windows' Git GUI and gitk patches. We will have to
decide at some point what to do about them, but that's a little lower
priority (as Git GUI seems to be unmaintained for the time being, and
the gitk maintainer keeps a very low profile on the Git mailing list,
too).

Signed-off-by: Johannes Schindelin <[email protected]>
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 <[email protected]>
Signed-off-by: Johannes Schindelin <[email protected]>
This is the recommended way on GitHub to describe policies revolving around
security issues and about supported versions.

Helped-by: Sven Strickroth <[email protected]>
Signed-off-by: Johannes Schindelin <[email protected]>
Signed-off-by: Johannes Schindelin <[email protected]>
This was pull request #1645 from ZCube/master

Support windows container.

Signed-off-by: Johannes Schindelin <[email protected]>
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 <[email protected]>
Specify symlink type in .gitattributes
Signed-off-by: Johannes Schindelin <[email protected]>
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 <[email protected]>
Handle Ctrl+C in Git Bash nicely

Signed-off-by: Johannes Schindelin <[email protected]>
Switch to batched fsync by default
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
Start monitoring updates of Git for Windows' component in the open
Add a README.md for GitHub goodness.

Signed-off-by: Johannes Schindelin <[email protected]>
@dscho dscho self-assigned this Mar 14, 2025
@dscho dscho linked an issue Mar 14, 2025 that may be closed by this pull request
@dscho dscho added this to the v2.49.0 milestone Mar 14, 2025
@dscho dscho marked this pull request as ready for review March 17, 2025 06:20
@dscho
Copy link
Member Author

dscho commented Mar 17, 2025

/git-artifacts

The tag-git workflow run was started

The git-artifacts-x86_64 workflow run was started.
The git-artifacts-i686 workflow run was started.
The git-artifacts-aarch64 workflow run was started.

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 Mar 17, 2025

/release

The release-git workflow run was started

Copy link

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

@gitforwindowshelper gitforwindowshelper bot merged commit cca1f38 into main Mar 17, 2025
54 checks passed
@gitforwindowshelper gitforwindowshelper bot deleted the rebase-to-v2.49.0 branch March 17, 2025 10:32
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.49.0