Skip to content

Rebase shears/seen: 3 conflict(s) (1 skipped, 2 resolved) (#29117687876)#295

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

Rebase shears/seen: 3 conflict(s) (1 skipped, 2 resolved) (#29117687876)#295
gitforwindowshelper[bot] wants to merge 332 commits into
base/shears/seen-29117687876from
shears/seen-29117687876

Conversation

@gitforwindowshelper

Copy link
Copy Markdown

Workflow run

Rebase Summary: seen

From: 5d6e1b06db (Turn git survey into a deprecated shim over git repo structure (git-for-windows#6268), 2026-07-08) (555f828434..5d6e1b06db)

Skipped: 69c9254 (delta: widen create_delta() and diff_delta() to size_t, 2026-06-05)

Upstream equivalent: 6f8241e (delta: widen create_delta() and diff_delta() to size_t, 2026-07-09)

Range-diff
  • 1: 69c9254 ! 1: 6f8241e delta: widen create_delta() and diff_delta() to size_t

    @@ Metadata
     Author: Johannes Schindelin <Johannes.Schindelin@gmx.de>
     
      ## Commit message ##
    -    delta: widen create_delta() and diff_delta() to size_t
    +    delta: widen `create_delta()` and `diff_delta()` to `size_t`
     
         Last stop in the delta-encoding API widening for >4 GiB blobs on
    -    Windows: with create_delta_index() done in the prior commit and
    -    create_delta()/diff_delta() finished here, every byte count that
    -    crosses delta.h is now size_t. The struct fields they store into
    -    have been size_t since the diff-delta struct widening.
    +    Windows: with `create_delta_index()` done in the prior commit and
    +    `create_delta()`/`diff_delta()` finished here, every byte count that
    +    crosses delta.h is now `size_t`. The struct fields they store into have
    +    been `size_t` since the diff-delta struct widening.
     
    -    The API change must move with all callers in the same commit (the
    -    build only passes when every &delta_size matches the new size_t*).
    -    Caller updates are kept minimal:
    +    The API change must move with all callers in the same commit (the build
    +    only passes when every `&delta_size` matches the new `size_t*`). Caller
    +    updates are kept minimal:
     
    -      * builtin/pack-objects.c get_delta() and try_delta(): widen only
    -        the local delta_size variable; the surrounding unsigned-long
    -        locals and their cast_size_t_to_ulong() shims are out of scope
    +      * builtin/pack-objects.c `get_delta()` and `try_delta()`: widen only
    +        the local `delta_size` variable; the surrounding unsigned-long
    +        locals and their `cast_size_t_to_ulong()` shims are out of scope
             here and will be cleaned up in their own commits.
     
           * builtin/fast-import.c, diff.c, t/helper/test-pack-deltas.c:
             keep the local unsigned-long delta size (each feeds a still-
    -        unsigned-long downstream consumer: zlib's avail_in,
    -        deflate_it(), the test helper's own do_compress()), and bridge
    -        via a temporary size_t plus cast_size_t_to_ulong(). The new
    +        unsigned-long downstream consumer: zlib's `avail_in`,
    +        `deflate_it()`, the test helper's own `do_compress()`), and bridge
    +        via a temporary `size_t` plus `cast_size_t_to_ulong()`. The new
             casts are paid back in later topics that widen those consumers.
     
           * t/helper/test-delta.c: widen the local outright (no downstream
    -        consumer beyond the test's own out_size, which is already
    -        size_t).
    +        consumer beyond the test's own `out_size`, which is already
    +        `size_t`).
    +
    +    Note that GCC struggles a bit to figure out that `deltalen` is always
    +    initialized before it is used; To help it along, we initialize it to 0.
    +    This work-around will go away in a later patch series when `deltalen`
    +    can be widened to `size_t`.
     
         Assisted-by: Opus 4.7
         Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
    +    Signed-off-by: Junio C Hamano <gitster@pobox.com>
     
      ## builtin/fast-import.c ##
     @@ builtin/fast-import.c: static int store_object(
    + 	struct object_entry *e;
    + 	unsigned char hdr[96];
    + 	struct object_id oid;
    +-	unsigned long hdrlen, deltalen;
    ++	unsigned long hdrlen, deltalen = 0;
    + 	struct git_hash_ctx c;
    + 	git_zstream s;
    + 	struct repo_config_values *cfg = repo_config_values(the_repository);
    +@@ builtin/fast-import.c: static int store_object(
      
      	if (last && last->data.len && last->data.buf && last->depth < max_depth
      		&& dat->len > the_hash_algo->rawsz) {
    -+		size_t deltalen_st = 0;
    ++		size_t deltalen_st;
      
      		delta_count_attempts_by_type[type]++;
      		delta = diff_delta(last->data.buf, last->data.len,
    @@ builtin/pack-objects.c: static int try_delta(struct unpacked *trg, struct unpack
      	enum object_type type;
      	void *delta_buf;
     
    - ## lib/delta.h ##
    -@@ lib/delta.h: unsigned long sizeof_delta_index(struct delta_index *index);
    + ## delta.h ##
    +@@ delta.h: unsigned long sizeof_delta_index(struct delta_index *index);
       */
      void *
      create_delta(const struct delta_index *index,
    @@ lib/delta.h: unsigned long sizeof_delta_index(struct delta_index *index);
      
      /*
       * diff_delta: create a delta from source buffer to target buffer
    -@@ lib/delta.h: create_delta(const struct delta_index *index,
    +@@ delta.h: create_delta(const struct delta_index *index,
       * updated with its size.  The returned buffer must be freed by the caller.
       */
      static inline void *
    @@ lib/delta.h: create_delta(const struct delta_index *index,
      	struct delta_index *index = create_delta_index(src_buf, src_bufsize);
      	if (index) {
     
    - ## lib/diff-delta.c ##
    -@@ lib/diff-delta.c: unsigned long sizeof_delta_index(struct delta_index *index)
    + ## diff-delta.c ##
    +@@ diff-delta.c: unsigned long sizeof_delta_index(struct delta_index *index)
      
      void *
      create_delta(const struct delta_index *index,
    @@ lib/diff-delta.c: unsigned long sizeof_delta_index(struct delta_index *index)
      	unsigned int i, val;
      	off_t outpos, moff;
     
    - ## lib/diff.c ##
    -@@ lib/diff.c: static void emit_binary_diff_body(struct diff_options *o,
    + ## diff.c ##
    +@@ diff.c: static void emit_binary_diff_body(struct diff_options *o,
      	delta = NULL;
      	deflated = deflate_it(two->ptr, two->size, &deflate_size);
      	if (one->size && two->size) {

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

Combined upstream's = 0 initialization of deltalen with the patch's size_t type change; removed now-unnecessary deltalen_st intermediate variable

Range-diff
  • 1: ce8f09e ! 1: e637378 fast-import: drop the six size casts in the object-read paths

    @@ builtin/fast-import.c: static int store_object(
      	struct object_entry *e;
      	unsigned char hdr[96];
      	struct object_id oid;
    --	unsigned long hdrlen, deltalen;
    -+	size_t hdrlen, deltalen;
    +-	unsigned long hdrlen, deltalen = 0;
    ++	size_t hdrlen, deltalen = 0;
      	struct git_hash_ctx c;
      	git_zstream s;
      	struct repo_config_values *cfg = repo_config_values(the_repository);
    @@ builtin/fast-import.c: static int store_object(
      
      	if (last && last->data.len && last->data.buf && last->depth < max_depth
      		&& dat->len > the_hash_algo->rawsz) {
    --		size_t deltalen_st = 0;
    +-		size_t deltalen_st;
     -
      		delta_count_attempts_by_type[type]++;
      		delta = diff_delta(last->data.buf, last->data.len,

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

Resolved structural path conflicts (compat/ vs lib/compat/) by taking HEAD; applied merge's actual change removing ,!LONG_IS_64BIT prerequisite in t/t1007-hash-object.sh; removed DU files already moved to lib/

Range-diff
  • 1: aee2fc0 ! 1: 33f1c4b Some amendments for the hashliteral_t size fixes (Some amendments for the hashliteral_t size fixes git#6311)

    @@ Commit message
         to make a new Git for Windows release (to address [the
         NTLM](https://github.com/git-for-windows/git/issues/6308) issue).
     
    - ## lib/refs/reftable-backend.c ##
    -@@ lib/refs/reftable-backend.c: static struct ref_store *reftable_be_init(struct repository *repo,
    + ## .github/workflows/main.yml ##
    + remerge CONFLICT (content): Merge conflict in .github/workflows/main.yml
    + index fa0ece77f2..57ad4ba64f 100644
    + --- .github/workflows/main.yml
    + +++ .github/workflows/main.yml
    +@@ .github/workflows/main.yml: jobs:
    +       uses: microsoft/setup-msbuild@v3
    +     - name: copy dlls to root
    +       shell: cmd
    +-<<<<<<< 3dc87f9707 (build(deps): bump actions/cache from 5 to 6 (#6303))
    +       run: lib\compat\vcbuild\vcpkg_copy_dlls.bat release ${{ matrix.arch }}-windows
    +     - name: generate Visual Studio solution
    +       shell: bash
    +       run: |
    +         cmake `pwd`/contrib/buildsystems/ -DCMAKE_PREFIX_PATH=`pwd`/lib/compat/vcbuild/vcpkg/installed/${{ matrix.arch }}-windows \
    +-=======
    +-      run: compat\vcbuild\vcpkg_copy_dlls.bat release ${{ matrix.arch }}-windows
    +-    - name: generate Visual Studio solution
    +-      shell: bash
    +-      run: |
    +-        cmake `pwd`/contrib/buildsystems/ -DCMAKE_PREFIX_PATH=`pwd`/compat/vcbuild/vcpkg/installed/${{ matrix.arch }}-windows \
    +->>>>>>> c8dff95af8 (fixup! hash-object: add a >4GB/LLP64 test case using filtered input)
    +         -DNO_GETTEXT=YesPlease -DPERL_TESTS=OFF -DPYTHON_TESTS=OFF -DCURL_NO_CURL_CMAKE=ON -DCMAKE_GENERATOR_PLATFORM=${{ matrix.arch }} -DVCPKG_ARCH=${{ matrix.arch }}-windows -DHOST_CPU=${{ matrix.arch }}
    +     - name: MSBuild
    +       run: |
    +
    + ## Makefile ##
    + remerge CONFLICT (content): Merge conflict in Makefile
    + index db2e383ee4..01438d3f3d 100644
    + --- Makefile
    + +++ Makefile
    +@@ Makefile: else
    +         endif
    + 
    +         ifdef LAZYLOAD_LIBCURL
    +-<<<<<<< 3dc87f9707 (build(deps): bump actions/cache from 5 to 6 (#6303))
    + 		LAZYLOAD_LIBCURL_OBJ = lib/compat/lazyload-curl.o
    +-=======
    +-		LAZYLOAD_LIBCURL_OBJ = compat/lazyload-curl.o
    +->>>>>>> c8dff95af8 (fixup! hash-object: add a >4GB/LLP64 test case using filtered input)
    + 		OBJECTS += $(LAZYLOAD_LIBCURL_OBJ)
    + 		# The `CURL_STATICLIB` constant must be defined to avoid seeing the functions
    + 		# declared as DLL imports
    +@@ Makefile: endif
    +         endif
    +         ifdef USE_CURL_FOR_IMAP_SEND
    + 		BASIC_CFLAGS += -DUSE_CURL_FOR_IMAP_SEND
    +-<<<<<<< 3dc87f9707 (build(deps): bump actions/cache from 5 to 6 (#6303))
    + 		IMAP_SEND_BUILDDEPS = lib/http.o $(LAZYLOAD_LIBCURL_OBJ)
    +-=======
    +-		IMAP_SEND_BUILDDEPS = http.o $(LAZYLOAD_LIBCURL_OBJ)
    +->>>>>>> c8dff95af8 (fixup! hash-object: add a >4GB/LLP64 test case using filtered input)
    + 		IMAP_SEND_LDFLAGS += $(CURL_LIBCURL)
    +         endif
    +         ifndef NO_EXPAT
    +@@ Makefile: git-imap-send$X: imap-send.o $(IMAP_SEND_BUILDDEPS) GIT-LDFLAGS $(GITLIBS)
    + 	$(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \
    + 		$(IMAP_SEND_LDFLAGS) $(LIBS)
    + 
    +-<<<<<<< 3dc87f9707 (build(deps): bump actions/cache from 5 to 6 (#6303))
    + git-http-fetch$X: lib/http.o lib/http-walker.o http-fetch.o $(LAZYLOAD_LIBCURL_OBJ) GIT-LDFLAGS $(GITLIBS)
    + 	$(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \
    + 		$(CURL_LIBCURL) $(LIBS)
    + git-http-push$X: lib/http.o http-push.o $(LAZYLOAD_LIBCURL_OBJ) GIT-LDFLAGS $(GITLIBS)
    +-=======
    +-git-http-fetch$X: http.o http-walker.o http-fetch.o $(LAZYLOAD_LIBCURL_OBJ) GIT-LDFLAGS $(GITLIBS)
    +-	$(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \
    +-		$(CURL_LIBCURL) $(LIBS)
    +-git-http-push$X: http.o http-push.o $(LAZYLOAD_LIBCURL_OBJ) GIT-LDFLAGS $(GITLIBS)
    +->>>>>>> c8dff95af8 (fixup! hash-object: add a >4GB/LLP64 test case using filtered input)
    + 	$(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \
    + 		$(CURL_LIBCURL) $(EXPAT_LIBEXPAT) $(LIBS)
    + 
    +@@ Makefile: $(REMOTE_CURL_ALIASES): $(REMOTE_CURL_PRIMARY)
    + 	ln -s $< $@ 2>/dev/null || \
    + 	cp $< $@
    + 
    +-<<<<<<< 3dc87f9707 (build(deps): bump actions/cache from 5 to 6 (#6303))
    + $(REMOTE_CURL_PRIMARY): remote-curl.o lib/http.o lib/http-walker.o $(LAZYLOAD_LIBCURL_OBJ) GIT-LDFLAGS $(GITLIBS)
    +-=======
    +-$(REMOTE_CURL_PRIMARY): remote-curl.o http.o http-walker.o $(LAZYLOAD_LIBCURL_OBJ) GIT-LDFLAGS $(GITLIBS)
    +->>>>>>> c8dff95af8 (fixup! hash-object: add a >4GB/LLP64 test case using filtered input)
    + 	$(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \
    + 		$(CURL_LIBCURL) $(EXPAT_LIBEXPAT) $(LIBS)
    + 
    +
    + ## builtin/fast-import.c ##
    + remerge CONFLICT (content): Merge conflict in builtin/fast-import.c
    + index 6ae097ef0e..5edad7edf6 100644
    + --- builtin/fast-import.c
    + +++ builtin/fast-import.c
    +@@ builtin/fast-import.c: static int store_object(
    + 	struct object_entry *e;
    + 	unsigned char hdr[96];
    + 	struct object_id oid;
    +-<<<<<<< 3dc87f9707 (build(deps): bump actions/cache from 5 to 6 (#6303))
    + 	size_t hdrlen, deltalen = 0;
    +-=======
    +-	size_t hdrlen, deltalen;
    +->>>>>>> c8dff95af8 (fixup! hash-object: add a >4GB/LLP64 test case using filtered input)
    + 	struct git_hash_ctx c;
    + 	git_zstream s;
    + 	struct repo_config_values *cfg = repo_config_values(the_repository);
    +
    + ## ci/lib.sh ##
    + remerge CONFLICT (content): Merge conflict in ci/lib.sh
    + index 8d7cd00510..f31a36ceeb 100755
    + --- ci/lib.sh
    + +++ ci/lib.sh
    +@@ ci/lib.sh: export SKIP_DASHED_BUILT_INS=YesPlease
    + # In order to catch bugs introduced at integration time by mismerges,
    + # enable the long tests for pushes to the integration branches as well.
    + test -z "$MSYSTEM" ||
    +-<<<<<<< 3dc87f9707 (build(deps): bump actions/cache from 5 to 6 (#6303))
    + case "$CI_EVENT,$CI_BRANCH" in
    +-=======
    +-case "$GITHUB_EVENT_NAME,$CI_BRANCH" in
    +->>>>>>> c8dff95af8 (fixup! hash-object: add a >4GB/LLP64 test case using filtered input)
    + pull_request,*|push,*next*|push,*master*|push,*main*|push,*maint*)
    + 	export GIT_TEST_LONG=${GIT_TEST_LONG:-true}
    + 	;;
    +
    + ## compat/win32/dirent.h (deleted) ##
    + remerge CONFLICT (modify/delete): compat/win32/dirent.h deleted in 3dc87f9707 (build(deps): bump actions/cache from 5 to 6 (#6303)) and modified in c8dff95af8 (fixup! hash-object: add a >4GB/LLP64 test case using filtered input).  Version c8dff95af8 (fixup! hash-object: add a >4GB/LLP64 test case using filtered input) of compat/win32/dirent.h left in tree.
    + index a58a8075fd..0000000000
    + --- compat/win32/dirent.h
    + +++ /dev/null
    +@@
    +-#ifndef DIRENT_H
    +-#define DIRENT_H
    +-
    +-#define DT_UNKNOWN 0
    +-#define DT_DIR     1
    +-#define DT_REG     2
    +-#define DT_LNK     3
    +-
    +-struct dirent {
    +-	unsigned char d_type; /* file type to prevent lstat after readdir */
    +-	char d_name[/* FLEX_ARRAY */]; /* file name */
    +-};
    +-
    +-/*
    +- * Base DIR structure, contains pointers to readdir/closedir implementations so
    +- * that opendir may choose a concrete implementation on a call-by-call basis.
    +- */
    +-typedef struct DIR {
    +-	struct dirent *(*preaddir)(struct DIR *dir);
    +-	int (*pclosedir)(struct DIR *dir);
    +-} DIR;
    +-
    +-/* default dirent implementation */
    +-extern DIR *dirent_opendir(const char *dirname);
    +-
    +-#define opendir git_opendir
    +-
    +-/* current dirent implementation */
    +-extern DIR *(*opendir)(const char *dirname);
    +-
    +-#define readdir(dir) (dir->preaddir(dir))
    +-#define closedir(dir) (dir->pclosedir(dir))
    +-
    +-#endif /* DIRENT_H */
    +
    + ## compat/win32/path-utils.c (deleted) ##
    + remerge CONFLICT (modify/delete): compat/win32/path-utils.c deleted in 3dc87f9707 (build(deps): bump actions/cache from 5 to 6 (#6303)) and modified in c8dff95af8 (fixup! hash-object: add a >4GB/LLP64 test case using filtered input).  Version c8dff95af8 (fixup! hash-object: add a >4GB/LLP64 test case using filtered input) of compat/win32/path-utils.c left in tree.
    + index c4fea0301b..0000000000
    + --- compat/win32/path-utils.c
    + +++ /dev/null
    +@@
    +-#define USE_THE_REPOSITORY_VARIABLE
    +-
    +-#include "../../git-compat-util.h"
    +-#include "../../environment.h"
    +-#include "../../wrapper.h"
    +-#include "../../strbuf.h"
    +-#include "../../versioncmp.h"
    +-
    +-int win32_has_dos_drive_prefix(const char *path)
    +-{
    +-	int i;
    +-
    +-	/*
    +-	 * Does it start with an ASCII letter (i.e. highest bit not set),
    +-	 * followed by a colon?
    +-	 */
    +-	if (!(0x80 & (unsigned char)*path))
    +-		return *path && path[1] == ':' ? 2 : 0;
    +-
    +-	/*
    +-	 * While drive letters must be letters of the English alphabet, it is
    +-	 * possible to assign virtually _any_ Unicode character via `subst` as
    +-	 * a drive letter to "virtual drives". Even `1`, or `ä`. Or fun stuff
    +-	 * like this:
    +-	 *
    +-	 *      subst ֍: %USERPROFILE%\Desktop
    +-	 */
    +-	for (i = 1; i < 4 && (0x80 & (unsigned char)path[i]); i++)
    +-		; /* skip first UTF-8 character */
    +-	return path[i] == ':' ? i + 1 : 0;
    +-}
    +-
    +-int win32_skip_dos_drive_prefix(char **path)
    +-{
    +-	int ret = has_dos_drive_prefix(*path);
    +-	*path += ret;
    +-	return ret;
    +-}
    +-
    +-int win32_offset_1st_component(const char *path)
    +-{
    +-	char *pos = (char *)path;
    +-
    +-	/* unc paths */
    +-	if (!skip_dos_drive_prefix(&pos) &&
    +-			is_dir_sep(pos[0]) && is_dir_sep(pos[1])) {
    +-		/* skip server name */
    +-		pos = strpbrk(pos + 2, "\\/");
    +-		if (!pos)
    +-			return 0; /* Error: malformed unc path */
    +-
    +-		do {
    +-			pos++;
    +-		} while (*pos && !is_dir_sep(*pos));
    +-	}
    +-
    +-	return pos + is_dir_sep(*pos) - path;
    +-}
    +-
    +-int win32_fspathncmp(const char *a, const char *b, size_t count)
    +-{
    +-	int diff;
    +-
    +-	for (;;) {
    +-		if (!count--)
    +-			return 0;
    +-		if (!*a)
    +-			return *b ? -1 : 0;
    +-		if (!*b)
    +-			return +1;
    +-
    +-		if (is_dir_sep(*a)) {
    +-			if (!is_dir_sep(*b))
    +-				return -1;
    +-			a++;
    +-			b++;
    +-			continue;
    +-		} else if (is_dir_sep(*b))
    +-			return +1;
    +-
    +-		diff = ignore_case ?
    +-			(unsigned char)tolower(*a) - (int)(unsigned char)tolower(*b) :
    +-			(unsigned char)*a - (int)(unsigned char)*b;
    +-		if (diff)
    +-			return diff;
    +-		a++;
    +-		b++;
    +-	}
    +-}
    +-
    +-int win32_fspathcmp(const char *a, const char *b)
    +-{
    +-	return win32_fspathncmp(a, b, (size_t)-1);
    +-}
    +-
    +-static int read_at(int fd, char *buffer, size_t offset, size_t size)
    +-{
    +-	if (lseek(fd, offset, SEEK_SET) < 0) {
    +-		fprintf(stderr, "could not seek to 0x%x\n", (unsigned int)offset);
    +-		return -1;
    +-	}
    +-
    +-	return read_in_full(fd, buffer, size);
    +-}
    +-
    +-static size_t le16(const char *buffer)
    +-{
    +-	unsigned char *u = (unsigned char *)buffer;
    +-	return u[0] | (u[1] << 8);
    +-}
    +-
    +-static size_t le32(const char *buffer)
    +-{
    +-	return le16(buffer) | (le16(buffer + 2) << 16);
    +-}
    +-
    +-/*
    +- * Determine the Go version of a given executable, if it was built with Go.
    +- *
    +- * This recapitulates the logic from
    +- * https://github.com/golang/go/blob/master/src/cmd/go/internal/version/version.go
    +- * (without requiring the user to install `go.exe` to find out).
    +- */
    +-static ssize_t get_go_version(const char *path, char *go_version, size_t go_version_size)
    +-{
    +-	int fd = open(path, O_RDONLY);
    +-	char buffer[1024];
    +-	off_t offset;
    +-	size_t num_sections, opt_header_size, i;
    +-	char *p = NULL, *q;
    +-	ssize_t res = -1;
    +-
    +-	if (fd < 0)
    +-		return -1;
    +-
    +-	if (read_in_full(fd, buffer, 2) < 0)
    +-		goto fail;
    +-
    +-	/*
    +-	 * Parse the PE file format, for more details, see
    +-	 * https://en.wikipedia.org/wiki/Portable_Executable#Layout and
    +-	 * https://learn.microsoft.com/en-us/windows/win32/debug/pe-format
    +-	 */
    +-	if (buffer[0] != 'M' || buffer[1] != 'Z')
    +-		goto fail;
    +-
    +-	if (read_at(fd, buffer, 0x3c, 4) < 0)
    +-		goto fail;
    +-
    +-	/* Read the `PE\0\0` signature and the COFF file header */
    +-	offset = le32(buffer);
    +-	if (read_at(fd, buffer, offset, 24) < 0)
    +-		goto fail;
    +-
    +-	if (buffer[0] != 'P' || buffer[1] != 'E' || buffer[2] != '\0' || buffer[3] != '\0')
    +-		goto fail;
    +-
    +-	num_sections = le16(buffer + 6);
    +-	opt_header_size = le16(buffer + 20);
    +-	offset += 24; /* skip file header */
    +-
    +-	/*
    +-	 * Validate magic number 0x10b or 0x20b, for full details see
    +-	 * https://learn.microsoft.com/en-us/windows/win32/debug/pe-format#optional-header-standard-fields-image-only
    +-	 */
    +-	if (read_at(fd, buffer, offset, 2) < 0 ||
    +-	    ((i = le16(buffer)) != 0x10b && i != 0x20b))
    +-		goto fail;
    +-
    +-	offset += opt_header_size;
    +-
    +-	for (i = 0; i < num_sections; i++) {
    +-		if (read_at(fd, buffer, offset + i * 40, 40) < 0)
    +-			goto fail;
    +-
    +-		/*
    +-		 * For full details about the section headers, see
    +-		 * https://learn.microsoft.com/en-us/windows/win32/debug/pe-format#section-table-section-headers
    +-		 */
    +-		if ((le32(buffer + 36) /* characteristics */ & ~0x600000) /* IMAGE_SCN_ALIGN_32BYTES */ ==
    +-		    (/* IMAGE_SCN_CNT_INITIALIZED_DATA */ 0x00000040 |
    +-		     /* IMAGE_SCN_MEM_READ */ 0x40000000 |
    +-		     /* IMAGE_SCN_MEM_WRITE */ 0x80000000)) {
    +-			size_t size = le32(buffer + 16); /* "SizeOfRawData " */
    +-			size_t pointer = le32(buffer + 20); /* "PointerToRawData " */
    +-
    +-			/*
    +-			 * Skip the section if either size or pointer is 0, see
    +-			 * https://github.com/golang/go/blob/go1.21.0/src/debug/buildinfo/buildinfo.go#L333
    +-			 * for full details.
    +-			 *
    +-			 * Merely seeing a non-zero size will not actually do,
    +-			 * though: he size must be at least `buildInfoSize`,
    +-			 * i.e. 32, and we expect a UVarint (at least another
    +-			 * byte) _and_ the bytes representing the string,
    +-			 * which we expect to start with the letters "go" and
    +-			 * continue with the Go version number.
    +-			 */
    +-			if (size < 32 + 1 + 2 + 1 || !pointer)
    +-				continue;
    +-
    +-			p = malloc(size);
    +-
    +-			if (!p || read_at(fd, p, pointer, size) < 0)
    +-				goto fail;
    +-
    +-			/*
    +-			 * Look for the build information embedded by Go, see
    +-			 * https://github.com/golang/go/blob/go1.21.0/src/debug/buildinfo/buildinfo.go#L165-L175
    +-			 * for full details.
    +-			 *
    +-			 * Note: Go contains code to enforce alignment along a
    +-			 * 16-byte boundary. In practice, no `.exe` has been
    +-			 * observed that required any adjustment, therefore
    +-			 * this here code skips that logic for simplicity.
    +-			 */
    +-			q = memmem(p, size - 18, "\xff Go buildinf:", 14);
    +-			if (!q)
    +-				goto fail;
    +-			/*
    +-			 * Decode the build blob. For full details, see
    +-			 * https://github.com/golang/go/blob/go1.21.0/src/debug/buildinfo/buildinfo.go#L177-L191
    +-			 *
    +-			 * Note: The `endianness` values observed in practice
    +-			 * were always 2, therefore the complex logic to handle
    +-			 * any other value is skipped for simplicty.
    +-			 */
    +-			if ((q[14] == 8 || q[14] == 4) && q[15] == 2) {
    +-				/*
    +-				 * Only handle a Go version string with fewer
    +-				 * than 128 characters, so the Go UVarint at
    +-				 * q[32] that indicates the string's length must
    +-				 * be only one byte (without the high bit set).
    +-				 */
    +-				if ((q[32] & 0x80) ||
    +-				    !q[32] ||
    +-				    (q + 33 + q[32] - p) > (ssize_t)size ||
    +-				    q[32] + 1 > (ssize_t)go_version_size)
    +-					goto fail;
    +-				res = q[32];
    +-				memcpy(go_version, q + 33, res);
    +-				go_version[res] = '\0';
    +-				break;
    +-			}
    +-		}
    +-	}
    +-
    +-fail:
    +-	free(p);
    +-	close(fd);
    +-	return res;
    +-}
    +-
    +-void win32_warn_about_git_lfs_on_windows7(int exit_code, const char *argv0)
    +-{
    +-	char buffer[128], *git_lfs = NULL;
    +-	const char *p;
    +-
    +-	/*
    +-	 * Git LFS v3.5.1 fails with an Access Violation on Windows 7; That
    +-	 * would usually show up as an exit code 0xc0000005. For some reason
    +-	 * (probably because at this point, we no longer have the _original_
    +-	 * HANDLE that was returned by `CreateProcess()`) we observe other
    +-	 * values like 0xb00 and 0x2 instead. Since the exact exit code
    +-	 * seems to be inconsistent, we check for a non-zero exit status.
    +-	 */
    +-	if (exit_code == 0)
    +-		return;
    +-	if (GetVersion() >> 16 > 7601)
    +-		return; /* Warn only on Windows 7 or older */
    +-	if (!istarts_with(argv0, "git-lfs ") &&
    +-	    strcasecmp(argv0, "git-lfs"))
    +-		return;
    +-	if (!(git_lfs = locate_in_PATH("git-lfs")))
    +-		return;
    +-	if (get_go_version(git_lfs, buffer, sizeof(buffer)) > 0 &&
    +-	    skip_prefix(buffer, "go", &p) &&
    +-	    versioncmp("1.21.0", p) <= 0)
    +-		warning("This program was built with Go v%s\n"
    +-			"i.e. without support for this Windows version:\n"
    +-			"\n\t%s\n"
    +-			"\n"
    +-			"To work around this, you can download and install a "
    +-			"working version from\n"
    +-			"\n"
    +-			"\thttps://github.com/git-lfs/git-lfs/releases/tag/"
    +-			"v3.4.1\n",
    +-			p, git_lfs);
    +-	free(git_lfs);
    +-}
    +
    + ## config.mak.uname ##
    + remerge CONFLICT (content): Merge conflict in config.mak.uname
    + index 3dc89cd1b2..32cc40e3cc 100644
    + --- config.mak.uname
    + +++ config.mak.uname
    +@@ config.mak.uname: endif
    + 	CC = lib/compat/vcbuild/scripts/clink.pl
    + 	AR = lib/compat/vcbuild/scripts/lib.pl
    + 	CFLAGS =
    +-<<<<<<< 3dc87f9707 (build(deps): bump actions/cache from 5 to 6 (#6303))
    + 	BASIC_CFLAGS = -nologo -I. -Ilib/compat/vcbuild/include -DWIN32 -D_CONSOLE -DHAVE_STRING_H -D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_DEPRECATE
    + 	COMPAT_OBJS = lib/compat/msvc.o lib/compat/winansi.o \
    + 		lib/compat/win32/flush.o \
    +@@ config.mak.uname: endif
    + 	COMPAT_CFLAGS = -D__USE_MINGW_ACCESS -DDETECT_MSYS_TTY \
    + 		-DENSURE_MSYSTEM_IS_SET="\"$(MSYSTEM)\"" -DMINGW_PREFIX="\"$(patsubst /%,%,$(MINGW_PREFIX))\"" \
    + 		-DNOGDI -DHAVE_STRING_H -Ilib/compat -Ilib/compat/regex -Ilib/compat/win32 -DSTRIP_EXTENSION=\".exe\"
    +-=======
    +-	BASIC_CFLAGS = -nologo -I. -Icompat/vcbuild/include -DWIN32 -D_CONSOLE -DHAVE_STRING_H -D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_DEPRECATE
    +-	COMPAT_OBJS = compat/msvc.o compat/winansi.o \
    +-		compat/win32/flush.o \
    +-		compat/win32/path-utils.o \
    +-		compat/win32/pthread.o compat/win32/syslog.o \
    +-		compat/win32/trace2_win32_process_info.o \
    +-		compat/win32/dirent.o compat/win32/fscache.o compat/win32/wsl.o
    +-	COMPAT_CFLAGS = -D__USE_MINGW_ACCESS -DDETECT_MSYS_TTY \
    +-		-DENSURE_MSYSTEM_IS_SET="\"$(MSYSTEM)\"" -DMINGW_PREFIX="\"$(patsubst /%,%,$(MINGW_PREFIX))\"" \
    +-		-DNOGDI -DHAVE_STRING_H -Icompat -Icompat/regex -Icompat/win32 -DSTRIP_EXTENSION=\".exe\"
    +->>>>>>> c8dff95af8 (fixup! hash-object: add a >4GB/LLP64 test case using filtered input)
    + 	BASIC_LDFLAGS = -IGNORE:4217 -IGNORE:4049 -NOLOGO
    + 	# invalidcontinue.obj allows Git's source code to close the same file
    + 	# handle twice, or to access the osfhandle of an already-closed stdout
    +@@ config.mak.uname: endif
    + 	EXTLIBS = user32.lib advapi32.lib shell32.lib wininet.lib ws2_32.lib invalidcontinue.obj kernel32.lib ntdll.lib
    + 	GITLIBS += git.res
    + 	PTHREAD_LIBS =
    +-<<<<<<< 3dc87f9707 (build(deps): bump actions/cache from 5 to 6 (#6303))
    + 	RC = lib/compat/vcbuild/scripts/rc.pl
    +-=======
    +-	RC = compat/vcbuild/scripts/rc.pl
    +->>>>>>> c8dff95af8 (fixup! hash-object: add a >4GB/LLP64 test case using filtered input)
    + 	lib =
    + 	BASIC_CFLAGS += $(vcpkg_inc) $(sdk_includes) $(msvc_includes)
    + ifndef DEBUG
    +@@ config.mak.uname: ifeq ($(uname_S),MINGW)
    + 	CSPRNG_METHOD = rtlgenrandom
    + 	BASIC_LDFLAGS += -municode -Wl,--tsaware
    + 	LAZYLOAD_LIBCURL = YesDoThatPlease
    +-<<<<<<< 3dc87f9707 (build(deps): bump actions/cache from 5 to 6 (#6303))
    + 	COMPAT_CFLAGS += -DNOGDI -Ilib/compat -Ilib/compat/win32
    + 	COMPAT_CFLAGS += -DSTRIP_EXTENSION=\".exe\"
    + 	COMPAT_OBJS += lib/compat/mingw.o lib/compat/winansi.o \
    +@@ config.mak.uname: ifeq ($(uname_S),MINGW)
    + 		lib/compat/win32/path-utils.o \
    + 		lib/compat/win32/pthread.o lib/compat/win32/syslog.o \
    + 		lib/compat/win32/dirent.o lib/compat/win32/fscache.o lib/compat/win32/wsl.o
    +-=======
    +-	COMPAT_CFLAGS += -DNOGDI -Icompat -Icompat/win32
    +-	COMPAT_CFLAGS += -DSTRIP_EXTENSION=\".exe\"
    +-	COMPAT_OBJS += compat/mingw.o compat/winansi.o \
    +-		compat/win32/trace2_win32_process_info.o \
    +-		compat/win32/flush.o \
    +-		compat/win32/path-utils.o \
    +-		compat/win32/pthread.o compat/win32/syslog.o \
    +-		compat/win32/dirent.o compat/win32/fscache.o compat/win32/wsl.o
    +->>>>>>> c8dff95af8 (fixup! hash-object: add a >4GB/LLP64 test case using filtered input)
    + 	BASIC_CFLAGS += -DWIN32
    + 	EXTLIBS += -lws2_32
    + 	GITLIBS += git.res
    +
    + ## contrib/buildsystems/CMakeLists.txt ##
    + remerge CONFLICT (content): Merge conflict in contrib/buildsystems/CMakeLists.txt
    + index e60198caaf..e95bddbc82 100644
    + --- contrib/buildsystems/CMakeLists.txt
    + +++ contrib/buildsystems/CMakeLists.txt
    +@@ contrib/buildsystems/CMakeLists.txt: if(NOT DEFINED CMAKE_EXPORT_COMPILE_COMMANDS)
    + endif()
    + 
    + if(USE_VCPKG)
    +-<<<<<<< 3dc87f9707 (build(deps): bump actions/cache from 5 to 6 (#6303))
    + 	set(VCPKG_DIR "${CMAKE_SOURCE_DIR}/lib/compat/vcbuild/vcpkg")
    +-=======
    +-	set(VCPKG_DIR "${CMAKE_SOURCE_DIR}/compat/vcbuild/vcpkg")
    +->>>>>>> c8dff95af8 (fixup! hash-object: add a >4GB/LLP64 test case using filtered input)
    + 	message("WIN32: ${WIN32}") # show its underlying text values
    + 	message("VCPKG_DIR: ${VCPKG_DIR}")
    + 	message("VCPKG_ARCH: ${VCPKG_ARCH}") # maybe unset
    +@@ contrib/buildsystems/CMakeLists.txt: if(USE_VCPKG)
    + 	message("ENV(CMAKE_EXPORT_COMPILE_COMMANDS): $ENV{CMAKE_EXPORT_COMPILE_COMMANDS}")
    + 	if(NOT EXISTS ${VCPKG_DIR})
    + 		message("Initializing vcpkg and building the Git's dependencies (this will take a while...)")
    +-<<<<<<< 3dc87f9707 (build(deps): bump actions/cache from 5 to 6 (#6303))
    + 		execute_process(COMMAND ${CMAKE_SOURCE_DIR}/lib/compat/vcbuild/vcpkg_install.bat ${VCPKG_ARCH})
    +-=======
    +-		execute_process(COMMAND ${CMAKE_SOURCE_DIR}/compat/vcbuild/vcpkg_install.bat ${VCPKG_ARCH})
    +->>>>>>> c8dff95af8 (fixup! hash-object: add a >4GB/LLP64 test case using filtered input)
    + 	endif()
    + 	if(NOT EXISTS ${VCPKG_ARCH})
    + 		message("VCPKG_ARCH: unset, using 'x64-windows'")
    +@@ contrib/buildsystems/CMakeLists.txt: endif()
    + 
    + #default behaviour
    + include_directories(${CMAKE_SOURCE_DIR})
    +-<<<<<<< 3dc87f9707 (build(deps): bump actions/cache from 5 to 6 (#6303))
    + include_directories(${CMAKE_SOURCE_DIR}/lib)
    +-=======
    +->>>>>>> c8dff95af8 (fixup! hash-object: add a >4GB/LLP64 test case using filtered input)
    + 
    + # When cross-compiling, define HOST_CPU as the canonical name of the CPU on
    + # which the built Git will run (for instance "x86_64").
    +@@ contrib/buildsystems/CMakeLists.txt: if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
    + 		add_compile_definitions(ENSURE_MSYSTEM_IS_SET="MINGW32" MINGW_PREFIX="mingw32")
    + 	endif()
    + 	list(APPEND compat_SOURCES
    +-<<<<<<< 3dc87f9707 (build(deps): bump actions/cache from 5 to 6 (#6303))
    + 		lib/compat/mingw.c
    + 		lib/compat/winansi.c
    + 		lib/compat/win32/flush.c
    +@@ contrib/buildsystems/CMakeLists.txt: if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
    + 		lib/compat/win32/wsl.c
    + 		lib/compat/strdup.c
    + 		lib/compat/win32/fscache.c)
    +-=======
    +-		compat/mingw.c
    +-		compat/winansi.c
    +-		compat/win32/flush.c
    +-		compat/win32/path-utils.c
    +-		compat/win32/pthread.c
    +-		compat/win32mmap.c
    +-		compat/win32/syslog.c
    +-		compat/win32/trace2_win32_process_info.c
    +-		compat/win32/dirent.c
    +-		compat/win32/wsl.c
    +-		compat/strdup.c
    +-		compat/win32/fscache.c)
    +->>>>>>> c8dff95af8 (fixup! hash-object: add a >4GB/LLP64 test case using filtered input)
    + 	set(NO_UNIX_SOCKETS 1)
      
    - 	reftable_set_alloc(malloc, realloc, free);
    + elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux")
    +@@ contrib/buildsystems/CMakeLists.txt: if(WIN32)
    + 		message(FATAL_ERROR "Unhandled compiler: ${CMAKE_C_COMPILER_ID}")
    + 	endif()
      
    -+	reftable_set_alloc(malloc, realloc, free);
    -+
    - 	refs_compute_filesystem_location(gitdir, payload, &is_worktree, &refdir,
    - 					 &ref_common_dir);
    +-<<<<<<< 3dc87f9707 (build(deps): bump actions/cache from 5 to 6 (#6303))
    + 	add_executable(headless-git ${CMAKE_SOURCE_DIR}/lib/compat/win32/headless.c)
    +-=======
    +-	add_executable(headless-git ${CMAKE_SOURCE_DIR}/compat/win32/headless.c)
    +->>>>>>> c8dff95af8 (fixup! hash-object: add a >4GB/LLP64 test case using filtered input)
    + 	list(APPEND PROGRAMS_BUILT headless-git)
    + 	if(CMAKE_C_COMPILER_ID STREQUAL "GNU" OR CMAKE_C_COMPILER_ID STREQUAL "Clang")
    + 		target_link_options(headless-git PUBLIC -municode -Wl,-subsystem,windows)
    +@@ contrib/buildsystems/CMakeLists.txt: string(REPLACE "@USE_LIBPCRE2@" "" git_build_options "${git_build_options}")
    + string(REPLACE "@WITH_BREAKING_CHANGES@" "" git_build_options "${git_build_options}")
    + string(REPLACE "@X@" "${EXE_EXTENSION}" git_build_options "${git_build_options}")
    + if(USE_VCPKG)
    +-<<<<<<< 3dc87f9707 (build(deps): bump actions/cache from 5 to 6 (#6303))
    + 	string(APPEND git_build_options "PATH=\"$PATH:$TEST_DIRECTORY/../lib/compat/vcbuild/vcpkg/installed/${VCPKG_ARCH}/bin\"\n")
    +-=======
    +-	string(APPEND git_build_options "PATH=\"$PATH:$TEST_DIRECTORY/../compat/vcbuild/vcpkg/installed/${VCPKG_ARCH}/bin\"\n")
    +->>>>>>> c8dff95af8 (fixup! hash-object: add a >4GB/LLP64 test case using filtered input)
    + endif()
    + file(WRITE ${CMAKE_BINARY_DIR}/GIT-BUILD-OPTIONS ${git_build_options})
      
     
    + ## lib/compat/vcbuild/README ##
    + remerge CONFLICT (content): Merge conflict in lib/compat/vcbuild/README
    + index 551e2a3908..2531650b18 100644
    + --- lib/compat/vcbuild/README
    + +++ lib/compat/vcbuild/README
    +@@ lib/compat/vcbuild/README: The Steps to Build Git with VS2015 or VS2017 from the command line.
    +    Prompt or from an SDK bash window:
    + 
    +    $ cd <repo_root>
    +-<<<<<<< 3dc87f9707 (build(deps): bump actions/cache from 5 to 6 (#6303)):lib/compat/vcbuild/README
    +    $ ./lib/compat/vcbuild/vcpkg_install.bat x64-windows
    + 
    +    or
    + 
    +    $ ./lib/compat/vcbuild/vcpkg_install.bat arm64-windows
    +-=======
    +-   $ ./compat/vcbuild/vcpkg_install.bat x64-windows
    +-
    +-   or
    +-
    +-   $ ./compat/vcbuild/vcpkg_install.bat arm64-windows
    +->>>>>>> c8dff95af8 (fixup! hash-object: add a >4GB/LLP64 test case using filtered input):compat/vcbuild/README
    + 
    +    The vcpkg tools and all of the third-party sources will be installed
    +    in this folder:
    +
    + ## lib/git-compat-util.h ##
    + remerge CONFLICT (content): Merge conflict in lib/git-compat-util.h
    + index 763608b4ed..1e09c0775c 100644
    + --- lib/git-compat-util.h
    + +++ lib/git-compat-util.h
    +@@ lib/git-compat-util.h: struct fscache;
    + #ifndef enable_fscache
    + #define enable_fscache(x) /* noop */
    + #endif
    +-<<<<<<< 3dc87f9707 (build(deps): bump actions/cache from 5 to 6 (#6303)):lib/git-compat-util.h
    + #ifndef flush_fscache
    + #define flush_fscache() /* noop */
    + #endif
    +-=======
    +->>>>>>> c8dff95af8 (fixup! hash-object: add a >4GB/LLP64 test case using filtered input):git-compat-util.h
    + 
    + #ifndef disable_fscache
    + #define disable_fscache() /* noop */
    +
    + ## meson.build ##
    + remerge CONFLICT (content): Merge conflict in meson.build
    + index 828aed4df6..d8c56a0c82 100644
    + --- meson.build
    + +++ meson.build
    +@@ meson.build: if host_machine.system() == 'cygwin'
    +   ]
    + elif host_machine.system() == 'windows'
    +   compat_sources += [
    +-<<<<<<< 3dc87f9707 (build(deps): bump actions/cache from 5 to 6 (#6303))
    +     'lib/compat/winansi.c',
    +     'lib/compat/win32/dirent.c',
    +     'lib/compat/win32/flush.c',
    +@@ meson.build: elif host_machine.system() == 'windows'
    +     'lib/compat/win32/syslog.c',
    +     'lib/compat/win32/wsl.c',
    +     'lib/compat/win32mmap.c',
    +-=======
    +-    'compat/winansi.c',
    +-    'compat/win32/dirent.c',
    +-    'compat/win32/flush.c',
    +-    'compat/win32/fscache.c',
    +-    'compat/win32/path-utils.c',
    +-    'compat/win32/pthread.c',
    +-    'compat/win32/syslog.c',
    +-    'compat/win32/wsl.c',
    +-    'compat/win32mmap.c',
    +->>>>>>> c8dff95af8 (fixup! hash-object: add a >4GB/LLP64 test case using filtered input)
    +   ]
    + 
    +   libgit_c_args += [
    +
    + ## meson_options.txt ##
    + remerge CONFLICT (content): Merge conflict in meson_options.txt
    + index 209c411f1c..427697f5f7 100644
    + --- meson_options.txt
    + +++ meson_options.txt
    +@@ meson_options.txt: option('runtime_prefix', type: 'boolean', value: false,
    +   description: 'Resolve ancillary tooling and support files relative to the location of the runtime binary instead of hard-coding them into the binary.')
    + option('sane_tool_path', type: 'array', value: [],
    +   description: 'An array of paths to pick up tools from in case the normal tools are broken or lacking.')
    +-<<<<<<< 3dc87f9707 (build(deps): bump actions/cache from 5 to 6 (#6303))
    + option('nanosec', type: 'boolean', value: false,
    +   description: 'Care about sub-second file mtimes and ctimes.')
    +-=======
    +->>>>>>> c8dff95af8 (fixup! hash-object: add a >4GB/LLP64 test case using filtered input)
    + option('msystem', type: 'string', value: '',
    +   description: 'Fall-back on Windows when MSYSTEM is not set.')
    + option('mingw_prefix', type: 'string', value: '',
    +
    + ## odb/source-files.c (deleted) ##
    + remerge CONFLICT (modify/delete): odb/source-files.c deleted in 3dc87f9707 (build(deps): bump actions/cache from 5 to 6 (#6303)) and modified in c8dff95af8 (fixup! hash-object: add a >4GB/LLP64 test case using filtered input).  Version c8dff95af8 (fixup! hash-object: add a >4GB/LLP64 test case using filtered input) of odb/source-files.c left in tree.
    + index 3b1261eba9..0000000000
    + --- odb/source-files.c
    + +++ /dev/null
    +@@
    +-#include "git-compat-util.h"
    +-#include "abspath.h"
    +-#include "chdir-notify.h"
    +-#include "gettext.h"
    +-#include "lockfile.h"
    +-#include "object-file.h"
    +-#include "odb.h"
    +-#include "odb/source.h"
    +-#include "odb/source-files.h"
    +-#include "odb/source-loose.h"
    +-#include "packfile.h"
    +-#include "strbuf.h"
    +-#include "write-or-die.h"
    +-
    +-static void odb_source_files_reparent(const char *name UNUSED,
    +-				      const char *old_cwd,
    +-				      const char *new_cwd,
    +-				      void *cb_data)
    +-{
    +-	struct odb_source_files *files = cb_data;
    +-	char *path = reparent_relative_path(old_cwd, new_cwd,
    +-					    files->base.path);
    +-	free(files->base.path);
    +-	files->base.path = path;
    +-}
    +-
    +-static void odb_source_files_free(struct odb_source *source)
    +-{
    +-	struct odb_source_files *files = odb_source_files_downcast(source);
    +-	chdir_notify_unregister(NULL, odb_source_files_reparent, files);
    +-	odb_source_free(&files->loose->base);
    +-	packfile_store_free(files->packed);
    +-	odb_source_release(&files->base);
    +-	free(files);
    +-}
    +-
    +-static void odb_source_files_close(struct odb_source *source)
    +-{
    +-	struct odb_source_files *files = odb_source_files_downcast(source);
    +-	odb_source_close(&files->loose->base);
    +-	packfile_store_close(files->packed);
    +-}
    +-
    +-static void odb_source_files_reprepare(struct odb_source *source)
    +-{
    +-	struct odb_source_files *files = odb_source_files_downcast(source);
    +-	odb_source_reprepare(&files->loose->base);
    +-	packfile_store_reprepare(files->packed);
    +-}
    +-
    +-static int odb_source_files_read_object_info(struct odb_source *source,
    +-					     const struct object_id *oid,
    +-					     struct object_info *oi,
    +-					     enum object_info_flags flags)
    +-{
    +-	struct odb_source_files *files = odb_source_files_downcast(source);
    +-
    +-	if (!packfile_store_read_object_info(files->packed, oid, oi, flags) ||
    +-	    !odb_source_read_object_info(&files->loose->base, oid, oi, flags))
    +-		return 0;
    +-
    +-	return -1;
    +-}
    +-
    +-static int odb_source_files_read_object_stream(struct odb_read_stream **out,
    +-					       struct odb_source *source,
    +-					       const struct object_id *oid)
    +-{
    +-	struct odb_source_files *files = odb_source_files_downcast(source);
    +-	if (!packfile_store_read_object_stream(out, files->packed, oid) ||
    +-	    !odb_source_read_object_stream(out, &files->loose->base, oid))
    +-		return 0;
    +-	return -1;
    +-}
    +-
    +-static int odb_source_files_for_each_object(struct odb_source *source,
    +-					    const struct object_info *request,
    +-					    odb_for_each_object_cb cb,
    +-					    void *cb_data,
    +-					    const struct odb_for_each_object_options *opts)
    +-{
    +-	struct odb_source_files *files = odb_source_files_downcast(source);
    +-	int ret;
    +-
    +-	if (!(opts->flags & ODB_FOR_EACH_OBJECT_PROMISOR_ONLY)) {
    +-		ret = odb_source_for_each_object(&files->loose->base, request, cb, cb_data, opts);
    +-		if (ret)
    +-			return ret;
    +-	}
    +-
    +-	ret = packfile_store_for_each_object(files->packed, request, cb, cb_data, opts);
    +-	if (ret)
    +-		return ret;
    +-
    +-	return 0;
    +-}
    +-
    +-static int odb_source_files_count_objects(struct odb_source *source,
    +-					  enum odb_count_objects_flags flags,
    +-					  unsigned long *out)
    +-{
    +-	struct odb_source_files *files = odb_source_files_downcast(source);
    +-	unsigned long count;
    +-	int ret;
    +-
    +-	ret = packfile_store_count_objects(files->packed, flags, &count);
    +-	if (ret < 0)
    +-		goto out;
    +-
    +-	if (!(flags & ODB_COUNT_OBJECTS_APPROXIMATE)) {
    +-		unsigned long loose_count;
    +-
    +-		ret = odb_source_count_objects(&files->loose->base, flags, &loose_count);
    +-		if (ret < 0)
    +-			goto out;
    +-
    +-		count += loose_count;
    +-	}
    +-
    +-	*out = count;
    +-	ret = 0;
    +-
    +-out:
    +-	return ret;
    +-}
    +-
    +-static int odb_source_files_find_abbrev_len(struct odb_source *source,
    +-					    const struct object_id *oid,
    +-					    unsigned min_len,
    +-					    unsigned *out)
    +-{
    +-	struct odb_source_files *files = odb_source_files_downcast(source);
    +-	unsigned len = min_len;
    +-	int ret;
    +-
    +-	ret = packfile_store_find_abbrev_len(files->packed, oid, len, &len);
    +-	if (ret < 0)
    +-		goto out;
    +-
    +-	ret = odb_source_find_abbrev_len(&files->loose->base, oid, len, &len);
    +-	if (ret < 0)
    +-		goto out;
    +-
    +-	*out = len;
    +-	ret = 0;
    +-
    +-out:
    +-	return ret;
    +-}
    +-
    +-static int odb_source_files_freshen_object(struct odb_source *source,
    +-					   const struct object_id *oid)
    +-{
    +-	struct odb_source_files *files = odb_source_files_downcast(source);
    +-	if (packfile_store_freshen_object(files->packed, oid) ||
    +-	    odb_source_freshen_object(&files->loose->base, oid))
    +-		return 1;
    +-	return 0;
    +-}
    +-
    +-static int odb_source_files_write_object(struct odb_source *source,
    +-					 const void *buf, size_t len,
    +-					 enum object_type type,
    +-					 struct object_id *oid,
    +-					 struct object_id *compat_oid,
    +-					 enum odb_write_object_flags flags)
    +-{
    +-	struct odb_source_files *files = odb_source_files_downcast(source);
    +-	return odb_source_write_object(&files->loose->base, buf, len, type,
    +-				       oid, compat_oid, flags);
    +-}
    +-
    +-static int odb_source_files_write_object_stream(struct odb_source *source,
    +-						struct odb_write_stream *stream,
    +-						size_t len,
    +-						struct object_id *oid)
    +-{
    +-	struct odb_source_files *files = odb_source_files_downcast(source);
    +-	return odb_source_write_object_stream(&files->loose->base, stream, len, oid);
    +-}
    +-
    +-static int odb_source_files_begin_transaction(struct odb_source *source,
    +-					      struct odb_transaction **out)
    +-{
    +-	struct odb_transaction *tx = odb_transaction_files_begin(source);
    +-	if (!tx)
    +-		return -1;
    +-	*out = tx;
    +-	return 0;
    +-}
    +-
    +-static int odb_source_files_read_alternates(struct odb_source *source,
    +-					    struct strvec *out)
    +-{
    +-	struct strbuf buf = STRBUF_INIT;
    +-	char *path;
    +-
    +-	path = xstrfmt("%s/info/alternates", source->path);
    +-	if (strbuf_read_file(&buf, path, 1024) < 0) {
    +-		warn_on_fopen_errors(path);
    +-		free(path);
    +-		return 0;
    +-	}
    +-	parse_alternates(buf.buf, '\n', source->path, out);
    +-
    +-	strbuf_release(&buf);
    +-	free(path);
    +-	return 0;
    +-}
    +-
    +-static int odb_source_files_write_alternate(struct odb_source *source,
    +-					    const char *alternate)
    +-{
    +-	struct lock_file lock = LOCK_INIT;
    +-	char *path = xstrfmt("%s/%s", source->path, "info/alternates");
    +-	FILE *in, *out;
    +-	int found = 0;
    +-	int ret;
    +-
    +-	hold_lock_file_for_update(&lock, path, LOCK_DIE_ON_ERROR);
    +-	out = fdopen_lock_file(&lock, "w");
    +-	if (!out) {
    +-		ret = error_errno(_("unable to fdopen alternates lockfile"));
    +-		goto out;
    +-	}
    +-
    +-	in = fopen(path, "r");
    +-	if (in) {
    +-		struct strbuf line = STRBUF_INIT;
    +-
    +-		while (strbuf_getline(&line, in) != EOF) {
    +-			if (!strcmp(alternate, line.buf)) {
    +-				found = 1;
    +-				break;
    +-			}
    +-			fprintf_or_die(out, "%s\n", line.buf);
    +-		}
    +-
    +-		strbuf_release(&line);
    +-		fclose(in);
    +-	} else if (errno != ENOENT) {
    +-		ret = error_errno(_("unable to read alternates file"));
    +-		goto out;
    +-	}
    +-
    +-	if (found) {
    +-		rollback_lock_file(&lock);
    +-	} else {
    +-		fprintf_or_die(out, "%s\n", alternate);
    +-		if (commit_lock_file(&lock)) {
    +-			ret = error_errno(_("unable to move new alternates file into place"));
    +-			goto out;
    +-		}
    +-	}
    +-
    +-	ret = 0;
    +-
    +-out:
    +-	free(path);
    +-	return ret;
    +-}
    +-
    +-struct odb_source_files *odb_source_files_new(struct object_database *odb,
    +-					      const char *path,
    +-					      bool local)
    +-{
    +-	struct odb_source_files *files;
    +-
    +-	CALLOC_ARRAY(files, 1);
    +-	odb_source_init(&files->base, odb, ODB_SOURCE_FILES, path, local);
    +-	files->loose = odb_source_loose_new(odb, path, local);
    +-	files->packed = packfile_store_new(&files->base);
    +-
    +-	files->base.free = odb_source_files_free;
    +-	files->base.close = odb_source_files_close;
    +-	files->base.reprepare = odb_source_files_reprepare;
    +-	files->base.read_object_info = odb_source_files_read_object_info;
    +-	files->base.read_object_stream = odb_source_files_read_object_stream;
    +-	files->base.for_each_object = odb_source_files_for_each_object;
    +-	files->base.count_objects = odb_source_files_count_objects;
    +-	files->base.find_abbrev_len = odb_source_files_find_abbrev_len;
    +-	files->base.freshen_object = odb_source_files_freshen_object;
    +-	files->base.write_object = odb_source_files_write_object;
    +-	files->base.write_object_stream = odb_source_files_write_object_stream;
    +-	files->base.begin_transaction = odb_source_files_begin_transaction;
    +-	files->base.read_alternates = odb_source_files_read_alternates;
    +-	files->base.write_alternate = odb_source_files_write_alternate;
    +-
    +-	/*
    +-	 * Ideally, we would only ever store absolute paths in the source. This
    +-	 * is not (yet) possible though because we access and assume relative
    +-	 * paths in the primary ODB source in some user-facing functionality.
    +-	 */
    +-	if (!is_absolute_path(path))
    +-		chdir_notify_register(NULL, odb_source_files_reparent, files);
    +-
    +-	return files;
    +-}
    +
      ## t/t1007-hash-object.sh ##
    + remerge CONFLICT (content): Merge conflict in t/t1007-hash-object.sh
    + index 9d379905d4..463b38f990 100755
    + --- t/t1007-hash-object.sh
    + +++ t/t1007-hash-object.sh
     @@ t/t1007-hash-object.sh: test_expect_success EXPENSIVE,SIZE_T_IS_64BIT \
      
      # This clean filter does nothing, other than excercising the interface.
      # We ensure that cleaning doesn't mangle large files on 64-bit Windows.
    +-<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 3dc87f9707 (build(deps): bump actions/cache from 5 to 6 (#6303))
     -test_expect_success EXPENSIVE,SIZE_T_IS_64BIT,!LONG_IS_64BIT \
    -+test_expect_success EXPENSIVE,SIZE_T_IS_64BIT \
    +-================================
    + test_expect_success EXPENSIVE,SIZE_T_IS_64BIT \
    +->>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> c8dff95af8 (fixup! hash-object: add a >4GB/LLP64 test case using filtered input)
      		'hash filtered files over 4GB correctly' '
      	{ test -f big || test-tool genzeros $((5*1024*1024*1024)) >big; } &&
      	test_oid large5GB >expect &&
    +
    + ## t/t1517-outside-repo.sh ##
    + remerge CONFLICT (content): Merge conflict in t/t1517-outside-repo.sh
    + index 2be17cf7fc..efbac29c0e 100755
    + --- t/t1517-outside-repo.sh
    + +++ t/t1517-outside-repo.sh
    +@@ t/t1517-outside-repo.sh: do
    + 	http-backend | http-fetch | http-push | init-db | \
    + 	mktag | p4 | p4.py | pickaxe | remote-ftp | remote-ftps | \
    + 	remote-http | remote-https | replay | send-email | \
    +-<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 3dc87f9707 (build(deps): bump actions/cache from 5 to 6 (#6303))
    + 	sh-i18n--envsubst | shell | show | stage | survey | \
    + 	upload-archive--writer | upload-pack | whatchanged)
    + 		h_expect_outcome=expect_failure
    +@@ t/t1517-outside-repo.sh: do
    + 		h_expect_outcome=expect_success
    + 		all_expect_outcome=expect_failure
    + 		;;
    +-================================
    +-	sh-i18n--envsubst | shell | show | stage | submodule | survey | svn | \
    +-	upload-archive--writer | upload-pack | web--browse | whatchanged)
    +-		expect_outcome=expect_failure ;;
    +->>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> c8dff95af8 (fixup! hash-object: add a >4GB/LLP64 test case using filtered input)
    + 	*)
    + 		h_expect_outcome=expect_success
    + 		all_expect_outcome=expect_success
    +
    + ## t/t6403-merge-file.sh ##
    + remerge CONFLICT (content): Merge conflict in t/t6403-merge-file.sh
    + index 502537edd9..bd58e471bc 100755
    + --- t/t6403-merge-file.sh
    + +++ t/t6403-merge-file.sh
    +@@ t/t6403-merge-file.sh: test_expect_success "expected conflict markers" '
    + test_expect_success 'binary files cannot be merged' '
    + 	test_must_fail git merge-file -p \
    + 		orig.txt "$TEST_DIRECTORY"/lib-diff/test-binary-1.png new1.txt 2> merge.err &&
    +-<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 3dc87f9707 (build(deps): bump actions/cache from 5 to 6 (#6303))
    + 	test_grep "Cannot merge binary files" merge.err
    +-================================
    +-	grep "Cannot merge binary files" merge.err
    +->>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> c8dff95af8 (fixup! hash-object: add a >4GB/LLP64 test case using filtered input)
    + '
    + 
    + test_expect_success 'binary files cannot be merged with --object-id' '

To: f50ad1dfb8 (Turn git survey into a deprecated shim over git repo structure (git-for-windows#6268), 2026-07-08) (d76624b995..f50ad1dfb8)

Statistics

Metric Count
Total conflicts 3
Skipped (upstreamed) 1
Resolved surgically 2
Range-diff (click to expand)
  • 1: 9e31a9c = 1: f1e00a9 mingw: skip symlink type auto-detection for network share targets
  • 2: 0cb2e09 = 2: fe16d18 unix-socket: avoid leak when initialization fails
  • 3: b7ce2fa = 3: 99a92be Merge branch 'prevent-accidental-ntlm-exfiltration-via-symlinks'
  • 4: 552229e = 4: 5717fe8 grep: prevent ^$ false match at end of file
  • 5: 47b5b9c = 5: d7ec2f5 Merge branch 'v2.53.0.windows.3'
  • 6: 08d81fd = 6: 203ee1a Merge branch 'fixes-from-the-git-mailing-list'
  • 17: 4444a7c = 7: 3afa811 mingw: include the Python parts in the build
  • 19: a5036af = 8: 3208795 windows: skip linking git-<command> for built-ins
  • 21: 2ceed12 = 9: 805b8c8 mingw: stop hard-coding CC = gcc
  • 23: dc5857f = 10: 94a1781 mingw: drop the -D_USE_32BIT_TIME_T option
  • 25: c1404c8 = 11: 591f62b mingw: only use -Wl,--large-address-aware for 32-bit builds
  • 28: c0cbe2a = 12: 3d661ea mingw: avoid over-specifying --pic-executable
  • 11: 47f17cc = 13: 3830cb0 ci(vs-build): adapt to Visual Studio 2026 default on windows-latest
  • 37: 6f960be = 14: 4593cff mingw: set the prefix and HOST_CPU as per MSYS2's settings
  • 12: fdf4610 = 15: 18fc950 vcpkg_install: detect lack of Git
  • 62: f81fa54 = 16: 29feeea mingw: only enable the MSYS2-specific stuff when compiling in MSYS2
  • 13: f5972aa = 17: bc18dd0 vcpkg_install: add comment regarding slow network connections
  • 63: c22b815 = 18: b764515 mingw: rely on MSYS2's metadata instead of hard-coding it
  • 14: 5bad561 = 19: a30f8bf vcbuild: install ARM64 dependencies when building ARM64 binaries
  • 64: a6884a3 = 20: 662a1b6 mingw: always define ETC_* for MSYS2 environments
  • 15: 25f2dd1 = 21: 5e0305b vcbuild: add an option to install individual 'features'
  • 65: 7bfee5b = 22: 35a54fb max_tree_depth: lower it for clang builds in general on Windows
  • 16: 6b034b8 = 23: 1e974cf cmake: allow building for Windows/ARM64
  • 66: 88b7047 = 24: a453166 mingw: ensure valid CTYPE
  • 18: 38e14a5 = 25: 453471d ci(vs-build) also build Windows/ARM64 artifacts
  • 29: fb18021 = 26: 6815282 t5505/t5516: allow running without .git/branches/ in the templates
  • 67: eec5f87 = 27: 0fe4229 mingw: allow git.exe to be used instead of the "Git wrapper"
  • 20: af06b4b = 28: 5ed3384 vcbuild: stop hard-coding OpenSSL as a dependency
  • 38: 526f65b = 29: 0564760 t5505/t5516: fix white-space around redirectors
  • 69: 54fd9a9 = 30: 219e49b mingw: ignore HOMEDRIVE/HOMEPATH if it points to Windows' system directory
  • 22: 262a1f0 = 31: e0ae64b cmake(): allow setting HOST_CPU for cross-compilation
  • 71: 1a7fe7a = 32: c0dd0c5 Merge branch 'dscho-avoid-d-f-conflict-in-vs-master'
  • 7: a46e5ba = 33: f1060e7 t9350: point out that refs are not updated correctly
  • 24: 7b0e716 = 34: b1be65a CMake: default Visual Studio generator has changed
  • 73: 0ada101 = 35: 01d5b39 clink.pl: fix libexpatd.lib link error when using MSVC
  • 8: a901c39 = 36: e3eec46 transport-helper: add trailing --
  • 26: 98d4dc1 = 37: 7346d7f mingw: demonstrate a git add issue with NTFS junctions
  • 27: abcd5fe = 38: bfc7ee3 .gitignore: add Visual Studio CMakeSetting.json file
  • 75: 6216d79 = 39: d8ae0e7 Makefile: clean up .ilk files when MSVC=1
  • 9: 4e86015 = 40: b37d1f0 remote-helper: check helper status after import/export
  • 30: 65599c8 = 41: 5f7ee5d strbuf_realpath(): use platform-dependent API if available
  • 31: 45ac025 = 42: c22a768 http: use new "best effort" strategy for Secure Channel revoke checking
  • 32: 4cfec7d = 43: e2d4a45 subtree: update contrib/subtree test target
  • 33: 57e2158 = 44: fd0ff2c CMakeLists: add default "x64-windows" arch for Visual Studio
  • 34: 5771472 = 45: 21219f2 hash-object: add another >4GB/LLP64 test case
  • 35: 86d8795 = 46: 7531e29 setup: properly use "%(prefix)/" when in WSL
  • 36: abd6c19 = 47: d349956 Add config option windows.appendAtomically
  • 77: 87bc082 = 48: de0c8e0 vcbuild: add support for compiling Windows resource files
  • 39: 6a53a95 = 49: 4fd3c81 MinGW: link as terminal server aware
  • 10: c9ba1c3 = 50: 21c5717 ci: bump actions/checkout from 6 to 7
  • 40: 8fcc6c0 = 51: c6f4eb1 Always auto-gc after calling a fast-import transport
  • 41: 0b8e910 = 52: 2484f47 mingw: prevent regressions with "drive-less" absolute paths
  • 42: 74c349a = 53: c3f5fbf transport: optionally disable side-band-64k
  • 43: 200f57e = 54: 866c92f mingw: fix fatal error working on mapped network drives on Windows
  • 44: 662c0d1 = 55: b670537 clink.pl: fix MSVC compile script to handle libcurl-d.lib
  • 45: 80b5c83 = 56: 4341bc8 mingw: implement a platform-specific strbuf_realpath()
  • 46: de5cd07 = 57: 4b7e9b7 t3701: verify that we can add lots of files interactively
  • 47: 1255ab2 = 58: ccc3302 commit: accept "scissors" with CR/LF line endings
  • 48: 18efbc9 = 59: cd63747 t0014: fix indentation
  • 49: c54dc16 = 60: 5e78d10 git-gui: accommodate for intent-to-add files
  • 50: d1a0101 = 61: 0bbfedf mingw: allow for longer paths in parse_interpreter()
  • 51: 4a754e2 = 62: 1160dab compat/vcbuild: document preferred way to build in Visual Studio
  • 52: 0c9ed9d = 63: 4832e8c http: optionally send SSL client certificate
  • 53: 1b72f4d = 64: ad47a3a ci: run contrib/subtree tests in CI builds
  • 54: aa4deaf = 65: 67758d8 CMake: show Win32 and Generator_platform build-option values
  • 55: 7e1d749 = 66: c8c1fc3 hash-object: add a >4GB/LLP64 test case using filtered input
  • 56: 986be9b = 67: 8036820 compat/mingw.c: do not warn when failing to get owner
  • 57: d773165 = 68: 7d63c12 mingw: $env:TERM="xterm-256color" for newer OSes
  • 58: 7592699 = 69: b2b4cb5 winansi: check result and Buffer before using Name
  • 59: 01e2b0f = 70: 35aa9da mingw: change core.fsyncObjectFiles = 1 by default
  • 60: d0e560b = 71: 834b258 Fix Windows version resources
  • 61: a2a75f5 = 72: 69e847a status: fix for old-style submodules with commondir
  • 68: 376aa9f = 73: ecd1372 revision: create mark_trees_uninteresting_dense()
  • 70: 2f6cd53 = 74: 159ad21 survey: stub in new experimental 'git-survey' command
  • 72: b30c5a2 = 75: 0ffaa4c survey: add command line opts to select references
  • 126: 9db95f8 = 76: a8c9506 mingw: Support git_terminal_prompt with more terminals
  • 74: a08a823 = 77: d53745b survey: start pretty printing data in table form
  • 128: 26d2eb4 = 78: 8645e5e compat/terminal.c: only use the Windows console if bash 'read -r' fails
  • 76: fef4df0 = 79: b536350 survey: add object count summary
  • 130: e4a4c7b = 80: dd6d7ac mingw (git_terminal_prompt): do fall back to CONIN$/CONOUT$ method
  • 78: 157b3b1 = 81: 5b7b3ca survey: summarize total sizes by object type
  • 132: 3d427a9 = 82: 39e7adb Win32: symlink: move phantom symlink creation to a separate function
  • 79: 147b506 = 83: c211fe8 config.mak.uname: add git.rc to MSVC builds
  • 80: a92d810 = 84: d19b1e9 survey: show progress during object walk
  • 81: 4afa638 = 85: e00d44d mingw: make sure errno is set correctly when socket operations fail
  • 82: 73fb380 = 86: afac97e t5563: verify that NTLM authentication works
  • 134: 9539617 = 87: ffd4f0d mingw: introduce code to detect whether we're inside a Windows container
  • 135: e638f7c = 88: 73c030f Introduce helper to create symlinks that knows about index_state
  • 83: 665676b = 89: 3599767 clink.pl: ignore no-stack-protector arg on MSVC=1 builds
  • 84: 475e81e = 90: db4aee9 http: optionally load libcurl lazily
  • 85: ffce0d6 = 91: 3df2bc7 survey: add ability to track prioritized lists
  • 86: df33e50 = 92: e10b73c compat/mingw: handle WSA errors in strerror
  • 87: ce4db65 = 93: 1fb1ed6 http: disallow NTLM authentication by default
  • 138: 3beceb9 = 94: 925441a mingw: when running in a Windows container, try to rename() harder
  • 139: 1ab8f0d = 95: 3990971 mingw: allow to specify the symlink type in .gitattributes
  • 88: 6bd2ad9 = 96: 9c9cff5 clink.pl: move default linker options for MSVC=1 builds
  • 89: 14259a0 = 97: f979492 http: support lazy-loading libcurl also on Windows
  • 90: e618fb6 = 98: a248c96 survey: add report of "largest" paths
  • 91: b62ef42 = 99: 7d7b806 compat/mingw: drop outdated comment
  • 92: 23b9e5e = 100: d4baf37 http: warn if might have failed because of NTLM
  • 142: a82954c = 101: 6d9052b mingw: move the file_attr_to_st_mode() function definition
  • 143: b01f72d = 102: 8f05188 Win32: symlink: add test for symlink attribute
  • 93: 668bd4d = 103: bc05ee0 cmake: install headless-git.
  • 94: 7398ba5 = 104: 3c8eff0 http: when loading libcurl lazily, allow for multiple SSL backends
  • 95: 5a32ee8 = 105: 0746791 survey: add --top= option and config
  • 96: 9bec44a = 106: c9bf631 t0301: actually test credential-cache on Windows
  • 97: f79733b = 107: 175e75a credential: advertise NTLM suppression and allow helpers to re-enable
  • 146: e866134 = 108: 9a8a470 mingw: Windows Docker volumes are not symbolic links
  • 147: 2419892 = 109: a3afa37 clean: do not traverse mount points
  • 98: ff2b311 = 110: 26c7a94 git.rc: include winuser.h
  • 99: d9f8b32 = 111: ad6f4cb mingw: do load libcurl dynamically by default
  • 100: 3f65e99 = 112: a3aa37a Add a GitHub workflow to verify that Git/Scalar work in Nano Server
  • 101: 78e2872 = 113: 8aff376 mingw: suggest windows.appendAtomically in more cases
  • 102: 3408959 = 114: cbd5e9f win32: use native ANSI sequence processing, if possible
  • 103: 4bbc55c = 115: 598d228 common-main.c: fflush stdout buffer upon exit
  • 104: 77fb330 = 116: f7e822a t5601/t7406(mingw): do run tests with symlink support
  • 105: affa56c = 117: 627940f Fallback to AppData if XDG_CONFIG_HOME is unset
  • 106: 51bb88d = 118: 450d9e3 run-command: be helpful with Git LFS fails on Windows 7
  • 107: 39cb50f = 119: 3436f2a survey: clearly note the experimental nature in the output
  • 108: b0c01d8 = 120: b788370 credential-cache: handle ECONNREFUSED gracefully
  • 109: b3a2492 = 121: 76b55f9 reftable: do make sure to use custom allocators
  • 110: fc22936 = 122: 439e08c check-whitespace: avoid alerts about upstream commits
  • 111: 3e098c4 = 123: c2c7415 t/t5571-prep-push-hook.sh: Add test with writing to stderr
  • 112: fcf3cb1 = 124: 8b2334f dir: do not traverse mount points
  • 113: f482763 = 125: 1c414d7 win32: thread-utils: handle multi-socket systems
  • 114: 103d64e = 126: 91f80eb t5563: add tests for http.emptyAuth with Negotiate
  • 115: 74bd7f7 < -: ---------- diff-delta: widen struct delta_index size fields to size_t
  • 116: 208a0bf < -: ---------- delta: widen create_delta_index() parameter to size_t
  • 117: 64ac386 < -: ---------- pack-objects: widen delta-cache accounting to size_t
  • 118: 9c26f7f < -: ---------- pack-objects: widen free_unpacked() return to size_t
  • 119: 818658e < -: ---------- pack-objects: widen mem_usage and try_delta out-param to size_t
  • 120: 69c9254 < -: ---------- delta: widen create_delta() and diff_delta() to size_t
  • 121: 8c4809e < -: ---------- packfile, git-zlib: widen use_pack() and zstream avail fields to size_t
  • 122: d758603 < -: ---------- archive-zip: widen zlib_deflate_raw()'s maxsize local to size_t
  • 123: cfdb6b7 < -: ---------- diff: widen deflate_it()'s bound local from int to size_t
  • 124: 773b94e < -: ---------- http-push: widen start_put()'s size local from ssize_t to size_t
  • 125: 06f845c < -: ---------- t/helper/test-pack-

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

rimrul and others added 30 commits July 10, 2026 19:22
We map WSAGetLastError() errors to errno errors in winsock_error_to_errno(),
but the MSVC strerror() implementation only produces "Unknown error" for
most of them. Produce some more meaningful error messages in these
cases.

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

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

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

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

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

Signed-off-by: JiSeop Moon <zcube@zcube.kr>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Bert Belder <bertbelder@gmail.com>
Ignore the `-fno-stack-protector` compiler argument when building
with MSVC.  This will be used in a later commit that needs to build
a Win32 GUI app.

Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
This implements the Windows-specific support code, because everything is
slightly different on Windows, even loading shared libraries.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Move the default `-ENTRY` and `-SUBSYSTEM` arguments for
MSVC=1 builds from `config.mak.uname` into `clink.pl`.
These args are constant for console-mode executables.

Add support to `clink.pl` for generating a Win32 GUI application
using the `-mwindows` argument (to match how GCC does it).  This
changes the `-ENTRY` and `-SUBSYSTEM` arguments accordingly.

Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
The previous commits introduced a compile-time option to load libcurl
lazily, but it uses the hard-coded name "libcurl-4.dll" (or equivalent
on platforms other than Windows).

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

This addresses git-for-windows#607

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
headless-git is a git executable without opening a console window. It is
useful when other GUI executables want to call git. We should install it
together with git on Windows.

Signed-off-by: Yuyi Wang <Strawberry_Str@hotmail.com>
winuser.h contains the definition of RT_MANIFEST that our LLVM based
toolchain needs to understand that we want to embed
compat/win32/git.manifest as an application manifest. It currently just
embeds it as additional data that Windows doesn't understand.

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

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

This fixes git-for-windows#4707

Signed-off-by: Matthias Aßhauer <mha1993@live.de>
Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
This will help with Git for Windows' maintenance going forward: It
allows Git for Windows to switch its primary libcurl to a variant
without the OpenSSL backend, while still loading an alternate when
setting `http.sslBackend = openssl`.

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

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

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

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

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

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

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

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

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
By default, the buffer type of Windows' `stdout` is unbuffered (_IONBF),
and there is no need to manually fflush `stdout`.

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

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

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

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

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

Signed-off-by: Ariel Lourenco <ariellourenco@users.noreply.github.com>
dscho and others added 30 commits July 10, 2026 19:24
These are Git for Windows' Git GUI and gitk patches. We will have to
decide at some point what to do about them, but that's a little lower
priority (as Git GUI seems to be unmaintained for the time being, and
the gitk maintainer keeps a very low profile on the Git mailing list,
too).

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

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

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

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

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

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

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

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

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

Helped-by: Clive Chan <cc@clive.io>
Helped-by: Adric Norris <landstander668@gmail.com>
Helped-by: Ben Bodenmiller <bbodenmiller@hotmail.com>
Helped-by: Philip Oakley <philipoakley@iee.org>
Signed-off-by: Brendan Forster <brendan@github.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
The `--stdin` option was a well-established paradigm in other commands,
therefore we implemented it in `git reset` for use by Visual Studio.

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

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

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

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

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

Signed-off-by: Philip Oakley <philipoakley@iee.org>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Rather than using private IFTTT Applets that send mails to this
maintainer whenever a new version of a Git for Windows component was
released, let's use the power of GitHub workflows to make this process
publicly visible.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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


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

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

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

---

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

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


</details>
)

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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