Skip to content

Rebase shears/next: 3 conflict(s) (3 skipped, 0 resolved) (#23946917784)#88

Open
gitforwindowshelper[bot] wants to merge 282 commits intobase/shears/next-23946917784from
shears/next-23946917784
Open

Rebase shears/next: 3 conflict(s) (3 skipped, 0 resolved) (#23946917784)#88
gitforwindowshelper[bot] wants to merge 282 commits intobase/shears/next-23946917784from
shears/next-23946917784

Conversation

@gitforwindowshelper
Copy link
Copy Markdown

Workflow run

Rebase Summary: next

From: a2409caf40 (cmake: use writev(3p) wrapper as needed, 2026-04-02) (0935e6b916..a2409caf40)

Skipped: cad0438 (sideband: mask control characters, 2024-11-06)

Upstream equivalent: 0494953 (sideband: mask control characters, 2026-03-05)

Range-diff
  • 1: cad0438 ! 1: 0494953 sideband: mask control characters

    @@ Commit message
         There is likely a need for more fine-grained controls instead of using a
         "heavy hammer" like this, which will be introduced subsequently.
     
    +    Helped-by: Phillip Wood <phillip.wood@dunelm.org.uk>
         Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
    +    Signed-off-by: Junio C Hamano <gitster@pobox.com>
     
      ## sideband.c ##
     @@ sideband.c: void list_config_color_sideband_slots(struct string_list *list, const char *pref
    @@ sideband.c: void list_config_color_sideband_slots(struct string_list *list, cons
     +{
     +	strbuf_grow(dest, n);
     +	for (; n && *src; src++, n--) {
    -+		if (!iscntrl(*src) || *src == '\t' || *src == '\n')
    ++		if (!iscntrl(*src) || *src == '\t' || *src == '\n') {
     +			strbuf_addch(dest, *src);
    -+		else {
    ++		} else {
     +			strbuf_addch(dest, '^');
    -+			strbuf_addch(dest, 0x40 + *src);
    ++			strbuf_addch(dest, *src == 0x7f ? '?' : 0x40 + *src);
     +		}
     +	}
     +}
    @@ t/t5409-colorize-remote-messages.sh: test_expect_success 'fallback to color.ui'
     +	printf "error: Have you \\033[31mread\\033[m this?\\n" >&2
     +	exec "$@"
     +	EOF
    -+	test_config_global uploadPack.packObjectshook ./color-me-surprised &&
    ++	test_config_global uploadPack.packObjectsHook ./color-me-surprised &&
     +	test_commit need-at-least-one-commit &&
     +	git clone --no-local . throw-away 2>stderr &&
     +	test_decode_color <stderr >decoded &&

Skipped: dea5198 (sideband: introduce an "escape hatch" to allow control characters, 2024-11-06)

Upstream equivalent: 9ed1625 (sideband: introduce an "escape hatch" to allow control characters, 2026-03-05)

Range-diff
  • 1: dea5198 ! 1: 9ed1625 sideband: introduce an "escape hatch" to allow control characters

    @@ Commit message
         To help with those use cases, give users a way to opt-out of the
         protections: `sideband.allowControlCharacters`.
     
    +    Suggested-by: brian m. carlson <sandals@crustytoothpaste.net>
         Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
    +    Signed-off-by: Junio C Hamano <gitster@pobox.com>
     
      ## Documentation/config.adoc ##
     @@ Documentation/config.adoc: include::config/sequencer.adoc[]
    @@ sideband.c: void list_config_color_sideband_slots(struct string_list *list, cons
     +
      	strbuf_grow(dest, n);
      	for (; n && *src; src++, n--) {
    - 		if (!iscntrl(*src) || *src == '\t' || *src == '\n')
    + 		if (!iscntrl(*src) || *src == '\t' || *src == '\n') {
     
      ## t/t5409-colorize-remote-messages.sh ##
     @@ t/t5409-colorize-remote-messages.sh: test_expect_success 'disallow (color) control sequences in sideband' '
      	EOF
    - 	test_config_global uploadPack.packObjectshook ./color-me-surprised &&
    + 	test_config_global uploadPack.packObjectsHook ./color-me-surprised &&
      	test_commit need-at-least-one-commit &&
     +
      	git clone --no-local . throw-away 2>stderr &&

Skipped: 04bbc33 (sideband: do allow ANSI color sequences by default, 2024-11-18)

Upstream equivalent: 12f0fda (sideband: do allow ANSI color sequences by default, 2026-03-05)

Range-diff
  • 1: 04bbc33 ! 1: 12f0fda sideband: do allow ANSI color sequences by default

    @@ Commit message
         to the terminal, and `sideband.allowControlCharacters` to override that
         behavior.
     
    -    However, some `pre-receive` hooks that are actively used in practice
    -    want to color their messages and therefore rely on the fact that Git
    -    passes them through to the terminal.
    +    However, as reported by brian m. carlson, some `pre-receive` hooks that
    +    are actively used in practice want to color their messages and therefore
    +    rely on the fact that Git passes them through to the terminal, even
    +    though they have no way to determine whether the receiving side can
    +    actually handle Escape sequences (think e.g. about the practice
    +    recommended by Git that third-party applications wishing to use Git
    +    functionality parse the output of Git commands).
     
         In contrast to other ANSI escape sequences, it is highly unlikely that
         coloring sequences can be essential tools in attack vectors that mislead
         Git users e.g. by hiding crucial information.
     
         Therefore we can have both: Continue to allow ANSI coloring sequences to
    -    be passed to the terminal, and neutralize all other ANSI escape
    -    sequences.
    +    be passed to the terminal by default, and neutralize all other ANSI
    +    Escape sequences.
     
         Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
    +    Signed-off-by: Junio C Hamano <gitster@pobox.com>
     
      ## Documentation/config/sideband.adoc ##
     @@
    @@ Documentation/config/sideband.adoc
     +	this config setting to override this behavior:
     ++
     +--
    -+	color::
    ++	`default`::
    ++	`color`::
     +		Allow ANSI color sequences, line feeds and horizontal tabs,
     +		but mask all other control characters. This is the default.
    -+	false::
    ++	`false`::
     +		Mask all control characters other than line feeds and
     +		horizontal tabs.
    -+	true::
    ++	`true`::
     +		Allow all control characters to be sent to the terminal.
     +--
     
    @@ sideband.c: static struct keyword_entry keywords[] = {
      
     -static int allow_control_characters;
     +static enum {
    -+	ALLOW_NO_CONTROL_CHARACTERS = 0,
    -+	ALLOW_ALL_CONTROL_CHARACTERS = 1,
    -+	ALLOW_ANSI_COLOR_SEQUENCES = 2
    ++	ALLOW_NO_CONTROL_CHARACTERS  = 0,
    ++	ALLOW_ANSI_COLOR_SEQUENCES   = 1<<0,
    ++	ALLOW_DEFAULT_ANSI_SEQUENCES = ALLOW_ANSI_COLOR_SEQUENCES,
    ++	ALLOW_ALL_CONTROL_CHARACTERS = 1<<1,
     +} allow_control_characters = ALLOW_ANSI_COLOR_SEQUENCES;
      
      /* Returns a color setting (GIT_COLOR_NEVER, etc). */
    @@ sideband.c: static enum git_colorbool use_sideband_colors(void)
     +		if (repo_config_get_string_tmp(the_repository, "sideband.allowcontrolcharacters",
     +					      &value))
     +			; /* huh? `get_maybe_bool()` returned -1 */
    ++		else if (!strcmp(value, "default"))
    ++			allow_control_characters = ALLOW_DEFAULT_ANSI_SEQUENCES;
     +		else if (!strcmp(value, "color"))
     +			allow_control_characters = ALLOW_ANSI_COLOR_SEQUENCES;
     +		else
    @@ sideband.c: void list_config_color_sideband_slots(struct string_list *list, cons
     +	 * Valid ANSI color sequences are of the form
     +	 *
     +	 * ESC [ [<n> [; <n>]*] m
    ++	 *
    ++	 * These are part of the Select Graphic Rendition sequences which
    ++	 * contain more than just color sequences, for more details see
    ++	 * https://en.wikipedia.org/wiki/ANSI_escape_code#SGR.
     +	 */
     +
     +	if (allow_control_characters != ALLOW_ANSI_COLOR_SEQUENCES ||
    @@ sideband.c: void list_config_color_sideband_slots(struct string_list *list, cons
      	}
     @@ sideband.c: static void strbuf_add_sanitized(struct strbuf *dest, const char *src, int n)
      	for (; n && *src; src++, n--) {
    - 		if (!iscntrl(*src) || *src == '\t' || *src == '\n')
    + 		if (!iscntrl(*src) || *src == '\t' || *src == '\n') {
      			strbuf_addch(dest, *src);
    --		else {
    -+		else if ((i = handle_ansi_color_sequence(dest, src, n))) {
    ++		} else if ((i = handle_ansi_color_sequence(dest, src, n))) {
     +			src += i;
     +			n -= i;
    -+		} else {
    + 		} else {
      			strbuf_addch(dest, '^');
    - 			strbuf_addch(dest, 0x40 + *src);
    - 		}
    + 			strbuf_addch(dest, *src == 0x7f ? '?' : 0x40 + *src);
     
      ## t/t5409-colorize-remote-messages.sh ##
     @@ t/t5409-colorize-remote-messages.sh: test_expect_success 'fallback to color.ui' '
    @@ t/t5409-colorize-remote-messages.sh: test_expect_success 'fallback to color.ui'
     +	printf "error: Have you \\033[31mread\\033[m this?\\a\\n" >&2
      	exec "$@"
      	EOF
    - 	test_config_global uploadPack.packObjectshook ./color-me-surprised &&
    + 	test_config_global uploadPack.packObjectsHook ./color-me-surprised &&
     @@ t/t5409-colorize-remote-messages.sh: test_expect_success 'disallow (color) control sequences in sideband' '
      
      	git clone --no-local . throw-away 2>stderr &&

To: 033059e593 (cmake: use writev(3p) wrapper as needed, 2026-04-02) (006abb4b5d..033059e593)

Statistics

Metric Count
Total conflicts 3
Skipped (upstreamed) 3
Resolved surgically 0
Range-diff (click to expand)
  • 1: 5af5a79 = 1: a52cb26 unix-socket: avoid leak when initialization fails

  • 2: e0b356f = 2: 073653f grep: prevent ^$ false match at end of file

  • 3: 654cf29 = 3: a067ccc Merge branch 'fixes-from-the-git-mailing-list'

  • 4: 27b11b2 = 4: ce0d052 t9350: point out that refs are not updated correctly

  • 5: 08ffb04 = 5: 25044e0 transport-helper: add trailing --

  • 6: d9bdf3a = 6: bdb8d8d remote-helper: check helper status after import/export

  • 7: efaf1a9 = 7: d972eec Always auto-gc after calling a fast-import transport

  • 40: a416498 = 8: ffc5504 mingw: prevent regressions with "drive-less" absolute paths

  • 8: bf98a4d = 9: edd78a2 vcpkg_install: detect lack of Git

  • 9: 84cd43c = 10: 31d542c vcpkg_install: add comment regarding slow network connections

  • 10: f692063 = 11: 23e953c vcbuild: install ARM64 dependencies when building ARM64 binaries

  • 11: 2201319 = 12: 08bf08e vcbuild: add an option to install individual 'features'

  • 12: b546fee = 13: 92001df cmake: allow building for Windows/ARM64

  • 13: 84ab32f = 14: 15ff6e3 mingw: include the Python parts in the build

  • 14: 30c57dd = 15: e6fb4fe ci(vs-build) also build Windows/ARM64 artifacts

  • 15: 7ccc892 = 16: 20cedb1 win32/pthread: avoid name clashes with winpthread

  • 16: 4d773a8 = 17: 7ef0ae1 Add schannel to curl installation

  • 17: c06aef2 = 18: ffbeb4d hash-object: demonstrate a >4GB/LLP64 problem

  • 18: e88d348 = 19: a35fc8b git-compat-util: avoid redeclaring _DEFAULT_SOURCE

  • 19: 78b9596 = 20: 50c01df cmake(): allow setting HOST_CPU for cross-compilation

  • 20: a42b5f3 ! 21: e9ef39a object-file.c: use size_t for header lengths

    @@ object-file.c: int odb_source_loose_write_stream(struct odb_source *source,
     -				  const void *buf, unsigned long len,
     +				  const void *buf, size_t len,
      				  enum object_type type, struct object_id *oid,
    - 				  struct object_id *compat_oid_in, unsigned flags)
    - {
    + 				  struct object_id *compat_oid_in,
    + 				  enum odb_write_object_flags flags)
     @@ object-file.c: int odb_source_loose_write_object(struct odb_source *source,
      	const struct git_hash_algo *compat = source->odb->repo->compat_hash_algo;
      	struct object_id compat_oid;
    @@ object-file.h: int odb_source_loose_freshen_object(struct odb_source *source,
     -				  const void *buf, unsigned long len,
     +				  const void *buf, size_t len,
      				  enum object_type type, struct object_id *oid,
    - 				  struct object_id *compat_oid_in, unsigned flags);
    - 
    + 				  struct object_id *compat_oid_in,
    + 				  enum odb_write_object_flags flags);
     @@ object-file.h: int finalize_object_file_flags(struct repository *repo,
      			       enum finalize_object_file_flags flags);
      
  • 21: 2048d2d = 22: 617178c Import the source code of mimalloc v2.2.7

  • 22: bd3afee = 23: 278daf6 CMake: default Visual Studio generator has changed

  • 23: 561e5a7 = 24: 8b83053 hash algorithms: use size_t for section lengths

  • 24: f01a714 = 25: a0f1a15 mimalloc: adjust for building inside Git

  • 25: b11a8af = 26: 9d0c65b mingw: demonstrate a git add issue with NTFS junctions

  • 26: 80c5094 = 27: f84e298 .gitignore: add Visual Studio CMakeSetting.json file

  • 27: ae094c0 = 28: 22083a7 hash-object --stdin: verify that it works with >4GB/LLP64

  • 28: a64b3b4 = 29: 9678923 mimalloc: offer a build-time option to enable it

  • 29: 698849d = 30: 7073539 t5505/t5516: allow running without .git/branches/ in the templates

  • 30: 094df05 = 31: 4321b05 clean: do not traverse mount points

  • 31: 242acd9 = 32: 2f856ab strbuf_realpath(): use platform-dependent API if available

  • 32: ca93df5 = 33: 5442a4e http: use new "best effort" strategy for Secure Channel revoke checking

  • 33: 7111a41 = 34: 991a1c0 subtree: update contrib/subtree test target

  • 34: 9181dd7 = 35: e3255ca CMakeLists: add default "x64-windows" arch for Visual Studio

  • 35: 64d72f6 = 36: a1645bd hash-object: add another >4GB/LLP64 test case

  • 36: 3d7f4af = 37: 06c0461 setup: properly use "%(prefix)/" when in WSL

  • 37: 8a94ca1 = 38: 1cfdd34 Add config option windows.appendAtomically

  • 38: 9b7edcf = 39: f5f2eaa mingw: use mimalloc

  • 39: 9a81fd6 = 40: 787134d t5505/t5516: fix white-space around redirectors

  • 41: 0961155 = 41: 7de7592 clean: remove mount points when possible

  • 42: 81eca14 = 42: f0cef2b transport: optionally disable side-band-64k

  • 43: 181add1 = 43: a7f7704 mingw: fix fatal error working on mapped network drives on Windows

  • 44: cbb5187 = 44: 18eed22 clink.pl: fix MSVC compile script to handle libcurl-d.lib

  • 45: edd7feb = 45: 61fb152 mingw: implement a platform-specific strbuf_realpath()

  • 46: b82ec21 = 46: ef182dc t3701: verify that we can add lots of files interactively

  • 47: 0b6a515 = 47: 582dbe7 commit: accept "scissors" with CR/LF line endings

  • 48: 41f60d2 = 48: 9e6782f t0014: fix indentation

  • 49: 7d93e80 = 49: c49a90d git-gui: accommodate for intent-to-add files

  • 50: 90388e9 = 50: c4a621e mingw: allow for longer paths in parse_interpreter()

  • 51: fd67664 = 51: 9f3d842 compat/vcbuild: document preferred way to build in Visual Studio

  • 52: 76f1cd7 = 52: 51e8302 http: optionally send SSL client certificate

  • 53: a63b664 = 53: b314003 ci: run contrib/subtree tests in CI builds

  • 54: 9a027ae = 54: 75a8061 CMake: show Win32 and Generator_platform build-option values

  • 55: 57e15f3 = 55: bde3a34 hash-object: add a >4GB/LLP64 test case using filtered input

  • 56: 9d1234d = 56: ccb1ee4 compat/mingw.c: do not warn when failing to get owner

  • 57: 2f01b61 = 57: a15666b mingw: $env:TERM="xterm-256color" for newer OSes

  • 58: 348277a = 58: cc58ab1 winansi: check result and Buffer before using Name

  • 59: 4f1928b = 59: 5c5e039 mingw: change core.fsyncObjectFiles = 1 by default

  • 60: 1683ab9 = 60: dd8c5ac windows: skip linking git-<command> for built-ins

  • 61: e03fe71 = 61: 11af3de mingw: stop hard-coding CC = gcc

  • 62: 043e778 = 62: b125cb6 mingw: drop the -D_USE_32BIT_TIME_T option

  • 63: 5f7f8d7 = 63: 2cb42d2 mingw: only use -Wl,--large-address-aware for 32-bit builds

  • 64: b24ef67 = 64: 6d849b0 mingw: avoid over-specifying --pic-executable

  • 65: 46ca7f0 = 65: 3662a1a mingw: set the prefix and HOST_CPU as per MSYS2's settings

  • 66: 8b13dba = 66: f184ce5 mingw: only enable the MSYS2-specific stuff when compiling in MSYS2

  • 67: 266fce0 = 67: c4ee83f mingw: rely on MSYS2's metadata instead of hard-coding it

  • 68: 1472c86 = 68: c6e006c mingw: always define ETC_* for MSYS2 environments

  • 69: d02469c = 69: 13462bb max_tree_depth: lower it for clang builds in general on Windows

  • 70: de51a7a = 70: 605b52d mingw: ensure valid CTYPE

  • 71: 22f17ca = 71: 9d93c3d ci: work around a problem with HTTP/2 vs libcurl v8.10.0

  • 72: bc75f75 = 72: 6547349 mingw: allow git.exe to be used instead of the "Git wrapper"

  • 73: 3be9531 = 73: be8044d revision: create mark_trees_uninteresting_dense()

  • 74: f52a420 = 74: 5507c73 mingw: ignore HOMEDRIVE/HOMEPATH if it points to Windows' system directory

  • 75: d789bc8 ! 75: ba89572 survey: stub in new experimental 'git-survey' command

    @@ builtin/survey.c (new)
     +
     +#include "builtin.h"
     +#include "config.h"
    ++#include "environment.h"
     +#include "parse-options.h"
     +
     +static const char * const survey_usage[] = {
  • 76: 65f4109 = 76: 49394d7 Merge branch 'dscho-avoid-d-f-conflict-in-vs-master'

  • 77: d1832d2 ! 77: 08789f5 survey: add command line opts to select references

    @@ Documentation/git-survey.adoc: As repositories grow to "monorepo" size, certain
     
      ## builtin/survey.c ##
     @@
    - 
      #include "builtin.h"
      #include "config.h"
    + #include "environment.h"
     +#include "object.h"
     +#include "odb.h"
      #include "parse-options.h"
  • 78: fd56d43 = 78: e8eb2ee clink.pl: fix libexpatd.lib link error when using MSVC

  • 79: 1e17c27 = 79: ee19114 survey: start pretty printing data in table form

  • 80: 0fff258 = 80: a66e23b Makefile: clean up .ilk files when MSVC=1

  • 81: 0b93f93 ! 81: c914fcd survey: add object count summary

    @@ Documentation/git-survey.adoc: The references summary includes a count of each k
     
      ## builtin/survey.c ##
     @@
    - 
      #include "builtin.h"
      #include "config.h"
    -+#include "environment.h"
    + #include "environment.h"
     +#include "hex.h"
      #include "object.h"
      #include "odb.h"
  • 82: 5258fae = 82: 39f30a3 vcbuild: add support for compiling Windows resource files

  • 83: 75eb9f7 = 83: 949a4b4 survey: summarize total sizes by object type

  • 84: d0269f2 = 84: 80f0545 config.mak.uname: add git.rc to MSVC builds

  • 85: c1fbba8 = 85: 1303a90 MinGW: link as terminal server aware

  • 86: 86e9a83 = 86: c7b490f survey: show progress during object walk

  • 87: 374d6ed = 87: 83a72c8 mingw: make sure errno is set correctly when socket operations fail

  • 88: 751afbc = 88: bf61fa6 clink.pl: ignore no-stack-protector arg on MSVC=1 builds

  • 89: 893f645 = 89: edfc9b2 http: optionally load libcurl lazily

  • 90: 39719c7 = 90: e3f603f survey: add ability to track prioritized lists

  • 91: 8452164 = 91: fcebbb7 compat/mingw: handle WSA errors in strerror

  • 92: d65d660 = 92: 3fd8f19 clink.pl: move default linker options for MSVC=1 builds

  • 93: ef42a5e = 93: 4fd736b http: support lazy-loading libcurl also on Windows

  • 94: c647dc1 = 94: 0566c6e survey: add report of "largest" paths

  • 95: 2ab82c8 = 95: f164908 compat/mingw: drop outdated comment

  • 96: da6ccc8 = 96: 0a5d30c cmake: install headless-git.

  • 97: b768799 = 97: 0d9b774 http: when loading libcurl lazily, allow for multiple SSL backends

  • 98: 052cc2e = 98: 188f64e survey: add --top= option and config

  • 99: 2a1771e = 99: 57efbbf t0301: actually test credential-cache on Windows

  • 100: 8f7830b = 100: 04f2de0 Fix Windows version resources

  • 101: 815a803 = 101: 15e6e03 status: fix for old-style submodules with commondir

  • 102: 2f464cf = 102: b6eb3da git.rc: include winuser.h

  • 103: fa7695b = 103: aac3afb mingw: do load libcurl dynamically by default

  • 104: 7b4b6af = 104: 00cc5f4 Add a GitHub workflow to verify that Git/Scalar work in Nano Server

  • 105: 8c5f073 = 105: d87ea4b mingw: suggest windows.appendAtomically in more cases

  • 106: 198e69f = 106: b0cd75e win32: use native ANSI sequence processing, if possible

  • 107: 79d4f46 = 107: 50b8fff common-main.c: fflush stdout buffer upon exit

  • 108: 59734f6 = 108: 00932fb t5601/t7406(mingw): do run tests with symlink support

  • 109: c561888 = 109: 13f36c7 win32: ensure that localtime_r() is declared even in i686 builds

  • 110: a399613 = 110: d6061ac Fallback to AppData if XDG_CONFIG_HOME is unset

  • 111: e0c2671 = 111: 29dcdcc run-command: be helpful with Git LFS fails on Windows 7

  • 112: 564dd68 = 112: bebb571 survey: clearly note the experimental nature in the output

  • 113: 57689ef = 113: ac0209a credential-cache: handle ECONNREFUSED gracefully

  • 114: cd48951 < -: ---------- reftable: do make sure to use custom allocators

  • -: ---------- > 114: 1d3b120 reftable: do make sure to use custom allocators

  • 115: ff1685c = 115: cecd3cd check-whitespace: avoid alerts about upstream commits

  • 116: 5a59a2b = 116: 52bc226 Merge 'remote-hg-prerequisites' into HEAD

  • 117: 78fe605 = 117: 8d8bd86 Merge branch 'drive-prefix'

  • 118: 5d48a8d = 118: 049ce7a Merge branch 'dont-clean-junctions'

  • 119: 7eccbbd = 119: 5b86109 Merge branch 'msys2-python'

  • 120: b21f4fb = 120: 81acfee Update mimalloc to v2.2.7 (Update mimalloc to v2.2.7 git#6048)

  • 121: 787982f = 121: d46ec28 Merge pull request Config option to disable side-band-64k for transport git#2375 from assarbad/reintroduce-sideband-config

  • 122: 00232c1 = 122: f4d2458 Merge pull request mingw: fix fatal error working on mapped network drives on Windows git#2488 from bmueller84/master

  • 123: e44562b = 123: 759035a Merge pull request clink.pl: fix MSVC compile script to handle libcurl-d.lib git#2501 from jeffhostetler/clink-debug-curl

  • 124: 90b90c5 = 124: 7aaed1a Merge pull request Handle git add <file> where <file> traverses an NTFS junction git#2504 from dscho/access-repo-via-junction

  • 125: a423486 = 125: 96c5759 Merge pull request Introduce and use the new "best effort" strategy for Secure Channel revoke checking git#2535 from dscho/schannel-revoke-best-effort

  • 126: cd34bad = 126: 58a4135 Merge pull request ci: avoid d/f conflict in vs/master git#2618 from dscho/avoid-d/f-conflict-in-vs/master

  • 127: 2a8b28e = 127: 8a702c6 Merge 'add-p-many-files'

  • 128: e85f46a = 128: 2e6cffa Merge pull request Rationalize line endings for scissors-cleanup git#2714 from lbonanomi/crlf-scissors

  • 129: a769b49 = 129: fb2317f Merge pull request t/t0014: fix: eliminate additional lines from trace git#2655 from jglathe/jg/t0014_trace_extra_info

  • 130: 303f47a = 130: ec5a443 Merge 'git-gui/js/intent-to-add'

  • 131: 19b5252 = 131: 7568837 Merge pull request Vcpkg Install: detect lack of working Git, and note possible vcpkg time outs git#2351 from PhilipOakley/vcpkg-tip

  • 132: ddbb032 = 132: 089dfca Merge pull request Windows arm64 support git#2915 from dennisameling/windows-arm64-support

  • 133: 7762668 = 133: 8b3dcc7 Merge pull request cmake(): allow setting HOST_CPU for cross-compilation git#3327 from dennisameling/fix-host-cpu

  • 134: 475906b = 134: 16101d0 Merge pull request mingw: allow for longer paths in parse_interpreter() git#3165 from dscho/increase-allowed-length-of-interpreter-path

  • 135: 4b1feec = 135: 739bd46 Merge pull request Let the documentation reflect that there is no vs/master anymore git#3220 from dscho/there-is-no-vs/master-anymore

  • 136: b374d2e = 136: 67960a3 Merge pull request http: Add support for enabling automatic sending of SSL client certificate git#3293 from pascalmuller/http-support-automatically-sending-client-certificate

  • 137: cd3091e = 137: ababc6c Merge pull request Add contrib/subtree test execution to CI builds git#3349 from vdye/feature/ci-subtree-tests

  • 138: 4bbe7a9 = 138: 23f42b3 Merge pull request Make Git for Windows start builds in modern Visual Studio git#3306 from PhilipOakley/vs-sln

  • 139: 9d5e10d = 139: 71fb543 Merge pull request Begin unsigned long->size_t conversion to support large files on Windows git#3533 from PhilipOakley/hashliteral_t

  • 140: 147d3eb = 140: 6dc9700 Merge pull request Various fixes around safe.directory git#3791: Various fixes around safe.directory

  • 141: 53c2d52 = 141: 0a29767 Merge pull request mingw: set $env:TERM=xterm-256color for newer OSes git#3751 from rkitover/native-term

  • 142: be013c5 = 142: 34654d0 Merge pull request winansi: check result before using Name for pty git#3875 from 1480c1/wine/detect_msys_tty

  • 143: 3d9103d = 143: f0ec1e0 Merge branch 'optionally-dont-append-atomically-on-windows'

  • 144: f4bee79 = 144: ac4aaae Merge branch 'fsync-object-files-always'

  • 145: b9da21c = 145: e2a8247 Merge pull request MinGW: link as terminal server aware git#3942 from rimrul/mingw-tsaware

  • 275: 82ca8ef ! 146: 06d59a5 Merge branch 'disallow-ntlm-auth-by-default'

    @@ Metadata
     Author: Johannes Schindelin <Johannes.Schindelin@gmx.de>
     
      ## Commit message ##
    -    Merge branch 'disallow-ntlm-auth-by-default'
    +    t5563: verify that NTLM authentication works
     
    -    This topic branch addresses the following vulnerability:
    +    Although NTLM authentication is considered weak (extending even to
    +    NTLMv2, which purportedly allows brute-forcing reasonably complex
    +    8-character passwords in a matter of days, given ample compute
    +    resources), it _is_ one of the authentication methods supported by
    +    libcurl.
     
    -    - **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.
    -      (https://github.com/git-for-windows/git/security/advisories/GHSA-hv9c-4jm9-jh3x)
    +    Note: The added test case *cannot* reuse the existing `custom_auth`
    +    facility. The reason is that that facility is backed by an NPH script
    +    ("No Parse Headers"), which does not allow handling the 3-phase NTLM
    +    authentication correctly (in my hands, the NPH script would not even be
    +    called upon the Type 3 message, a "200 OK" would be returned, but no
    +    headers, let alone the `git http-backend` output as payload). Having a
    +    separate NTLM authentication script makes the exact workings clearer and
    +    more readable, anyway.
     
    +    Co-authored-by: Matthew John Cheetham <mjcheetham@outlook.com>
         Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
     
    - ## Documentation/config/http.adoc ##
    -@@ Documentation/config/http.adoc: http.sslKeyType::
    - 	See also libcurl `CURLOPT_SSLKEYTYPE`. Can be overridden by the
    - 	`GIT_SSL_KEY_TYPE` environment variable.
    - 
    -+http.allowNTLMAuth::
    -+	Whether or not to allow NTLM authentication. While very convenient to set
    -+	up, and therefore still used in many on-prem scenarios, NTLM is a weak
    -+	authentication method and therefore deprecated. Defaults to "false".
    -+
    - http.schannelCheckRevoke::
    - 	Used to enforce or disable certificate revocation checks in cURL
    - 	when http.sslBackend is set to "schannel" via "true" and "false",
    -
    - ## credential.c ##
    -@@ credential.c: int credential_read(struct credential *c, FILE *fp,
    - 				credential_set_capability(&c->capa_authtype, op_type);
    - 			else if (!strcmp(value, "state"))
    - 				credential_set_capability(&c->capa_state, op_type);
    -+		} else if (!strcmp(key, "ntlm")) {
    -+			if (!strcmp(value, "allow"))
    -+				c->ntlm_allow = 1;
    - 		} else if (!strcmp(key, "continue")) {
    - 			c->multistage = !!git_config_bool("continue", value);
    - 		} else if (!strcmp(key, "password_expiry_utc")) {
    -@@ credential.c: void credential_write(const struct credential *c, FILE *fp,
    - 		if (c->ephemeral)
    - 			credential_write_item(c, fp, "ephemeral", "1", 0);
    - 	}
    -+	if (c->ntlm_suppressed)
    -+		credential_write_item(c, fp, "ntlm", "suppressed", 0);
    - 	credential_write_item(c, fp, "protocol", c->protocol, 1);
    - 	credential_write_item(c, fp, "host", c->host, 1);
    - 	credential_write_item(c, fp, "path", c->path, 0);
    -
    - ## credential.h ##
    -@@ credential.h: struct credential {
    - 	struct credential_capability capa_authtype;
    - 	struct credential_capability capa_state;
    - 
    -+	unsigned ntlm_suppressed:1,
    -+		 ntlm_allow:1;
    -+
    - 	char *username;
    - 	char *password;
    - 	char *credential;
    -
    - ## http.c ##
    -@@ http.c: enum http_follow_config http_follow_config = HTTP_FOLLOW_INITIAL;
    - 
    - static struct credential cert_auth = CREDENTIAL_INIT;
    - static int ssl_cert_password_required;
    --static unsigned long http_auth_methods = CURLAUTH_ANY;
    -+static unsigned long http_auth_any = CURLAUTH_ANY & ~CURLAUTH_NTLM;
    -+static unsigned long http_auth_methods;
    - static int http_auth_methods_restricted;
    - /* Modes for which empty_auth cannot actually help us. */
    - static unsigned long empty_auth_useless =
    -@@ http.c: static int http_options(const char *var, const char *value,
    - 		return 0;
    - 	}
    - 
    -+	if (!strcmp("http.allowntlmauth", var)) {
    -+		if (git_config_bool(var, value)) {
    -+			http_auth_any |= CURLAUTH_NTLM;
    -+		} else {
    -+			http_auth_any &= ~CURLAUTH_NTLM;
    -+		}
    -+		return 0;
    -+	}
    -+
    - 	if (!strcmp("http.schannelcheckrevoke", var)) {
    - 		if (value && !strcmp(value, "best-effort")) {
    - 			http_schannel_check_revoke_mode =
    -@@ http.c: static void init_curl_http_auth(CURL *result)
    - 
    - 	credential_fill(the_repository, &http_auth, 1);
    - 
    -+	if (http_auth.ntlm_allow && !(http_auth_methods & CURLAUTH_NTLM)) {
    -+		http_auth_methods |= CURLAUTH_NTLM;
    -+		curl_easy_setopt(result, CURLOPT_HTTPAUTH, http_auth_methods);
    -+	}
    -+
    - 	if (http_auth.password) {
    - 		if (always_auth_proactively()) {
    - 			/*
    -@@ http.c: static void init_curl_proxy_auth(CURL *result)
    - 		if (i == ARRAY_SIZE(proxy_authmethods)) {
    - 			warning("unsupported proxy authentication method %s: using anyauth",
    - 					http_proxy_authmethod);
    --			curl_easy_setopt(result, CURLOPT_PROXYAUTH, CURLAUTH_ANY);
    -+			curl_easy_setopt(result, CURLOPT_PROXYAUTH, http_auth_any);
    - 		}
    - 	}
    - 	else
    --		curl_easy_setopt(result, CURLOPT_PROXYAUTH, CURLAUTH_ANY);
    -+		curl_easy_setopt(result, CURLOPT_PROXYAUTH, http_auth_any);
    - }
    - 
    - static int has_cert_password(void)
    -@@ http.c: static CURL *get_curl_handle(void)
    -     }
    - 
    - 	curl_easy_setopt(result, CURLOPT_NETRC, CURL_NETRC_OPTIONAL);
    --	curl_easy_setopt(result, CURLOPT_HTTPAUTH, CURLAUTH_ANY);
    -+	curl_easy_setopt(result, CURLOPT_HTTPAUTH, http_auth_any);
    - 
    - #ifdef CURLGSSAPI_DELEGATION_FLAG
    - 	if (curl_deleg) {
    -@@ http.c: void http_init(struct remote *remote, const char *url, int proactive_auth)
    - 	set_long_from_env(&http_max_retries, "GIT_HTTP_MAX_RETRIES");
    - 	set_long_from_env(&http_max_retry_time, "GIT_HTTP_MAX_RETRY_TIME");
    - 
    -+	http_auth_methods = http_auth_any;
    -+
    - 	curl_default = get_curl_handle();
    - }
    - 
    -@@ http.c: static int handle_curl_result(struct slot_results *results)
    - 	} else if (missing_target(results))
    - 		return HTTP_MISSING_TARGET;
    - 	else if (results->http_code == 401) {
    -+		http_auth.ntlm_suppressed = (results->auth_avail & CURLAUTH_NTLM) &&
    -+					    !(http_auth_any & CURLAUTH_NTLM);
    -+		if (http_auth.ntlm_suppressed && http_auth.ntlm_allow) {
    -+			http_auth_methods |= CURLAUTH_NTLM;
    -+			return HTTP_REAUTH;
    -+		}
    - 		if ((http_auth.username && http_auth.password) ||\
    - 		    (http_auth.authtype && http_auth.credential)) {
    - 			if (http_auth.multistage) {
    -@@ http.c: static int handle_curl_result(struct slot_results *results)
    - 			credential_reject(the_repository, &http_auth);
    - 			if (always_auth_proactively())
    - 				http_proactive_auth = PROACTIVE_AUTH_NONE;
    -+			if (http_auth.ntlm_suppressed) {
    -+				warning(_("Due to its cryptographic weaknesses, "
    -+					  "NTLM authentication has been

"
-+ "disabled in Git by default. You can "
-+ "re-enable it for trusted servers
"
-+ "by running:

"
-+ "git config set "
-+ "http.%s://%s.allowNTLMAuth true"),
-+ http_auth.protocol, http_auth.host);
-+ }

  •    	return HTTP_NOAUTH;
    
  •    } else {
    
  •    	http_auth_methods &= ~CURLAUTH_GSSNEGOTIATE;
    
  • t/lib-httpd.sh

@@ t/lib-httpd.sh: prepare_httpd() {
 	install_script apply-one-time-script.sh

@@ t/t5563-simple-http-auth.sh: test_expect_success 'access using three-legged auth
+ EOF
+
+ test_config_global credential.helper test-helper &&
-+ test_must_fail env GIT_TRACE_CURL=1 git
-+ ls-remote "$HTTPD_URL/ntlm_auth/repo.git" 2>err &&
-+ test_grep "allowNTLMAuth" err &&
-+
-+ # Can be enabled via config
-+ GIT_TRACE_CURL=1 git -c http.$HTTPD_URL.allowNTLMAuth=true
-+ ls-remote "$HTTPD_URL/ntlm_auth/repo.git" &&
-+
-+ # Or via credential helper responding with ntlm=allow
-+ set_credential_reply get <<-EOF &&
-+ username=user
-+ password=pwd
-+ ntlm=allow
-+ EOF
-+
++ GIT_TRACE_CURL=1
+ git ls-remote "$HTTPD_URL/ntlm_auth/repo.git"
+'
+


* 146:  603bebcc90 = 147:  741dd4be5a Fix Windows version resources (#4092)
* -:  ---------- > 148:  408d7ffce6 http: disallow NTLM authentication by default
* 148:  fbb487ec93 = 149:  39cda8b347 Fix global repository field not being cleared (#4083)
* -:  ---------- > 150:  9916a29fa1 http: warn if might have failed because of NTLM
* 149:  9af4d3df63 = 151:  b86a397c6e Skip linking the "dashed" `git-<command>`s for built-ins (#4252)
* 147:  6cdb11b793 = 152:  037eb837e0 t/t5571-prep-push-hook.sh: Add test with writing to stderr
* -:  ---------- > 153:  bbb1f288ac credential: advertise NTLM suppression and allow helpers to re-enable
* -:  ---------- > 154:  a95adaf8a3 mingw: use strftime() directly in UCRT builds
* 281:  2729daa14b = 155:  dd17636376 dir: do not traverse mount points
* 150:  fb5c3ceff5 = 156:  2e27ecea88 Add full `mingw-w64-git` (i.e. regular MSYS2 ecosystem) support (#5971)
* 151:  da7b17b02d = 157:  2a65cf8093 Merge pull request #2506 from dscho/issue-2283
* 152:  818d2a269d = 158:  f03d2bb89d Merge pull request #2974 from derrickstolee/maintenance-and-headless
* 153:  8134873b4f = 159:  1b23b086e3 ARM64: Embed manifest properly (#4718)
* 154:  1ccdd174c6 = 160:  1c09af28fb Lazy load libcurl, allowing for an SSL/TLS backend-specific libcurl (#4410)
* 155:  78aec57b00 = 161:  df39fc0ac4 Merge branch 'nano-server'
* 156:  e8690f07ec = 162:  6f4b2bc79f Additional error checks for issuing the windows.appendAtomically warning (#4528)
* 157:  af567bc7d6 = 163:  826693abac win32: use native ANSI sequence processing, if possible (#4700)
* 158:  77bef04882 = 164:  9b6063d1cd common-main.c: fflush stdout buffer when exit (#4901)
* 159:  dc6d47b753 = 165:  12769fab6a Merge branch 'run-t5601-and-t7406-with-symlinks-on-windows-10'
* 160:  f530115cfb = 166:  82da6327ba Merge branch 'Fix-i686-build-with-GCC-v14'
* 161:  1e99d1e430 = 167:  592737d777 Merge branch 'Fallback-to-AppData-if-XDG-CONFIG-HOME-is-unset'
* 162:  c180850b5e = 168:  7f6f3e53b3 Merge branch 'run-command-be-helpful-when-Git-LFS-fails-on-Windows-7'
* 163:  4d9a1e557f = 169:  bcfa3714cf pack-objects: create new name-hash algorithm (#5157)
* 164:  bd6e6cd867 = 170:  82e30b5a7d Add path walk API and its use in 'git pack-objects' (#5171)
* 165:  de0fb3fe28 = 171:  e5297dc470 Add experimental 'git survey' builtin (#5174)
* 166:  62617452b3 = 172:  d2168d5bfa credential-cache: handle ECONNREFUSED gracefully (#5329)
* 167:  dbdb3ae7a3 = 173:  9fc8d3910c Merge branch 'reftable-vs-custom-allocators'
* 168:  0a0a9c0e44 = 174:  d689fe6880 Merge branch 'check-whitespace-only-downstream'
* 169:  678638764b = 175:  63f25dccab t/t5571-prep-push-hook.sh: Add test with writing to stderr (#6063)
* -:  ---------- > 176:  711fdf66c9 Merge branch 'disallow-ntlm-auth-by-default'
* -:  ---------- > 177:  103e1a99c7 mingw: use strftime() directly in UCRT builds (#6130)
* 282:  ec5e3b22fa = 178:  3a4e59b49b Don't traverse mount points in `remove_dir_recurse()` (#6151)
* 170:  2047e9b482 = 179:  10de23d56c Merge branch 'ready-for-upstream'
* 171:  8e9f19d6ff <   -:  ---------- git-svn: mark it as unsupported by the Git for Windows project
* 172:  65255f9d4a = 180:  52beb1cc1f ci(macos): skip the `git p4` tests
* 173:  50af84df11 <   -:  ---------- git-svn: mark it as unsupported by the Git for Windows project (#5923)
* 174:  f9392df8bd = 181:  efe45a016c ci(macos): skip the `git p4` tests (#5954)
* 177:  48c74c5b8d = 182:  2e8ff20b32 Win32: make FILETIME conversion functions public
* 179:  5a06e6bd99 = 183:  8baf1a2f0b Win32: dirent.c: Move opendir down
* 180:  671a824550 = 184:  42ea5e98d3 mingw: make the dirent implementation pluggable
* 181:  586e6f7981 = 185:  03ab186707 Win32: make the lstat implementation pluggable
* 182:  b290371ef5 = 186:  8fcbd0c6ea mingw: add infrastructure for read-only file system level caches
* 175:  d7a84acf86 = 187:  df4f39c87b git-gui--askyesno: fix funny text wrapping
* 183:  867ffc8536 ! 188:  5e3807c9f9 mingw: add a cache below mingw's lstat and dirent implementations

``````diff
@@ compat/win32/fscache.c (new)
 +
 +	fse = fsentry_alloc(list, buf, len);
 +
-+	fse->st_mode = file_attr_to_st_mode(fdata->FileAttributes,
-+					    fdata->EaSize);
++	fse->st_mode = file_attr_to_st_mode(fdata->dwFileAttributes,
++					    IO_REPARSE_TAG_SYMLINK);
 +	fse->dirent.d_type = S_ISREG(fse->st_mode) ? DT_REG :
 +			S_ISDIR(fse->st_mode) ? DT_DIR : DT_LNK;
 +	fse->u.s.st_size = (((off64_t) (fdata->nFileSizeHigh)) << 32)
@@ compat/win32/fscache.c (new)
 +	 * provide us with the length of the target path.
 +	 */
 +	if (fse->u.s.st_size == MAX_PATH && S_ISLNK(fse->st_mode)) {
-+		char buf[MAX_LONG_PATH];
++		char buf[MAX_PATH];
 +		int len = readlink(filename, buf, sizeof(buf) - 1);
 +
 +		if (len > 0)
  • 176: e43cac0 = 189: 7e95134 git-gui--askyesno (mingw): use Git for Windows' icon, if available

  • 184: cbabc2b = 190: 79e9bb6 fscache: load directories only once

  • 178: 2f22244 = 191: b909f92 Merge branch 'git-gui-askyesno'

  • 185: 1519178 = 192: 3e70f73 fscache: add key for GIT_TRACE_FSCACHE

  • 186: cdf4a98 = 193: 9fb38f2 fscache: remember not-found directories

  • 187: e077147 = 194: 2d61b89 fscache: add a test for the dir-not-found optimization

  • 188: 840b13d = 195: 7f39452 add: use preload-index and fscache for performance

  • 189: f4f0bfd ! 196: 8983610 dir.c: make add_excludes aware of fscache during status

    @@ dir.c: static int add_patterns(const char *fname, const char *base, int baselen,
     +	 * We do want to keep the conditional block for the sake of Windows,
     +	 * though, so let's use the `NOT_CONSTANT()` trick to suppress that error.
     +	 */
    -+	if (NOT_CONSTANT(is_fscache_enabled(fname))) {
    ++	if (NOT_CONSTANT(is_fscache_enabled())) {
     +		if (lstat(fname, &st) < 0) {
     +			fd = -1;
     +		} else {
  • 190: 64bdd76 ! 197: 7b836a4 fscache: make fscache_enabled() public

    @@ compat/win32/fscache.h
      DIR *fscache_opendir(const char *dir);
      int fscache_lstat(const char *file_name, struct stat *buf);
     
    + ## dir.c ##
    +@@ dir.c: static int add_patterns(const char *fname, const char *base, int baselen,
    + 	 * We do want to keep the conditional block for the sake of Windows,
    + 	 * though, so let's use the `NOT_CONSTANT()` trick to suppress that error.
    + 	 */
    +-	if (NOT_CONSTANT(is_fscache_enabled())) {
    ++	if (NOT_CONSTANT(is_fscache_enabled(fname))) {
    + 		if (lstat(fname, &st) < 0) {
    + 			fd = -1;
    + 		} else {
    +
      ## git-compat-util.h ##
     @@ git-compat-util.h: static inline int is_missing_file_error(int errno_)
      #endif
  • 191: 3d5db11 = 198: 25d2171 dir.c: regression fix for add_excludes with fscache

  • 192: 0c8cb47 = 199: 6d2a58b fetch-pack.c: enable fscache for stats under .git/objects

  • 193: 71239d8 = 200: c0c2694 checkout.c: enable fscache for checkout again

  • 194: 21c420e = 201: 995c677 Enable the filesystem cache (fscache) in refresh_index().

  • 195: bd9b14d = 202: 6f7fdb4 fscache: use FindFirstFileExW to avoid retrieving the short name

  • 196: 6830084 = 203: c83acbf fscache: add GIT_TEST_FSCACHE support

  • 197: faf876f = 204: 7728520 fscache: add fscache hit statistics

  • 198: 31911a1 ! 205: 9cd774a unpack-trees: enable fscache for sparse-checkout

    @@ unpack-trees.c: static void mark_new_skip_worktree(struct pattern_list *pl,
      	 */
     +	enable_fscache(istate->cache_nr);
      	clear_ce_flags(istate, select_flag, skip_wt_flag, pl, show_progress);
    -+	disable_fscache();
    ++	enable_fscache(0);
      }
      
      static void populate_from_existing_patterns(struct unpack_trees_options *o,
  • 199: 6a4b498 = 206: aa35bcb status: disable and free fscache at the end of the status command

  • 200: 28c75b4 = 207: 420c7f5 mem_pool: add GIT_TRACE_MEMPOOL support

  • 201: 5789e61 ! 208: c561ea9 fscache: fscache takes an initial size

    @@ read-cache.c: int refresh_index(struct index_state *istate, unsigned int flags,
      	return has_errors;
      }
      
    +
    + ## unpack-trees.c ##
    +@@ unpack-trees.c: static void mark_new_skip_worktree(struct pattern_list *pl,
    + 	 */
    + 	enable_fscache(istate->cache_nr);
    + 	clear_ce_flags(istate, select_flag, skip_wt_flag, pl, show_progress);
    +-	enable_fscache(0);
    ++	disable_fscache();
    + }
    + 
    + static void populate_from_existing_patterns(struct unpack_trees_options *o,
  • 202: b41b930 = 209: b197750 fscache: update fscache to be thread specific instead of global

  • 203: 377e089 ! 210: a0e8e12 fscache: teach fscache to use mempool

    @@ compat/win32/fscache.c: static struct fsentry *fseentry_create_entry(struct fsen
     -	fse = fsentry_alloc(list, buf, len);
     +	fse = fsentry_alloc(cache, list, buf, len);
      
    - 	fse->st_mode = file_attr_to_st_mode(fdata->FileAttributes,
    - 					    fdata->EaSize);
    + 	fse->st_mode = file_attr_to_st_mode(fdata->dwFileAttributes,
    + 					    IO_REPARSE_TAG_SYMLINK);
     @@ compat/win32/fscache.c: static struct fsentry *fseentry_create_entry(struct fsentry *list,
       * Dir should not contain trailing '/'. Use an empty string for the current
       * directory (not "."!).
  • 204: a6e2171 = 211: a677731 fscache: make fscache_enable() thread safe

  • 205: 9d50ede ! 212: 642bdfb fscache: teach fscache to use NtQueryDirectoryFile

    @@ compat/win32/fscache.c: static void fsentry_release(struct fsentry *fse)
      
      	fse = fsentry_alloc(cache, list, buf, len);
      
    -@@ compat/win32/fscache.c: static struct fsentry *fseentry_create_entry(struct fscache *cache,
    - 					    fdata->EaSize);
    +-	fse->st_mode = file_attr_to_st_mode(fdata->dwFileAttributes,
    +-					    IO_REPARSE_TAG_SYMLINK);
    ++	fse->st_mode = file_attr_to_st_mode(fdata->FileAttributes,
    ++					    fdata->EaSize);
      	fse->dirent.d_type = S_ISREG(fse->st_mode) ? DT_REG :
      			S_ISDIR(fse->st_mode) ? DT_DIR : DT_LNK;
     -	fse->u.s.st_size = (((off64_t) (fdata->nFileSizeHigh)) << 32)
  • 206: a809d28 = 213: e4c1371 fscache: remember the reparse tag for each entry

  • 207: ebcac89 = 214: e5a78e4 Merge branch 'fscache'

  • 208: 64e2e95 = 215: c35cbe5 fscache: implement an FSCache-aware is_mount_point()

  • 209: 6ccfe1f = 216: 1dc5c10 Merge pull request status: disable and free fscache at the end of the status command git#1909 from benpeart/free-fscache-after-status-gfw

  • 210: 2094abc = 217: 9bbc049 clean: make use of FSCache

  • 211: e21ddcd = 218: 9739c61 Merge remote-tracking branch 'benpeart/fscache-per-thread-gfw'

  • 212: b0d4323 = 219: 0752f00 Merge branch 'dont-clean-junctions-fscache'

  • 213: bbd08b2 = 220: dd27ead pack-objects (mingw): demonstrate a segmentation fault with large deltas

  • 214: 92b72c0 ! 221: d9c81dc mingw: support long paths

    @@ compat/win32/fscache.c: static void fsentry_init(struct fsentry *fse, struct fse
      		    (int)len, name);
      	memcpy(fse->dirent.d_name, name, len);
     @@ compat/win32/fscache.c: static struct fsentry *fseentry_create_entry(struct fscache *cache,
    - 		fdata->EaSize : 0;
    - 
    - 	fse->st_mode = file_attr_to_st_mode(fdata->FileAttributes,
    --					    fdata->EaSize);
    -+					    fdata->EaSize, buf);
    + 					    fdata->EaSize);
      	fse->dirent.d_type = S_ISREG(fse->st_mode) ? DT_REG :
      			S_ISDIR(fse->st_mode) ? DT_DIR : DT_LNK;
     -	fse->u.s.st_size = S_ISLNK(fse->st_mode) ? MAX_PATH :
    @@ compat/win32/fscache.c: int fscache_lstat(const char *filename, struct stat *st)
      	 * provide us with the length of the target path.
      	 */
     -	if (fse->u.s.st_size == MAX_PATH && S_ISLNK(fse->st_mode)) {
    +-		char buf[MAX_PATH];
     +	if (fse->u.s.st_size == MAX_LONG_PATH && S_ISLNK(fse->st_mode)) {
    - 		char buf[MAX_LONG_PATH];
    ++		char buf[MAX_LONG_PATH];
      		int len = readlink(filename, buf, sizeof(buf) - 1);
      
    + 		if (len > 0)
     
      ## t/meson.build ##
     @@ t/meson.build: integration_tests = [
  • 215: ad9bf7f = 222: 7a81ad1 win32(long path support): leave drive-less absolute paths intact

  • 216: 18ea29c = 223: ba0d543 compat/fsmonitor/fsm-*-win32: support long paths

  • 217: e998128 = 224: c2317da clean: suggest using core.longPaths if paths are too long to remove

  • 218: 84f2510 = 225: 6326ab8 mingw: Support git_terminal_prompt with more terminals

  • 219: aff3352 = 226: e129476 compat/terminal.c: only use the Windows console if bash 'read -r' fails

  • 220: 3adfefa = 227: 9ba3717 mingw (git_terminal_prompt): do fall back to CONIN$/CONOUT$ method

  • 221: 23f54f5 = 228: 9c436b1 Win32: symlink: move phantom symlink creation to a separate function

  • 222: 82c6e08 = 229: 8feb83d Introduce helper to create symlinks that knows about index_state

  • 223: d42d8d2 = 230: a96caf0 mingw: allow to specify the symlink type in .gitattributes

  • 224: a35bfe0 = 231: c3b46c8 Win32: symlink: add test for symlink attribute

  • 225: 2378bfb = 232: 05b0f93 mingw: explicitly specify with which cmd to prefix the cmdline

  • 226: a257ed7 = 233: 724863d mingw: when path_lookup() failed, try BusyBox

  • 227: 42269b0 = 234: 2569c6a test-tool: learn to act as a drop-in replacement for iconv

  • 229: 212d5d9 = 235: c21c206 tests(mingw): if iconv is unavailable, use test-helper --iconv

  • 231: b968510 = 236: 3b08391 gitattributes: mark .png files as binary

  • 233: 09d0a7d = 237: 787b6ff tests: move test PNGs into t/lib-diff/

  • 235: f4efe1d = 238: 06ebee6 tests: only override sort & find if there are usable ones in /usr/bin/

  • 228: 58fde76 = 239: 7e9c24e mingw: introduce code to detect whether we're inside a Windows container

  • 237: 2105cd8 = 240: 77d2c51 tests: use the correct path separator with BusyBox

  • 230: 587d133 ! 241: 36f6aa3 mingw: when running in a Windows container, try to rename() harder

    @@ compat/mingw.c: int mingw_rename(const char *pold, const char *pnew)
      
     +	if (gle == ERROR_ACCESS_DENIED && is_inside_windows_container()) {
     +		/* Fall back to copy to destination & remove source */
    -+		if (CopyFileW(wpold, wpnew, FALSE) && !mingw_unlink(pold))
    ++		if (CopyFileW(wpold, wpnew, FALSE) && !mingw_unlink(pold, 1))
     +			return 0;
     +		gle = GetLastError();
     +	}
  • 238: 713ab43 = 242: 7e8b32f mingw: only use Bash-ism builtin pwd -W when available

  • 232: c0d2d43 = 243: e1fd99f mingw: move the file_attr_to_st_mode() function definition

  • 239: 5674c58 = 244: 087af7f tests (mingw): remove Bash-specific pwd option

  • 234: 5fc5e2a ! 245: d9927ed mingw: Windows Docker volumes are not symbolic links

    @@ compat/win32/fscache.c: static struct fsentry *fseentry_create_entry(struct fsca
     +	}
     +
      	fse->st_mode = file_attr_to_st_mode(fdata->FileAttributes,
    - 					    fdata->EaSize, buf);
    +-					    fdata->EaSize);
    ++					    fdata->EaSize, buf);
      	fse->dirent.d_type = S_ISREG(fse->st_mode) ? DT_REG :
    + 			S_ISDIR(fse->st_mode) ? DT_DIR : DT_LNK;
    + 	fse->u.s.st_size = S_ISLNK(fse->st_mode) ? MAX_LONG_PATH :
  • 240: db6c143 = 246: acbdfc1 test-lib: add BUSYBOX prerequisite

  • 236: 302ec1a ! 247: 48473cc mingw: work around rename() failing on a read-only file

    @@ compat/mingw.c: int mingw_rename(const char *pold, const char *pnew)
      
     -	if (gle == ERROR_ACCESS_DENIED && is_inside_windows_container()) {
     -		/* Fall back to copy to destination & remove source */
    --		if (CopyFileW(wpold, wpnew, FALSE) && !mingw_unlink(pold))
    +-		if (CopyFileW(wpold, wpnew, FALSE) && !mingw_unlink(pold, 1))
     -			return 0;
     -		gle = GetLastError();
     +	if (gle == ERROR_ACCESS_DENIED) {
  • 241: 995e994 = 248: c51e2ab Merge branch 'gitk-and-git-gui-patches'

  • 242: 08c3a65 = 249: e8edb8d t5003: use binary file from t/lib-diff/

  • 243: e53b920 = 250: f45f278 Merge branch 'long-paths'

  • 244: 57883a1 = 251: 532b468 t5532: workaround for BusyBox on Windows

  • 245: 04cb23f = 252: bc4a9e4 Merge branch 'msys2'

  • 246: e461f40 = 253: 0e8f885 t5605: special-case hardlink test for BusyBox-w32

  • 247: b9f377f = 254: 3e6b05a Merge 'docker-volumes-are-no-symlinks'

  • 248: b818603 = 255: e2e1bd7 t5813: allow for $PWD to be a Windows path

  • 249: 0b55fd9 = 256: 4e58c6c mingw: try resetting the read-only bit if rename fails (Reset READONLY if rename fails git#4527)

  • 250: 2b607b0 = 257: 8491642 t9200: skip tests when $PWD contains a colon

  • 251: dff0747 = 258: 545e5c8 Merge pull request Specify symlink type in .gitattributes git#1897 from piscisaureus/symlink-attr

  • 252: b8dd619 = 259: f33d04c Describe Git for Windows' architecture [no ci]

  • 253: b959ecc = 260: dc8225e mingw: kill child processes in a gentler way

  • 254: af4977f = 261: 1c38427 mingw: optionally enable wsl compability file mode bits

  • 255: 4584557 = 262: 1986225 Merge branch 'busybox-w32'

  • 256: d412f38 = 263: 67343ec Modify the Code of Conduct for Git for Windows

  • 257: 6bf0889 = 264: 0fa4d92 mingw: really handle SIGINT

  • 258: fe595d1 = 265: d85d0e0 Merge branch 'wsl-file-mode-bits'

  • 259: 87c73b0 = 266: a6c82af CONTRIBUTING.md: add guide for first-time contributors

  • 260: 3231d91 = 267: 212da1d Partially un-revert "editor: save and reset terminal after calling EDITOR"

  • 261: 03444ff = 268: 08f995e Merge pull request Handle Ctrl+C in Git Bash nicely git#1170 from dscho/mingw-kill-process

  • 262: 15faa19 = 269: 727961e README.md: Add a Windows-specific preamble

  • 263: f3be410 = 270: 95c669c reset: reinstate support for the deprecated --stdin option

  • 264: 42b9594 = 271: e7d2d63 Merge branch 'un-revert-editor-save-and-reset'

  • 265: 1874fbd = 272: e776a60 Add an issue template

  • 266: a4b52aa = 273: aef9001 Add a GitHub workflow to monitor component updates

  • 267: 1d88710 = 274: 1bd5c71 fsmonitor: reintroduce core.useBuiltinFSMonitor

  • 268: 6eab548 = 275: ead3914 Merge branch 'phase-out-reset-stdin'

  • 269: 6b1cc63 = 276: 4f25622 Modify the GitHub Pull Request template (to reflect Git for Windows)

  • 270: 9f1f908 = 277: d802951 dependabot: help keeping GitHub Actions versions up to date

  • 271: 5e44af5 = 278: 753f398 Merge branch 'deprecate-core.useBuiltinFSMonitor'

  • 272: 566d787 = 279: 2466b19 SECURITY.md: document Git for Windows' policies

  • 273: 7adf211 = 280: ec3a1d5 Merge pull request Start monitoring updates of Git for Windows' components in the open git#2837 from dscho/monitor-component-updates

  • 274: a33ef11 = 281: 26a55bb Merge 'readme' into HEAD

  • 276: cf17ea8 < -: ---------- http: fix bug in ntlm_allow=1 handling

  • 277: 4ac8cbd < -: ---------- http: fix bug in ntlm_allow=1 handling (http: fix bug in ntlm_allow=1 handling git#6136)

  • 278: ccebe0a < -: ---------- fixup! git-svn: mark it as unsupported by the Git for Windows project

  • 279: 54f7e79 < -: ---------- git svn: remove deprecation note (since it is no longer included in Git for Windows, anyway) (git svn: remove deprecation note (since it is no longer included in Git for Windows, anyway) git#6142)

  • 280: 54de711 < -: ---------- mingw: use strftime() directly in UCRT builds (mingw: use strftime() directly in UCRT builds git#6130)

  • -: ---------- > 282: 033059e cmake: use writev(3p) wrapper as needed

dscho and others added 30 commits April 3, 2026 13:03
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>
To verify that the `clean` side of the `clean`/`smudge` filter code is
correct with regards to LLP64 (read: to ensure that `size_t` is used
instead of `unsigned long`), here is a test case using a trivial filter,
specifically _not_ writing anything to the object store to limit the
scope of the test case.

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

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

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

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

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

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

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

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

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

This is the same heuristic used by the Cygwin runtime.

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

Running a command such as

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

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

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

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

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

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

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

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

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

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

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Start work on a new 'git survey' command to scan the repository
for monorepo performance and scaling problems.  The goal is to
measure the various known "dimensions of scale" and serve as a
foundation for adding additional measurements as we learn more
about Git monorepo scaling problems.

The initial goal is to complement the scanning and analysis performed
by the GO-based 'git-sizer' (https://github.com/github/git-sizer) tool.
It is hoped that by creating a builtin command, we may be able to take
advantage of internal Git data structures and code that is not
accessible from GO to gain further insight into potential scaling
problems.

Co-authored-by: Derrick Stolee <stolee@gmail.com>
Signed-off-by: Jeff Hostetler <git@jeffhostetler.com>
Signed-off-by: Derrick Stolee <stolee@gmail.com>
This is no longer true in general, not with supporting Clang out of the
box.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
By default we will scan all references in "refs/heads/", "refs/tags/"
and "refs/remotes/".

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

Signed-off-by: Jeff Hostetler <git@jeffhostetler.com>
Signed-off-by: Derrick Stolee <stolee@gmail.com>
Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
dscho and others added 30 commits April 3, 2026 13:03
When t5605 tries to verify that files are hardlinked (or that they are
not), it uses the `-links` option of the `find` utility.

BusyBox' implementation does not support that option, and BusyBox-w32's
lstat() does not even report the number of hard links correctly (for
performance reasons).

So let's just switch to a different method that actually works on
Windows.

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

Support windows container.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
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>
This is a companion patch of 3b9b2c2 (compat/posix: introduce
writev(3p) wrapper, 2026-03-13) where support for using the `writev()`
wrapper was introduced in the `Makefile` and the Meson-based build, but
the CMake build still needs that treatment, too.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
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.