Skip to content

Rebase shears/seen (#23469155076)#60

Open
gitforwindowshelper[bot] wants to merge 277 commits intobase/shears/seen-23469155076from
shears/seen-23469155076
Open

Rebase shears/seen (#23469155076)#60
gitforwindowshelper[bot] wants to merge 277 commits intobase/shears/seen-23469155076from
shears/seen-23469155076

Conversation

@gitforwindowshelper
Copy link
Copy Markdown

Workflow run

Rebase Summary: seen

From: 8a8d3227ea (http: fix bug in ntlm_allow=1 handling (git-for-windows#6136), 2026-03-23) (2e349fbf56..8a8d3227ea)

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

kept both sides' additions in http.c (retry env vars + NTLM auth assignment) and t/lib-httpd.sh (http-429.sh + ntlm-handshake.sh scripts)

Range-diff

To: 02a38520d0 (http: fix bug in ntlm_allow=1 handling (git-for-windows#6136), 2026-03-23) (56d3fad4ca..02a38520d0)

Statistics

Metric Count
Total conflicts 1
Skipped (upstreamed) 0
Resolved surgically 1
Range-diff (click to expand)
  1:  399dff3946 =   1:  c626f211ca unix-socket: avoid leak when initialization fails
  2:  f2569e62ee =   2:  6d7abdad52 grep: prevent `^$` false match at end of file
  6:  0dfeb68314 =   3:  9cf122833d t9350: point out that refs are not updated correctly
  8:  d363dbc804 =   4:  8ee51b9801 transport-helper: add trailing --
 10:  5aac36ff91 =   5:  4ed2412e55 remote-helper: check helper status after import/export
 16:  64ba09716f =   6:  74f397e8c5 vcpkg_install: detect lack of Git
 17:  29a15e25dc =   7:  21c32bd122 vcpkg_install: add comment regarding slow network connections
 18:  cc5d66ef1e =   8:  66492404ef vcbuild: install ARM64 dependencies when building ARM64 binaries
 19:  11aec094c1 =   9:  e346d045d1 vcbuild: add an option to install individual 'features'
 20:  588a6d062e =  10:  936c9ac049 cmake: allow building for Windows/ARM64
  3:  ad11907b3a =  11:  4df9e223f1 mingw: include the Python parts in the build
 21:  227b52d388 =  12:  565a703721 ci(vs-build) also build Windows/ARM64 artifacts
  4:  3575568586 =  13:  24ff818597 win32/pthread: avoid name clashes with winpthread
 22:  abbc6baf94 =  14:  4dd2d16070 Add schannel to curl installation
  5:  142b26cba6 =  15:  58917e3fa9 git-compat-util: avoid redeclaring _DEFAULT_SOURCE
 23:  3e15eb4a1f =  16:  1b7f43bf64 hash-object: demonstrate a >4GB/LLP64 problem
 24:  e4fbcb929e =  17:  1853efa8e3 cmake(): allow setting HOST_CPU for cross-compilation
  7:  70f2cda5fa =  18:  5505b0dd84 Import the source code of mimalloc v2.2.7
 25:  805161f7af =  19:  b385f35a38 object-file.c: use size_t for header lengths
 26:  b37e206dbe =  20:  02fcfdc2ae CMake: default Visual Studio generator has changed
  9:  c026444917 =  21:  1a990946ad mimalloc: adjust for building inside Git
 27:  bb344f1fb3 =  22:  d6143d9d91 hash algorithms: use size_t for section lengths
 28:  eab4705947 =  23:  32b1896809 mingw: demonstrate a `git add` issue with NTFS junctions
 29:  54f7dae2f6 =  24:  cae57a9c86 .gitignore: add Visual Studio CMakeSetting.json file
 12:  addd5d1d30 =  25:  4b41399329 mimalloc: offer a build-time option to enable it
 32:  9cd66cc969 =  26:  dc78365c05 t5505/t5516: allow running without `.git/branches/` in the templates
 30:  49bd2dd22a =  27:  49d95544ae hash-object --stdin: verify that it works with >4GB/LLP64
 11:  76a67a53ba =  28:  299864c73d clean: do not traverse mount points
 33:  175a99ff0a =  29:  9029a9d28c strbuf_realpath(): use platform-dependent API if available
 34:  085521033e =  30:  e00e5e8b8f http: use new "best effort" strategy for Secure Channel revoke checking
 35:  829af144ec =  31:  113c947d22 subtree: update `contrib/subtree` `test` target
 36:  ba5dfcc52e =  32:  e4f7ac2c92 CMakeLists: add default "x64-windows" arch for Visual Studio
 31:  5f8da603dd =  33:  548411be7a mingw: use mimalloc
 41:  e0eb0008bd =  34:  e43af07b84 t5505/t5516: fix white-space around redirectors
 37:  6daca9d6c4 =  35:  b21861e2d4 hash-object: add another >4GB/LLP64 test case
 13:  0646a33637 =  36:  196b9101af Always auto-gc after calling a fast-import transport
 14:  300b340a7a =  37:  a70065e60f mingw: prevent regressions with "drive-less" absolute paths
 15:  6a4c518e54 =  38:  83b15bcd14 clean: remove mount points when possible
 43:  5b2da33b7b =  39:  3f220296c4 transport: optionally disable side-band-64k
 44:  0e4107b47a =  40:  64e5a37ba3 mingw: fix fatal error working on mapped network drives on Windows
 45:  338262e13e =  41:  b3fe304d14 clink.pl: fix MSVC compile script to handle libcurl-d.lib
 46:  f56818292f =  42:  626a1a33fb mingw: implement a platform-specific `strbuf_realpath()`
 47:  f69f6f3fe7 =  43:  d8eae6814e t3701: verify that we can add *lots* of files interactively
 48:  a6c819e6b3 =  44:  38a195ff68 commit: accept "scissors" with CR/LF line endings
 49:  85a1ba704f =  45:  d5c37f750e t0014: fix indentation
 50:  883db75dd4 =  46:  291924fb65 git-gui: accommodate for intent-to-add files
 51:  386232ac15 =  47:  9a81ce23f4 mingw: allow for longer paths in `parse_interpreter()`
 52:  73869d19c1 =  48:  8e1b48eb63 compat/vcbuild: document preferred way to build in Visual Studio
 53:  0430d9c48f =  49:  fbe8186b6e http: optionally send SSL client certificate
 54:  5d788b7b1e =  50:  0d6e21d25b ci: run `contrib/subtree` tests in CI builds
 55:  45ec067392 =  51:  3d6d754b15 CMake: show Win32 and Generator_platform build-option values
 40:  54d1551177 =  52:  1ea9ddc211 windows: skip linking `git-<command>` for built-ins
 63:  a966774469 =  53:  229da8cf0e mingw: stop hard-coding `CC = gcc`
 64:  cde1c292bd =  54:  1f1ee07a8b mingw: drop the -D_USE_32BIT_TIME_T option
 65:  186b94425c =  55:  58114df0e9 mingw: only use -Wl,--large-address-aware for 32-bit builds
 66:  2cb108ee77 =  56:  c8cacb0777 mingw: avoid over-specifying `--pic-executable`
 67:  9f738e97ca =  57:  294c69ae46 mingw: set the prefix and HOST_CPU as per MSYS2's settings
 68:  1196e291b5 =  58:  38a9d76ff6 mingw: only enable the MSYS2-specific stuff when compiling in MSYS2
 69:  eb4cb3184f =  59:  e7bb81f2dd mingw: rely on MSYS2's metadata instead of hard-coding it
 70:  2598a155e1 =  60:  d5f4bdd481 mingw: always define `ETC_*` for MSYS2 environments
 71:  33d8dce67e =  61:  0370c1f212 max_tree_depth: lower it for clang builds in general on Windows
 72:  6ebd79d6d2 =  62:  855db934b8 mingw: ensure valid CTYPE
 74:  e7429a66ca =  63:  aba33995a6 mingw: allow `git.exe` to be used instead of the "Git wrapper"
 76:  3521f642df =  64:  6962d99581 mingw: ignore HOMEDRIVE/HOMEPATH if it points to Windows' system directory
 79:  74e7e9fa86 =  65:  af0ae12652 clink.pl: fix libexpatd.lib link error when using MSVC
 81:  bdfc364a98 =  66:  08faec746c Makefile: clean up .ilk files when MSVC=1
 83:  30712e0d19 =  67:  8bb3c5fdaa vcbuild: add support for compiling Windows resource files
 73:  0ca67251f8 =  68:  15a493aad2 ci: work around a problem with HTTP/2 vs libcurl v8.10.0
 85:  417b2b7302 =  69:  fcabcc5eae config.mak.uname: add git.rc to MSVC builds
 42:  8fa9061d1a =  70:  197768e2d3 MinGW: link as terminal server aware
 75:  bfc3a2b476 =  71:  349ac8db84 revision: create mark_trees_uninteresting_dense()
 88:  d718da0143 =  72:  f69d3e111e clink.pl: ignore no-stack-protector arg on MSVC=1 builds
 89:  c9b28348f4 =  73:  effe9d4b5c http: optionally load libcurl lazily
 77:  850ef22d11 =  74:  677f71918c survey: stub in new experimental 'git-survey' command
 92:  2a9d26bdb7 =  75:  45cdcd81ca clink.pl: move default linker options for MSVC=1 builds
 93:  1c6ab00a90 =  76:  7b4ef932f4 http: support lazy-loading libcurl also on Windows
 78:  bb09cedce2 =  77:  847378ddbd survey: add command line opts to select references
 38:  9c36c25016 =  78:  757c1f378e setup: properly use "%(prefix)/" when in WSL
 39:  ddebcc69b2 =  79:  02d24c0f34 Add config option `windows.appendAtomically`
 96:  06379e1ff1 =  80:  7c459ffe3b cmake: install headless-git.
 97:  e78dfe1b3e =  81:  bee144107c http: when loading libcurl lazily, allow for multiple SSL backends
 80:  d180dddeb8 =  82:  c6f0d627f0 survey: start pretty printing data in table form
 56:  c45d73b4bd =  83:  e588f7ac43 hash-object: add a >4GB/LLP64 test case using filtered input
 57:  83b6b5c59c =  84:  c62e073f26 compat/mingw.c: do not warn when failing to get owner
 58:  49f80f2b82 =  85:  759a15e16d mingw: $env:TERM="xterm-256color" for newer OSes
 59:  b86e040773 =  86:  9e6bf8a1a2 winansi: check result and Buffer before using Name
 60:  eb226d73e4 =  87:  2ea315c23b mingw: change core.fsyncObjectFiles = 1 by default
 61:  b33293c5f4 =  88:  b4fd2e394a Fix Windows version resources
 62:  0b0f7b8bce =  89:  a8e711ac62 status: fix for old-style submodules with commondir
100:  c468722511 =  90:  a9f8693f54 git.rc: include winuser.h
101:  a1782e9c94 =  91:  b7e1c11f0e mingw: do load libcurl dynamically by default
102:  7b3f293ca4 =  92:  811e870a61 Add a GitHub workflow to verify that Git/Scalar work in Nano Server
103:  714096194a =  93:  36b363737a mingw: suggest `windows.appendAtomically` in more cases
104:  5e987c2ea8 =  94:  8afefe5d8e win32: use native ANSI sequence processing, if possible
105:  a7e2f6a339 =  95:  fb6294c439 common-main.c: fflush stdout buffer upon exit
106:  52bce3ea7f =  96:  0e04dad4f4 t5601/t7406(mingw): do run tests with symlink support
107:  dbec31be02 =  97:  61c25a7f2f win32: ensure that `localtime_r()` is declared even in i686 builds
108:  8fdc87ee85 =  98:  d2779f79e7 Fallback to AppData if XDG_CONFIG_HOME is unset
109:  f07cb1dd66 =  99:  86c415dac2 run-command: be helpful with Git LFS fails on Windows 7
 82:  9b76b91268 = 100:  9d29f0baab survey: add object count summary
 84:  21d823fe18 = 101:  2925674101 survey: summarize total sizes by object type
 86:  5dfb255f11 = 102:  965003291c survey: show progress during object walk
 87:  9c3ac985dd = 103:  5ef2256841 mingw: make sure `errno` is set correctly when socket operations fail
 90:  a8e961375e = 104:  2838b828a3 survey: add ability to track prioritized lists
 91:  8a3bce3af0 = 105:  2f97d77e46 compat/mingw: handle WSA errors in strerror
 94:  a00ef80433 = 106:  637efd0ea4 survey: add report of "largest" paths
 95:  c4bcdc6d94 = 107:  50def4b7d9 compat/mingw: drop outdated comment
 98:  9a1c557220 = 108:  1c7fd59194 survey: add --top=<N> option and config
 99:  8fbf473ee4 = 109:  cdb9b4656b t0301: actually test credential-cache on Windows
110:  c51462b9c4 = 110:  8bb77e0cf3 survey: clearly note the experimental nature in the output
111:  52750d2adf = 111:  4c874f94b0 credential-cache: handle ECONNREFUSED gracefully
112:  51a9a41c78 = 112:  f490c51fc6 reftable: do make sure to use custom allocators
113:  20ace1755f = 113:  b2433420e4 check-whitespace: avoid alerts about upstream commits
114:  75b5fb2bcd = 114:  995c48d6c5 t/t5571-prep-push-hook.sh: Add test with writing to stderr
115:  f639118e86 = 115:  bbd8e4dd73 git-svn: mark it as unsupported by the Git for Windows project
116:  ea8a57e7ad = 116:  0359d995df ci(macos): skip the `git p4` tests
119:  0130931fc5 = 117:  bd3fe7be97 Win32: make FILETIME conversion functions public
120:  9c668361aa = 118:  e4bf2d4edc Win32: dirent.c: Move opendir down
121:  46dadb3077 = 119:  e6ab2b221f mingw: make the dirent implementation pluggable
122:  12de1b9f1e = 120:  8f45723e9f Win32: make the lstat implementation pluggable
123:  e869c10777 = 121:  ffc4fba159 mingw: add infrastructure for read-only file system level caches
124:  90c4df6237 = 122:  3243288fb4 mingw: add a cache below mingw's lstat and dirent implementations
125:  14b1da93c4 = 123:  57d40b15d1 fscache: load directories only once
126:  994bee39e3 = 124:  17c61b638e fscache: add key for GIT_TRACE_FSCACHE
127:  a457a5a355 = 125:  9d894955f0 fscache: remember not-found directories
128:  6a4fe5f70d = 126:  62603ba75f fscache: add a test for the dir-not-found optimization
129:  48f1898c19 = 127:  740f20f13e add: use preload-index and fscache for performance
130:  ec8bbcea42 = 128:  da7184f143 dir.c: make add_excludes aware of fscache during status
131:  83056f9199 = 129:  1216f140b5 fscache: make fscache_enabled() public
132:  2d99ee3d39 = 130:  1b7dc438ea dir.c: regression fix for add_excludes with fscache
133:  c96a71919b = 131:  1d082393a9 fetch-pack.c: enable fscache for stats under .git/objects
134:  9029af6bc7 = 132:  c2f6774362 checkout.c: enable fscache for checkout again
135:  db99dbc730 = 133:  c4e955c908 Enable the filesystem cache (fscache) in refresh_index().
136:  e2ad07995b = 134:  3abda8f7f8 fscache: use FindFirstFileExW to avoid retrieving the short name
117:  95caf0b12c = 135:  bce221d70d git-gui--askyesno: fix funny text wrapping
137:  fc334e0d0a = 136:  674b01278d fscache: add GIT_TEST_FSCACHE support
118:  619c06c7e8 = 137:  edab361387 git-gui--askyesno (mingw): use Git for Windows' icon, if available
138:  44d5b8c0f5 = 138:  e69490565e fscache: add fscache hit statistics
139:  c98f5227ca = 139:  2d74e82758 unpack-trees: enable fscache for sparse-checkout
140:  a1140454f9 = 140:  aef843a467 status: disable and free fscache at the end of the status command
141:  5bc7be99e6 = 141:  9ec92552e6 mem_pool: add GIT_TRACE_MEMPOOL support
142:  4c5c033c2a = 142:  918d29a2c6 fscache: fscache takes an initial size
143:  d47248f8dc = 143:  613a1eec20 fscache: update fscache to be thread specific instead of global
144:  6910ad4f3d = 144:  2656e718d7 fscache: teach fscache to use mempool
145:  8674e38300 = 145:  c8212d2f55 fscache: make fscache_enable() thread safe
146:  119e266707 = 146:  880c6a1e87 fscache: teach fscache to use NtQueryDirectoryFile
147:  5796dc5d56 = 147:  45c5c895a6 fscache: remember the reparse tag for each entry
148:  76b5a20972 = 148:  8c2ee902fa fscache: implement an FSCache-aware is_mount_point()
149:  112f1ac685 = 149:  81d8672ba8 clean: make use of FSCache
150:  bd40a08d59 = 150:  babb22fd7d pack-objects (mingw): demonstrate a segmentation fault with large deltas
151:  8b709e38a3 = 151:  474eeac1fa mingw: support long paths
152:  a8ce80da8c = 152:  bc7a039440 win32(long path support): leave drive-less absolute paths intact
153:  c96113289a = 153:  111f61aa6e compat/fsmonitor/fsm-*-win32: support long paths
154:  dedcd7b45f = 154:  4763d2d8ef clean: suggest using `core.longPaths` if paths are too long to remove
155:  5fce26d25f = 155:  49c8a83d9d mingw: Support `git_terminal_prompt` with more terminals
156:  d52db01d2b = 156:  39b61eb67d compat/terminal.c: only use the Windows console if bash 'read -r' fails
157:  e17bd48ec9 = 157:  f356906ae3 mingw (git_terminal_prompt): do fall back to CONIN$/CONOUT$ method
158:  036df2463f = 158:  ae71943459 Win32: symlink: move phantom symlink creation to a separate function
159:  acc6f9b21b = 159:  9667430a2f Introduce helper to create symlinks that knows about index_state
160:  938bd244b2 = 160:  ddb0b7b88c mingw: allow to specify the symlink type in .gitattributes
161:  b9133c43eb = 161:  40a988b935 Win32: symlink: add test for `symlink` attribute
163:  fc69f7abfb = 162:  4a3c7dcb86 mingw: explicitly specify with which cmd to prefix the cmdline
165:  42a6c52903 = 163:  fe557bf6fe mingw: when path_lookup() failed, try BusyBox
167:  3e42b3f2c7 = 164:  706ee2c96f test-tool: learn to act as a drop-in replacement for `iconv`
169:  7da1059905 = 165:  27b6037254 tests(mingw): if `iconv` is unavailable, use `test-helper --iconv`
171:  b88591189d = 166:  91b9bcfa36 gitattributes: mark .png files as binary
172:  8c1e7714f6 = 167:  b3f5682feb tests: move test PNGs into t/lib-diff/
173:  a515375cda = 168:  d2e147818a tests: only override sort & find if there are usable ones in /usr/bin/
174:  c08c2ced52 = 169:  6a1bd752f3 tests: use the correct path separator with BusyBox
175:  c54665fe04 = 170:  398a75326e mingw: only use Bash-ism `builtin pwd -W` when available
176:  4e4580dd81 = 171:  6acd02e0c8 tests (mingw): remove Bash-specific pwd option
162:  95dc1bebfb = 172:  b376674613 mingw: introduce code to detect whether we're inside a Windows container
177:  9bd6ac48f6 = 173:  6f8226631e test-lib: add BUSYBOX prerequisite
164:  30b1aa676f = 174:  c6315d4971 mingw: when running in a Windows container, try to rename() harder
178:  595ecc905b = 175:  613230a2a8 t5003: use binary file from t/lib-diff/
166:  f197187ea4 = 176:  e3a6938809 mingw: move the file_attr_to_st_mode() function definition
179:  e9aa1e8fc3 = 177:  e9cf1d208e t5532: workaround for BusyBox on Windows
168:  124861d881 = 178:  8b9218aa20 mingw: Windows Docker volumes are *not* symbolic links
180:  d15e49bfec = 179:  62c8815b67 t5605: special-case hardlink test for BusyBox-w32
170:  9364df72fe = 180:  034f2c0f9e mingw: work around rename() failing on a read-only file
182:  4af13e44b5 = 181:  397dbb85e7 t5813: allow for $PWD to be a Windows path
184:  d346bb1d1b = 182:  1bd4fc52d4 t9200: skip tests when $PWD contains a colon
181:  41244d73ec = 183:  25c5ebf066 Describe Git for Windows' architecture [no ci]
186:  592a716488 = 184:  ca8036ca07 mingw: kill child processes in a gentler way
187:  3e90e49d1d = 185:  2001553250 mingw: optionally enable wsl compability file mode bits
183:  7d0a2ef207 = 186:  c9f146b20c Modify the Code of Conduct for Git for Windows
189:  c03c270919 = 187:  e0c893a862 mingw: really handle SIGINT
185:  c153b9a7de = 188:  b3690b74e1 CONTRIBUTING.md: add guide for first-time contributors
191:  1adfe4e3bf = 189:  5e19cec7d1 Partially un-revert "editor: save and reset terminal after calling EDITOR"
188:  e24a5ed5d9 = 190:  0a57bb195d README.md: Add a Windows-specific preamble
194:  7b2e614c63 = 191:  a1b235c1f3 reset: reinstate support for the deprecated --stdin option
190:  22441ea227 = 192:  e92c72b465 Add an issue template
192:  d0213b6104 = 193:  92d74d14ce Add a GitHub workflow to monitor component updates
195:  dc7c427a5f = 194:  5c2241430a fsmonitor: reintroduce core.useBuiltinFSMonitor
193:  d1a8f94548 = 195:  55c2d739be Modify the GitHub Pull Request template (to reflect Git for Windows)
196:  37bab041fa = 196:  89496bab32 dependabot: help keeping GitHub Actions versions up to date
197:  90e2c310de = 197:  5a64343df5 SECURITY.md: document Git for Windows' policies
  -:  ---------- > 198:  8d6e32293b http: fix bug in ntlm_allow=1 handling

PhilipOakley and others added 30 commits March 24, 2026 01:49
In Git-for-Windows, work on using ARM64 has progressed. The
commit 2d94b77 (cmake: allow building for Windows/ARM64, 2020-12-04)
failed to notice that /compat/vcbuild/vcpkg_install.bat will default to
using the "x64-windows" architecture for the vcpkg installation if not set,
but CMake is not told of this default. Commit 635b6d9 (vcbuild: install
ARM64 dependencies when building ARM64 binaries, 2020-01-31) later updated
vcpkg_install.bat to accept an arch (%1) parameter, but retained the default.

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

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

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

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

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

Signed-off-by: Philip Oakley <philipoakley@iee.email>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
After importing anything with fast-import, we should always let the
garbage collector do its job, since the objects are written to disk
inefficiently.

This brings down an initial import of http://selenic.com/hg from about
230 megabytes to about 14.

In the future, we may want to make this configurable on a per-remote
basis, or maybe teach fast-import about it in the first place.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
On Windows, there are several categories of absolute paths. One such
category starts with a backslash and is implicitly relative to the drive
associated with the current working directory. Example:

	c:
	git clone https://github.com/git-for-windows/git \G4W

should clone into C:\G4W.

Back in 2017, Juan Carlos Arevalo Baeza reported a bug in Git's handling
of those absolute paths was identified, and fixed. Let's make sure that
it stays fixed.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Windows' equivalent to "bind mounts", NTFS junction points, can be
unlinked without affecting the mount target. This is clearly what users
expect to happen when they call `git clean -dfx` in a worktree that
contains NTFS junction points: the junction should be removed, and the
target directory of said junction should be left alone (unless it is
inside the worktree).

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
While Git for Windows does not _ship_ Python (in order to save on
bandwidth), MSYS2 provides very fine Python interpreters that users can
easily take advantage of, by using Git for Windows within its SDK.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Thorough benchmarking with repacking a subset of linux.git (the commit
history reachable from 93a6fef ([PATCH] fix the SYSCTL=n compilation,
2007-02-28), to be precise) suggest that this allocator is on par, in
multi-threaded situations maybe even better than nedmalloc:

`git repack -adfq` with mimalloc, 8 threads:

31.166991900 27.576763800 28.712311000 27.373859000 27.163141900

`git repack -adfq` with nedmalloc, 8 threads:

31.915032900 27.149883100 28.244933700 27.240188800 28.580849500

In a different test using GitHub Actions build agents (probably
single-threaded, a core-strength of nedmalloc)):

`git repack -q -d -l -A --unpack-unreachable=2.weeks.ago` with mimalloc:

943.426 978.500 939.709 959.811 954.605

`git repack -q -d -l -A --unpack-unreachable=2.weeks.ago` with nedmalloc:

995.383 952.179 943.253 963.043 980.468

While these measurements were not executed with complete scientific
rigor, as no hardware was set aside specifically for these benchmarks,
it shows that mimalloc and nedmalloc perform almost the same, nedmalloc
with a bit higher variance and also slightly higher average (further
testing suggests that nedmalloc performs worse in multi-threaded
situations than in single-threaded ones).

In short: mimalloc seems to be slightly better suited for our purposes
than nedmalloc.

Seeing that mimalloc is developed actively, while nedmalloc ceased to
see any updates in eight years, let's use mimalloc on Windows instead.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Since commit 0c499ea (send-pack: demultiplex a sideband stream with
status data, 2010-02-05) the send-pack builtin uses the side-band-64k
capability if advertised by the server.

Unfortunately this breaks pushing over the dump git protocol if used
over a network connection.

The detailed reasons for this breakage are (by courtesy of Jeff Preshing,
quoted from https://groups.google.com/d/msg/msysgit/at8D7J-h7mw/eaLujILGUWoJ):

	MinGW wraps Windows sockets in CRT file descriptors in order to
	mimic the functionality of POSIX sockets. This causes msvcrt.dll
	to treat sockets as Installable File System (IFS) handles,
	calling ReadFile, WriteFile, DuplicateHandle and CloseHandle on
	them. This approach works well in simple cases on recent
	versions of Windows, but does not support all usage patterns. In
	particular, using this approach, any attempt to read & write
	concurrently on the same socket (from one or more processes)
	will deadlock in a scenario where the read waits for a response
	from the server which is only invoked after the write. This is
	what send_pack currently attempts to do in the use_sideband
	codepath.

The new config option `sendpack.sideband` allows to override the
side-band-64k capability of the server, and thus makes the dumb git
protocol work.

Other transportation methods like ssh and http/https still benefit from
the sideband channel, therefore the default value of `sendpack.sideband`
is still true.

Signed-off-by: Thomas Braun <thomas.braun@byte-physics.de>
Signed-off-by: Oliver Schneider <oliver@assarbad.net>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
In 1e64d18 (mingw: do resolve symlinks in `getcwd()`) a problem was
introduced that causes git for Windows to stop working with certain
mapped network drives (in particular, drives that are mapped to
locations with long path names). Error message was "fatal: Unable to
read current working directory: No such file or directory". Present
change fixes this issue as discussed in
git-for-windows#2480

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

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

This fixes git-for-windows#2481.

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

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

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

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

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

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

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

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

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

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

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

This fixes git-for-windows#2779

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

A simple retry will usually resolve the issue.

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

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

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

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

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

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

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

Let's let the `README` reflect this.

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

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

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

This fixes git-for-windows#3292

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

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

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

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

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

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

Signed-off-by: Philip Oakley <philipoakley@iee.email>
This is no longer true in general, not with supporting Clang out of the
box.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
This option was added in fa93bb2 (MinGW: Fix stat definitions to
work with MinGW runtime version 4.0, 2013-09-11), i.e. a _long_ time
ago. So long, in fact, that it still targeted MinGW. But we switched to
mingw-w64 in 2015, which seems not to share the problem, and therefore
does not require a fix.

Even worse: This flag is incompatible with UCRT64, which we are about to
support by way of upstreaming `mingw-w64-git` to the MSYS2 project, see
msys2/MINGW-packages#26470 for details.

So let's send that option into its well-deserved retirement.

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

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
That option only matters there, and is in fact only really understood in
those builds; UCRT64 versions of GCC, for example, do not know what to
do with that option.

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

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

Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
dscho and others added 30 commits March 24, 2026 01:49
Git for Windows uses MSYS2's Bash to run the test suite, which comes
with benefits but also at a heavy price: on the plus side, MSYS2's
POSIX emulation layer allows us to continue pretending that we are on a
Unix system, e.g. use Unix paths instead of Windows ones, yet this is
bought at a rather noticeable performance penalty.

There *are* some more native ports of Unix shells out there, though,
most notably BusyBox-w32's ash. These native ports do not use any POSIX
emulation layer (or at most a *very* thin one, choosing to avoid
features such as fork() that are expensive to emulate on Windows), and
they use native Windows paths (usually with forward slashes instead of
backslashes, which is perfectly legal in almost all use cases).

And here comes the problem: with a $PWD looking like, say,
C:/git-sdk-64/usr/src/git/t/trash directory.t5813-proto-disable-ssh
Git's test scripts get quite a bit confused, as their assumptions have
been shattered. Not only does this path contain a colon (oh no!), it
also does not start with a slash.

This is a problem e.g. when constructing a URL as t5813 does it:
ssh://remote$PWD. Not only is it impossible to separate the "host" from
the path with a $PWD as above, even prefixing $PWD by a slash won't
work, as /C:/git-sdk-64/... is not a valid path.

As a workaround, detect when $PWD does not start with a slash on
Windows, and simply strip the drive prefix, using an obscure feature of
Windows paths: if an absolute Windows path starts with a slash, it is
implicitly prefixed by the drive prefix of the current directory. As we
are talking about the current directory here, anyway, that strategy
works.

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>
On Windows, the current working directory is pretty much guaranteed to
contain a colon. If we feed that path to CVS, it mistakes it for a
separator between host and port, though.

This has not been a problem so far because Git for Windows uses MSYS2's
Bash using a POSIX emulation layer that also pretends that the current
directory is a Unix path (at least as long as we're in a shell script).

However, that is rather limiting, as Git for Windows also explores other
ports of other Unix shells. One of those is BusyBox-w32's ash, which is
a native port (i.e. *not* using any POSIX emulation layer, and certainly
not emulating Unix paths).

So let's just detect if there is a colon in $PWD and punt in that case.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
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>
The TerminateProcess() function does not actually leave the child
processes any chance to perform any cleanup operations. This is bad
insofar as Git itself expects its signal handlers to run.

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

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

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

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

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

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

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

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

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

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

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

And reboot WSL.

It can also be enabled temporarily by this incantation:

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

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

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

We adapt it slightly to Git for Windows.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Signed-off-by: Matthew John Cheetham <mjcheetham@outlook.com>
This topic branch addresses the following vulnerability:

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

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

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

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