Skip to content

Rebase shears/next: 1 conflict(s) (0 skipped, 1 resolved) (#29699723355)#320

Open
gitforwindowshelper[bot] wants to merge 343 commits into
base/shears/next-29699723355from
shears/next-29699723355
Open

Rebase shears/next: 1 conflict(s) (0 skipped, 1 resolved) (#29699723355)#320
gitforwindowshelper[bot] wants to merge 343 commits into
base/shears/next-29699723355from
shears/next-29699723355

Conversation

@gitforwindowshelper

Copy link
Copy Markdown

Workflow run

Rebase Summary: next

From: fa68cf29c9 (Merge tag 'v2.55.0.windows.3', 2026-07-16) (6d1d2f0c45..fa68cf29c9)

Resolved: fa68cf2 (Merge tag 'v2.55.0.windows.3', 2026-07-16)

Resolved merge of v2.55.0.windows.3: kept HEAD's newer code (deprecated survey shim, CI_EVENT variable, test_grep, structured test outcomes) and combined includes in compat/win32/path-utils.c (added repository.h from HEAD plus wrapper.h/strbuf.h/versioncmp.h from merge side)

Range-diff
  • 1: fa68cf2 ! 1: 8980887 Merge tag 'v2.55.0.windows.3'

    @@ Commit message
           * Fixes heap overflows in the credential helper wincred, see
             GHSA-rxqw-wxqg-g7hw for full details.
     
    + ## Documentation/git-survey.adoc ##
    + remerge CONFLICT (add/add): Merge conflict in Documentation/git-survey.adoc
    + index 66037de55a..e97656b49d 100644
    + --- Documentation/git-survey.adoc
    + +++ Documentation/git-survey.adoc
    +@@ Documentation/git-survey.adoc: git-survey(1)
    + 
    + NAME
    + ----
    +-<<<<<<< 6659352e7e (Drop Windows 7 support (#6325))
    + git-survey - DEPRECATED: Measure various repository dimensions of scale
    +-=======
    +-git-survey - EXPERIMENTAL: Measure various repository dimensions of scale
    +->>>>>>> 52ca1113d6 (wincred: prevent silent credential loss when storing OAuth tokens)
    + 
    + SYNOPSIS
    + --------
    + [verse]
    +-<<<<<<< 6659352e7e (Drop Windows 7 support (#6325))
    + (DEPRECATED!) 'git survey' <options>
    +-=======
    +-(EXPERIMENTAL!) 'git survey' <options>
    +->>>>>>> 52ca1113d6 (wincred: prevent silent credential loss when storing OAuth tokens)
    + 
    + DESCRIPTION
    + -----------
    + 
    +-<<<<<<< 6659352e7e (Drop Windows 7 support (#6325))
    + NOTE: `git survey` is being superseded by `git repo structure`. New
    + deployments and new features should use `git repo structure`; its
    + `--ref-filter=<pattern>` option subsumes the various `--branches`,
    +@@ Documentation/git-survey.adoc: deployments and new features should use `git repo structure`; its
    + same detail tables. During the deprecation phase, `git survey` is
    + a thin shim over `git repo structure`. See linkgit:git-repo[1].
    + 
    +-=======
    +->>>>>>> 52ca1113d6 (wincred: prevent silent credential loss when storing OAuth tokens)
    + Survey the repository and measure various dimensions of scale.
    + 
    + As repositories grow to "monorepo" size, certain data shapes can cause
    +
    + ## builtin/survey.c ##
    + remerge CONFLICT (add/add): Merge conflict in builtin/survey.c
    + index 48efdb8581..d3b36b8914 100644
    + --- builtin/survey.c
    + +++ builtin/survey.c
    +@@
    + #define USE_THE_REPOSITORY_VARIABLE
    + 
    + #include "builtin.h"
    +-<<<<<<< 6659352e7e (Drop Windows 7 support (#6325))
    + #include "color.h"
    + #include "exec-cmd.h"
    + #include "gettext.h"
    +@@ builtin/survey.c: int cmd_survey(int argc, const char **argv, const char *prefix,
    + 	/* unreachable: execv_git_cmd dies on failure */
    + 	strvec_clear(&child_argv);
    + 	return 1;
    +-=======
    +-#include "config.h"
    +-#include "environment.h"
    +-#include "hex.h"
    +-#include "object.h"
    +-#include "odb.h"
    +-#include "object-name.h"
    +-#include "parse-options.h"
    +-#include "path-walk.h"
    +-#include "progress.h"
    +-#include "ref-filter.h"
    +-#include "refs.h"
    +-#include "revision.h"
    +-#include "strbuf.h"
    +-#include "strvec.h"
    +-#include "tag.h"
    +-#include "trace2.h"
    +-#include "color.h"
    +-
    +-static const char * const survey_usage[] = {
    +-	N_("(EXPERIMENTAL!) git survey <options>"),
    +-	NULL,
    +-};
    +-
    +-struct survey_refs_wanted {
    +-	int want_all_refs; /* special override */
    +-
    +-	int want_branches;
    +-	int want_tags;
    +-	int want_remotes;
    +-	int want_detached;
    +-	int want_other; /* see FILTER_REFS_OTHERS -- refs/notes/, refs/stash/ */
    +-};
    +-
    +-static struct survey_refs_wanted default_ref_options = {
    +-	.want_all_refs = 1,
    +-};
    +-
    +-struct survey_opts {
    +-	int verbose;
    +-	int show_progress;
    +-	int top_nr;
    +-	struct survey_refs_wanted refs;
    +-};
    +-
    +-struct survey_report_ref_summary {
    +-	size_t refs_nr;
    +-	size_t branches_nr;
    +-	size_t remote_refs_nr;
    +-	size_t tags_nr;
    +-	size_t tags_annotated_nr;
    +-	size_t others_nr;
    +-	size_t unknown_nr;
    +-};
    +-
    +-struct survey_report_object_summary {
    +-	size_t commits_nr;
    +-	size_t tags_nr;
    +-	size_t trees_nr;
    +-	size_t blobs_nr;
    +-};
    +-
    +-/**
    +- * For some category given by 'label', count the number of objects
    +- * that match that label along with the on-disk size and the size
    +- * after decompressing (both with delta bases and zlib).
    +- */
    +-struct survey_report_object_size_summary {
    +-	char *label;
    +-	size_t nr;
    +-	size_t disk_size;
    +-	size_t inflated_size;
    +-	size_t num_missing;
    +-};
    +-
    +-typedef int (*survey_top_cmp)(void *v1, void *v2);
    +-
    +-static int cmp_by_nr(void *v1, void *v2)
    +-{
    +-	struct survey_report_object_size_summary *s1 = v1;
    +-	struct survey_report_object_size_summary *s2 = v2;
    +-
    +-	if (s1->nr < s2->nr)
    +-		return -1;
    +-	if (s1->nr > s2->nr)
    +-		return 1;
    +-	return 0;
    +-}
    +-
    +-static int cmp_by_disk_size(void *v1, void *v2)
    +-{
    +-	struct survey_report_object_size_summary *s1 = v1;
    +-	struct survey_report_object_size_summary *s2 = v2;
    +-
    +-	if (s1->disk_size < s2->disk_size)
    +-		return -1;
    +-	if (s1->disk_size > s2->disk_size)
    +-		return 1;
    +-	return 0;
    +-}
    +-
    +-static int cmp_by_inflated_size(void *v1, void *v2)
    +-{
    +-	struct survey_report_object_size_summary *s1 = v1;
    +-	struct survey_report_object_size_summary *s2 = v2;
    +-
    +-	if (s1->inflated_size < s2->inflated_size)
    +-		return -1;
    +-	if (s1->inflated_size > s2->inflated_size)
    +-		return 1;
    +-	return 0;
    +-}
    +-
    +-/**
    +- * Store a list of "top" categories by some sorting function. When
    +- * inserting a new category, reorder the list and free the one that
    +- * got ejected (if any).
    +- */
    +-struct survey_report_top_table {
    +-	const char *name;
    +-	survey_top_cmp cmp_fn;
    +-	size_t nr;
    +-	size_t alloc;
    +-
    +-	/**
    +-	 * 'data' stores an array of structs and must be cast into
    +-	 * the proper array type before evaluating an index.
    +-	 */
    +-	void *data;
    +-};
    +-
    +-static void init_top_sizes(struct survey_report_top_table *top,
    +-			   size_t limit, const char *name,
    +-			   survey_top_cmp cmp)
    +-{
    +-	struct survey_report_object_size_summary *sz_array;
    +-
    +-	top->name = name;
    +-	top->cmp_fn = cmp;
    +-	top->alloc = limit;
    +-	top->nr = 0;
    +-
    +-	CALLOC_ARRAY(sz_array, limit);
    +-	top->data = sz_array;
    +-}
    +-
    +-MAYBE_UNUSED
    +-static void clear_top_sizes(struct survey_report_top_table *top)
    +-{
    +-	struct survey_report_object_size_summary *sz_array = top->data;
    +-
    +-	for (size_t i = 0; i < top->nr; i++)
    +-		free(sz_array[i].label);
    +-	free(sz_array);
    +-}
    +-
    +-static void maybe_insert_into_top_size(struct survey_report_top_table *top,
    +-				       struct survey_report_object_size_summary *summary)
    +-{
    +-	struct survey_report_object_size_summary *sz_array = top->data;
    +-	size_t pos = top->nr;
    +-
    +-	/* Compare against list from the bottom. */
    +-	while (pos > 0 && top->cmp_fn(&sz_array[pos - 1], summary) < 0)
    +-		pos--;
    +-
    +-	/* Not big enough! */
    +-	if (pos >= top->alloc)
    +-		return;
    +-
    +-	/* We need to shift the data. */
    +-	if (top->nr == top->alloc)
    +-		free(sz_array[top->nr - 1].label);
    +-	else
    +-		top->nr++;
    +-
    +-	for (size_t i = top->nr - 1; i > pos; i--)
    +-		memcpy(&sz_array[i], &sz_array[i - 1], sizeof(*sz_array));
    +-
    +-	memcpy(&sz_array[pos], summary, sizeof(*summary));
    +-	sz_array[pos].label = xstrdup(summary->label);
    +-}
    +-
    +-/**
    +- * This struct contains all of the information that needs to be printed
    +- * at the end of the exploration of the repository and its references.
    +- */
    +-struct survey_report {
    +-	struct survey_report_ref_summary refs;
    +-	struct survey_report_object_summary reachable_objects;
    +-
    +-	struct survey_report_object_size_summary *by_type;
    +-
    +-	struct survey_report_top_table *top_paths_by_count;
    +-	struct survey_report_top_table *top_paths_by_disk;
    +-	struct survey_report_top_table *top_paths_by_inflate;
    +-};
    +-
    +-#define REPORT_TYPE_COMMIT 0
    +-#define REPORT_TYPE_TREE 1
    +-#define REPORT_TYPE_BLOB 2
    +-#define REPORT_TYPE_TAG 3
    +-#define REPORT_TYPE_COUNT 4
    +-
    +-struct survey_context {
    +-	struct repository *repo;
    +-
    +-	/* Options that control what is done. */
    +-	struct survey_opts opts;
    +-
    +-	/* Info for output only. */
    +-	struct survey_report report;
    +-
    +-	/*
    +-	 * The rest of the members are about enabling the activity
    +-	 * of the 'git survey' command, including ref listings, object
    +-	 * pointers, and progress.
    +-	 */
    +-
    +-	struct progress *progress;
    +-	size_t progress_nr;
    +-	size_t progress_total;
    +-
    +-	struct strvec refs;
    +-	struct ref_array ref_array;
    +-};
    +-
    +-static void clear_survey_context(struct survey_context *ctx)
    +-{
    +-	ref_array_clear(&ctx->ref_array);
    +-	strvec_clear(&ctx->refs);
    +-}
    +-
    +-struct survey_table {
    +-	const char *table_name;
    +-	struct strvec header;
    +-	struct strvec *rows;
    +-	size_t rows_nr;
    +-	size_t rows_alloc;
    +-};
    +-
    +-#define SURVEY_TABLE_INIT {	\
    +-	.header = STRVEC_INIT,	\
    +-}
    +-
    +-static void clear_table(struct survey_table *table)
    +-{
    +-	strvec_clear(&table->header);
    +-	for (size_t i = 0; i < table->rows_nr; i++)
    +-		strvec_clear(&table->rows[i]);
    +-	free(table->rows);
    +-}
    +-
    +-static void insert_table_rowv(struct survey_table *table, ...)
    +-{
    +-	va_list ap;
    +-	char *arg;
    +-	ALLOC_GROW(table->rows, table->rows_nr + 1, table->rows_alloc);
    +-
    +-	memset(&table->rows[table->rows_nr], 0, sizeof(struct strvec));
    +-
    +-	va_start(ap, table);
    +-	while ((arg = va_arg(ap, char *)))
    +-		strvec_push(&table->rows[table->rows_nr], arg);
    +-	va_end(ap);
    +-
    +-	table->rows_nr++;
    +-}
    +-
    +-#define SECTION_SEGMENT "========================================"
    +-#define SECTION_SEGMENT_LEN 40
    +-static const char *section_line = SECTION_SEGMENT
    +-				  SECTION_SEGMENT
    +-				  SECTION_SEGMENT
    +-				  SECTION_SEGMENT;
    +-static const size_t section_len = 4 * SECTION_SEGMENT_LEN;
    +-
    +-static void print_table_title(const char *name, size_t *widths, size_t nr)
    +-{
    +-	size_t width = 3 * (nr - 1);
    +-	size_t min_width = strlen(name);
    +-
    +-	for (size_t i = 0; i < nr; i++)
    +-		width += widths[i];
    +-
    +-	if (width < min_width)
    +-		width = min_width;
    +-
    +-	if (width > section_len)
    +-		width = section_len;
    +-
    +-	printf("\n%s\n%.*s\n", name, (int)width, section_line);
    +-}
    +-
    +-static void print_row_plaintext(struct strvec *row, size_t *widths)
    +-{
    +-	static struct strbuf line = STRBUF_INIT;
    +-	strbuf_setlen(&line, 0);
    +-
    +-	for (size_t i = 0; i < row->nr; i++) {
    +-		const char *str = row->v[i];
    +-		size_t len = strlen(str);
    +-		if (i)
    +-			strbuf_add(&line, " | ", 3);
    +-		strbuf_addchars(&line, ' ', widths[i] - len);
    +-		strbuf_add(&line, str, len);
    +-	}
    +-	printf("%s\n", line.buf);
    +-}
    +-
    +-static void print_divider_plaintext(size_t *widths, size_t nr)
    +-{
    +-	static struct strbuf line = STRBUF_INIT;
    +-	strbuf_setlen(&line, 0);
    +-
    +-	for (size_t i = 0; i < nr; i++) {
    +-		if (i)
    +-			strbuf_add(&line, "-+-", 3);
    +-		strbuf_addchars(&line, '-', widths[i]);
    +-	}
    +-	printf("%s\n", line.buf);
    +-}
    +-
    +-static void print_table_plaintext(struct survey_table *table)
    +-{
    +-	size_t *column_widths;
    +-	size_t columns_nr = table->header.nr;
    +-	CALLOC_ARRAY(column_widths, columns_nr);
    +-
    +-	for (size_t i = 0; i < columns_nr; i++) {
    +-		column_widths[i] = strlen(table->header.v[i]);
    +-
    +-		for (size_t j = 0; j < table->rows_nr; j++) {
    +-			size_t rowlen = strlen(table->rows[j].v[i]);
    +-			if (column_widths[i] < rowlen)
    +-				column_widths[i] = rowlen;
    +-		}
    +-	}
    +-
    +-	print_table_title(table->table_name, column_widths, columns_nr);
    +-	print_row_plaintext(&table->header, column_widths);
    +-	print_divider_plaintext(column_widths, columns_nr);
    +-
    +-	for (size_t j = 0; j < table->rows_nr; j++)
    +-		print_row_plaintext(&table->rows[j], column_widths);
    +-
    +-	free(column_widths);
    +-}
    +-
    +-static void survey_report_plaintext_refs(struct survey_context *ctx)
    +-{
    +-	struct survey_report_ref_summary *refs = &ctx->report.refs;
    +-	struct survey_table table = SURVEY_TABLE_INIT;
    +-
    +-	table.table_name = _("REFERENCES SUMMARY");
    +-
    +-	strvec_push(&table.header, _("Ref Type"));
    +-	strvec_push(&table.header, _("Count"));
    +-
    +-	if (ctx->opts.refs.want_all_refs || ctx->opts.refs.want_branches) {
    +-		char *fmt = xstrfmt("%"PRIuMAX"", (uintmax_t)refs->branches_nr);
    +-		insert_table_rowv(&table, _("Branches"), fmt, NULL);
    +-		free(fmt);
    +-	}
    +-
    +-	if (ctx->opts.refs.want_all_refs || ctx->opts.refs.want_remotes) {
    +-		char *fmt = xstrfmt("%"PRIuMAX"", (uintmax_t)refs->remote_refs_nr);
    +-		insert_table_rowv(&table, _("Remote refs"), fmt, NULL);
    +-		free(fmt);
    +-	}
    +-
    +-	if (ctx->opts.refs.want_all_refs || ctx->opts.refs.want_tags) {
    +-		char *fmt = xstrfmt("%"PRIuMAX"", (uintmax_t)refs->tags_nr);
    +-		insert_table_rowv(&table, _("Tags (all)"), fmt, NULL);
    +-		free(fmt);
    +-		fmt = xstrfmt("%"PRIuMAX"", (uintmax_t)refs->tags_annotated_nr);
    +-		insert_table_rowv(&table, _("Tags (annotated)"), fmt, NULL);
    +-		free(fmt);
    +-	}
    +-
    +-	print_table_plaintext(&table);
    +-	clear_table(&table);
    +-}
    +-
    +-static void survey_report_plaintext_reachable_object_summary(struct survey_context *ctx)
    +-{
    +-	struct survey_report_object_summary *objs = &ctx->report.reachable_objects;
    +-	struct survey_table table = SURVEY_TABLE_INIT;
    +-	char *fmt;
    +-
    +-	table.table_name = _("REACHABLE OBJECT SUMMARY");
    +-
    +-	strvec_push(&table.header, _("Object Type"));
    +-	strvec_push(&table.header, _("Count"));
    +-
    +-	fmt = xstrfmt("%"PRIuMAX"", (uintmax_t)objs->tags_nr);
    +-	insert_table_rowv(&table, _("Tags"), fmt, NULL);
    +-	free(fmt);
    +-
    +-	fmt = xstrfmt("%"PRIuMAX"", (uintmax_t)objs->commits_nr);
    +-	insert_table_rowv(&table, _("Commits"), fmt, NULL);
    +-	free(fmt);
    +-
    +-	fmt = xstrfmt("%"PRIuMAX"", (uintmax_t)objs->trees_nr);
    +-	insert_table_rowv(&table, _("Trees"), fmt, NULL);
    +-	free(fmt);
    +-
    +-	fmt = xstrfmt("%"PRIuMAX"", (uintmax_t)objs->blobs_nr);
    +-	insert_table_rowv(&table, _("Blobs"), fmt, NULL);
    +-	free(fmt);
    +-
    +-	print_table_plaintext(&table);
    +-	clear_table(&table);
    +-}
    +-
    +-static void survey_report_object_sizes(const char *title,
    +-				       const char *categories,
    +-				       struct survey_report_object_size_summary *summary,
    +-				       size_t summary_nr)
    +-{
    +-	struct survey_table table = SURVEY_TABLE_INIT;
    +-	table.table_name = title;
    +-
    +-	strvec_push(&table.header, categories);
    +-	strvec_push(&table.header, _("Count"));
    +-	strvec_push(&table.header, _("Disk Size"));
    +-	strvec_push(&table.header, _("Inflated Size"));
    +-
    +-	for (size_t i = 0; i < summary_nr; i++) {
    +-		char *label_str =  xstrdup(summary[i].label);
    +-		char *nr_str = xstrfmt("%"PRIuMAX, (uintmax_t)summary[i].nr);
    +-		char *disk_str = xstrfmt("%"PRIuMAX, (uintmax_t)summary[i].disk_size);
    +-		char *inflate_str = xstrfmt("%"PRIuMAX, (uintmax_t)summary[i].inflated_size);
    +-
    +-		insert_table_rowv(&table, label_str, nr_str,
    +-				  disk_str, inflate_str, NULL);
    +-
    +-		free(label_str);
    +-		free(nr_str);
    +-		free(disk_str);
    +-		free(inflate_str);
    +-	}
    +-
    +-	print_table_plaintext(&table);
    +-	clear_table(&table);
    +-}
    +-
    +-static void survey_report_plaintext_sorted_size(
    +-		struct survey_report_top_table *top)
    +-{
    +-	survey_report_object_sizes(top->name,  _("Path"),
    +-				   top->data, top->nr);
    +-}
    +-
    +-static void survey_report_plaintext(struct survey_context *ctx)
    +-{
    +-	printf("GIT SURVEY for \"%s\"\n", ctx->repo->worktree);
    +-	printf("-----------------------------------------------------\n");
    +-	survey_report_plaintext_refs(ctx);
    +-	survey_report_plaintext_reachable_object_summary(ctx);
    +-	survey_report_object_sizes(_("TOTAL OBJECT SIZES BY TYPE"),
    +-				   _("Object Type"),
    +-				   ctx->report.by_type,
    +-				   REPORT_TYPE_COUNT);
    +-
    +-	survey_report_plaintext_sorted_size(
    +-		&ctx->report.top_paths_by_count[REPORT_TYPE_TREE]);
    +-	survey_report_plaintext_sorted_size(
    +-		&ctx->report.top_paths_by_count[REPORT_TYPE_BLOB]);
    +-
    +-	survey_report_plaintext_sorted_size(
    +-		&ctx->report.top_paths_by_disk[REPORT_TYPE_TREE]);
    +-	survey_report_plaintext_sorted_size(
    +-		&ctx->report.top_paths_by_disk[REPORT_TYPE_BLOB]);
    +-
    +-	survey_report_plaintext_sorted_size(
    +-		&ctx->report.top_paths_by_inflate[REPORT_TYPE_TREE]);
    +-	survey_report_plaintext_sorted_size(
    +-		&ctx->report.top_paths_by_inflate[REPORT_TYPE_BLOB]);
    +-}
    +-
    +-/*
    +- * After parsing the command line arguments, figure out which refs we
    +- * should scan.
    +- *
    +- * If ANY were given in positive sense, then we ONLY include them and
    +- * do not use the builtin values.
    +- */
    +-static void fixup_refs_wanted(struct survey_context *ctx)
    +-{
    +-	struct survey_refs_wanted *rw = &ctx->opts.refs;
    +-
    +-	/*
    +-	 * `--all-refs` overrides and enables everything.
    +-	 */
    +-	if (rw->want_all_refs == 1) {
    +-		rw->want_branches = 1;
    +-		rw->want_tags = 1;
    +-		rw->want_remotes = 1;
    +-		rw->want_detached = 1;
    +-		rw->want_other = 1;
    +-		return;
    +-	}
    +-
    +-	/*
    +-	 * If none of the `--<ref-type>` were given, we assume all
    +-	 * of the builtin unspecified values.
    +-	 */
    +-	if (rw->want_branches == -1 &&
    +-	    rw->want_tags == -1 &&
    +-	    rw->want_remotes == -1 &&
    +-	    rw->want_detached == -1 &&
    +-	    rw->want_other == -1) {
    +-		*rw = default_ref_options;
    +-		return;
    +-	}
    +-
    +-	/*
    +-	 * Since we only allow positive boolean values on the command
    +-	 * line, we will only have true values where they specified
    +-	 * a `--<ref-type>`.
    +-	 *
    +-	 * So anything that still has an unspecified value should be
    +-	 * set to false.
    +-	 */
    +-	if (rw->want_branches == -1)
    +-		rw->want_branches = 0;
    +-	if (rw->want_tags == -1)
    +-		rw->want_tags = 0;
    +-	if (rw->want_remotes == -1)
    +-		rw->want_remotes = 0;
    +-	if (rw->want_detached == -1)
    +-		rw->want_detached = 0;
    +-	if (rw->want_other == -1)
    +-		rw->want_other = 0;
    +-}
    +-
    +-static int survey_load_config_cb(const char *var, const char *value,
    +-				 const struct config_context *cctx, void *pvoid)
    +-{
    +-	struct survey_context *ctx = pvoid;
    +-
    +-	if (!strcmp(var, "survey.verbose")) {
    +-		ctx->opts.verbose = git_config_bool(var, value);
    +-		return 0;
    +-	}
    +-	if (!strcmp(var, "survey.progress")) {
    +-		ctx->opts.show_progress = git_config_bool(var, value);
    +-		return 0;
    +-	}
    +-	if (!strcmp(var, "survey.top")) {
    +-		ctx->opts.top_nr = git_config_bool(var, value);
    +-		return 0;
    +-	}
    +-
    +-	return git_default_config(var, value, cctx, pvoid);
    +-}
    +-
    +-static void survey_load_config(struct survey_context *ctx)
    +-{
    +-	repo_config(the_repository, survey_load_config_cb, ctx);
    +-}
    +-
    +-static void do_load_refs(struct survey_context *ctx,
    +-			 struct ref_array *ref_array)
    +-{
    +-	struct ref_filter filter = REF_FILTER_INIT;
    +-	struct ref_sorting *sorting;
    +-	struct string_list sorting_options = STRING_LIST_INIT_DUP;
    +-
    +-	string_list_append(&sorting_options, "objectname");
    +-	sorting = ref_sorting_options(&sorting_options);
    +-
    +-	if (ctx->opts.refs.want_detached)
    +-		strvec_push(&ctx->refs, "HEAD");
    +-
    +-	if (ctx->opts.refs.want_all_refs) {
    +-		strvec_push(&ctx->refs, "refs/");
    +-	} else {
    +-		if (ctx->opts.refs.want_branches)
    +-			strvec_push(&ctx->refs, "refs/heads/");
    +-		if (ctx->opts.refs.want_tags)
    +-			strvec_push(&ctx->refs, "refs/tags/");
    +-		if (ctx->opts.refs.want_remotes)
    +-			strvec_push(&ctx->refs, "refs/remotes/");
    +-		if (ctx->opts.refs.want_other) {
    +-			strvec_push(&ctx->refs, "refs/notes/");
    +-			strvec_push(&ctx->refs, "refs/stash/");
    +-		}
    +-	}
    +-
    +-	filter.name_patterns = ctx->refs.v;
    +-	filter.ignore_case = 0;
    +-	filter.match_as_path = 1;
    +-
    +-	if (ctx->opts.show_progress) {
    +-		ctx->progress_total = 0;
    +-		ctx->progress = start_progress(ctx->repo,
    +-					       _("Scanning refs..."), 0);
    +-	}
    +-
    +-	filter_refs(ref_array, &filter, FILTER_REFS_KIND_MASK);
    +-
    +-	if (ctx->opts.show_progress) {
    +-		ctx->progress_total = ref_array->nr;
    +-		display_progress(ctx->progress, ctx->progress_total);
    +-	}
    +-
    +-	ref_array_sort(sorting, ref_array);
    +-
    +-	stop_progress(&ctx->progress);
    +-	ref_filter_clear(&filter);
    +-	ref_sorting_release(sorting);
    +-}
    +-
    +-/*
    +- * The REFS phase:
    +- *
    +- * Load the set of requested refs and assess them for scalablity problems.
    +- * Use that set to start a treewalk to all reachable objects and assess
    +- * them.
    +- *
    +- * This data will give us insights into the repository itself (the number
    +- * of refs, the size and shape of the DAG, the number and size of the
    +- * objects).
    +- *
    +- * Theoretically, this data is independent of the on-disk representation
    +- * (e.g. independent of packing concerns).
    +- */
    +-static void survey_phase_refs(struct survey_context *ctx)
    +-{
    +-	trace2_region_enter("survey", "phase/refs", ctx->repo);
    +-	do_load_refs(ctx, &ctx->ref_array);
    +-
    +-	ctx->report.refs.refs_nr = ctx->ref_array.nr;
    +-	for (int i = 0; i < ctx->ref_array.nr; i++) {
    +-		size_t size;
    +-		struct ref_array_item *item = ctx->ref_array.items[i];
    +-
    +-		switch (item->kind) {
    +-		case FILTER_REFS_TAGS:
    +-			ctx->report.refs.tags_nr++;
    +-			if (odb_read_object_info(ctx->repo->objects,
    +-						 &item->objectname,
    +-						 &size) == OBJ_TAG)
    +-				ctx->report.refs.tags_annotated_nr++;
    +-			break;
    +-
    +-		case FILTER_REFS_BRANCHES:
    +-			ctx->report.refs.branches_nr++;
    +-			break;
    +-
    +-		case FILTER_REFS_REMOTES:
    +-			ctx->report.refs.remote_refs_nr++;
    +-			break;
    +-
    +-		case FILTER_REFS_OTHERS:
    +-			ctx->report.refs.others_nr++;
    +-			break;
    +-
    +-		default:
    +-			ctx->report.refs.unknown_nr++;
    +-			break;
    +-		}
    +-	}
    +-
    +-	trace2_region_leave("survey", "phase/refs", ctx->repo);
    +-}
    +-
    +-static void increment_object_counts(
    +-		struct survey_report_object_summary *summary,
    +-		enum object_type type,
    +-		size_t nr)
    +-{
    +-	switch (type) {
    +-	case OBJ_COMMIT:
    +-		summary->commits_nr += nr;
    +-		break;
    +-
    +-	case OBJ_TREE:
    +-		summary->trees_nr += nr;
    +-		break;
    +-
    +-	case OBJ_BLOB:
    +-		summary->blobs_nr += nr;
    +-		break;
    +-
    +-	case OBJ_TAG:
    +-		summary->tags_nr += nr;
    +-		break;
    +-
    +-	default:
    +-		break;
    +-	}
    +-}
    +-
    +-static void increment_totals(struct survey_context *ctx,
    +-			     struct oid_array *oids,
    +-			     struct survey_report_object_size_summary *summary)
    +-{
    +-	for (size_t i = 0; i < oids->nr; i++) {
    +-		struct object_info oi = OBJECT_INFO_INIT;
    +-		unsigned oi_flags = OBJECT_INFO_FOR_PREFETCH;
    +-		size_t object_length = 0;
    +-		off_t disk_sizep = 0;
    +-		enum object_type type;
    +-
    +-		oi.typep = &type;
    +-		oi.sizep = &object_length;
    +-		oi.disk_sizep = &disk_sizep;
    +-
    +-		if (odb_read_object_info_extended(ctx->repo->objects,
    +-						  &oids->oid[i],
    +-						  &oi, oi_flags) < 0) {
    +-			summary->num_missing++;
    +-		} else {
    +-			summary->nr++;
    +-			summary->disk_size += disk_sizep;
    +-			summary->inflated_size += object_length;
    +-		}
    +-	}
    +-}
    +-
    +-static void increment_object_totals(struct survey_context *ctx,
    +-				    struct oid_array *oids,
    +-				    enum object_type type,
    +-				    const char *path)
    +-{
    +-	struct survey_report_object_size_summary *total;
    +-	struct survey_report_object_size_summary summary = { 0 };
    +-
    +-	increment_totals(ctx, oids, &summary);
    +-
    +-	switch (type) {
    +-	case OBJ_COMMIT:
    +-		total = &ctx->report.by_type[REPORT_TYPE_COMMIT];
    +-		break;
    +-
    +-	case OBJ_TREE:
    +-		total = &ctx->report.by_type[REPORT_TYPE_TREE];
    +-		break;
    +-
    +-	case OBJ_BLOB:
    +-		total = &ctx->report.by_type[REPORT_TYPE_BLOB];
    +-		break;
    +-
    +-	case OBJ_TAG:
    +-		total = &ctx->report.by_type[REPORT_TYPE_TAG];
    +-		break;
    +-
    +-	default:
    +-		BUG("No other type allowed");
    +-	}
    +-
    +-	total->nr += summary.nr;
    +-	total->disk_size += summary.disk_size;
    +-	total->inflated_size += summary.inflated_size;
    +-	total->num_missing += summary.num_missing;
    +-
    +-	if (type == OBJ_TREE || type == OBJ_BLOB) {
    +-		int index = type == OBJ_TREE ?
    +-			    REPORT_TYPE_TREE : REPORT_TYPE_BLOB;
    +-		struct survey_report_top_table *top;
    +-
    +-		/*
    +-		 * Temporarily store (const char *) here, but it will
    +-		 * be duped if inserted and will not be freed.
    +-		 */
    +-		summary.label = (char *)path;
    +-
    +-		top = ctx->report.top_paths_by_count;
    +-		maybe_insert_into_top_size(&top[index], &summary);
    +-
    +-		top = ctx->report.top_paths_by_disk;
    +-		maybe_insert_into_top_size(&top[index], &summary);
    +-
    +-		top = ctx->report.top_paths_by_inflate;
    +-		maybe_insert_into_top_size(&top[index], &summary);
    +-	}
    +-}
    +-
    +-static int survey_objects_path_walk_fn(const char *path,
    +-				       struct oid_array *oids,
    +-				       enum object_type type,
    +-				       void *data)
    +-{
    +-	struct survey_context *ctx = data;
    +-
    +-	increment_object_counts(&ctx->report.reachable_objects,
    +-				type, oids->nr);
    +-	increment_object_totals(ctx, oids, type, path);
    +-
    +-	ctx->progress_nr += oids->nr;
    +-	display_progress(ctx->progress, ctx->progress_nr);
    +-
    +-	return 0;
    +-}
    +-
    +-static void initialize_report(struct survey_context *ctx)
    +-{
    +-	CALLOC_ARRAY(ctx->report.by_type, REPORT_TYPE_COUNT);
    +-	ctx->report.by_type[REPORT_TYPE_COMMIT].label = xstrdup(_("Commits"));
    +-	ctx->report.by_type[REPORT_TYPE_TREE].label = xstrdup(_("Trees"));
    +-	ctx->report.by_type[REPORT_TYPE_BLOB].label = xstrdup(_("Blobs"));
    +-	ctx->report.by_type[REPORT_TYPE_TAG].label = xstrdup(_("Tags"));
    +-
    +-	CALLOC_ARRAY(ctx->report.top_paths_by_count, REPORT_TYPE_COUNT);
    +-	init_top_sizes(&ctx->report.top_paths_by_count[REPORT_TYPE_TREE],
    +-		       ctx->opts.top_nr, _("TOP DIRECTORIES BY COUNT"), cmp_by_nr);
    +-	init_top_sizes(&ctx->report.top_paths_by_count[REPORT_TYPE_BLOB],
    +-		       ctx->opts.top_nr, _("TOP FILES BY COUNT"), cmp_by_nr);
    +-
    +-	CALLOC_ARRAY(ctx->report.top_paths_by_disk, REPORT_TYPE_COUNT);
    +-	init_top_sizes(&ctx->report.top_paths_by_disk[REPORT_TYPE_TREE],
    +-		       ctx->opts.top_nr, _("TOP DIRECTORIES BY DISK SIZE"), cmp_by_disk_size);
    +-	init_top_sizes(&ctx->report.top_paths_by_disk[REPORT_TYPE_BLOB],
    +-		       ctx->opts.top_nr, _("TOP FILES BY DISK SIZE"), cmp_by_disk_size);
    +-
    +-	CALLOC_ARRAY(ctx->report.top_paths_by_inflate, REPORT_TYPE_COUNT);
    +-	init_top_sizes(&ctx->report.top_paths_by_inflate[REPORT_TYPE_TREE],
    +-		       ctx->opts.top_nr, _("TOP DIRECTORIES BY INFLATED SIZE"), cmp_by_inflated_size);
    +-	init_top_sizes(&ctx->report.top_paths_by_inflate[REPORT_TYPE_BLOB],
    +-		       ctx->opts.top_nr, _("TOP FILES BY INFLATED SIZE"), cmp_by_inflated_size);
    +-}
    +-
    +-static void survey_phase_objects(struct survey_context *ctx)
    +-{
    +-	struct rev_info revs = REV_INFO_INIT;
    +-	struct path_walk_info info = PATH_WALK_INFO_INIT;
    +-	unsigned int add_flags = 0;
    +-
    +-	trace2_region_enter("survey", "phase/objects", ctx->repo);
    +-
    +-	info.revs = &revs;
    +-	info.path_fn = survey_objects_path_walk_fn;
    +-	info.path_fn_data = ctx;
    +-
    +-	initialize_report(ctx);
    +-
    +-	repo_init_revisions(ctx->repo, &revs, "");
    +-	revs.tag_objects = 1;
    +-
    +-	ctx->progress_nr = 0;
    +-	ctx->progress_total = ctx->ref_array.nr;
    +-	if (ctx->opts.show_progress)
    +-		ctx->progress = start_progress(ctx->repo,
    +-					       _("Preparing object walk"),
    +-					       ctx->progress_total);
    +-	for (int i = 0; i < ctx->ref_array.nr; i++) {
    +-		struct ref_array_item *item = ctx->ref_array.items[i];
    +-		add_pending_oid(&revs, NULL, &item->objectname, add_flags);
    +-		display_progress(ctx->progress, ++(ctx->progress_nr));
    +-	}
    +-	stop_progress(&ctx->progress);
    +-
    +-	ctx->progress_nr = 0;
    +-	ctx->progress_total = 0;
    +-	if (ctx->opts.show_progress)
    +-		ctx->progress = start_progress(ctx->repo,
    +-					       _("Walking objects"), 0);
    +-	walk_objects_by_path(&info);
    +-	stop_progress(&ctx->progress);
    +-
    +-	release_revisions(&revs);
    +-	trace2_region_leave("survey", "phase/objects", ctx->repo);
    +-}
    +-
    +-int cmd_survey(int argc, const char **argv, const char *prefix, struct repository *repo)
    +-{
    +-	static struct survey_context ctx = {
    +-		.opts = {
    +-			.verbose = 0,
    +-			.show_progress = -1, /* defaults to isatty(2) */
    +-			.top_nr = 10,
    +-
    +-			.refs.want_all_refs = -1,
    +-
    +-			.refs.want_branches = -1, /* default these to undefined */
    +-			.refs.want_tags = -1,
    +-			.refs.want_remotes = -1,
    +-			.refs.want_detached = -1,
    +-			.refs.want_other = -1,
    +-		},
    +-		.refs = STRVEC_INIT,
    +-	};
    +-
    +-	static struct option survey_options[] = {
    +-		OPT__VERBOSE(&ctx.opts.verbose, N_("verbose output")),
    +-		OPT_BOOL(0, "progress", &ctx.opts.show_progress, N_("show progress")),
    +-		OPT_INTEGER('n', "top", &ctx.opts.top_nr,
    +-			    N_("number of entries to include in detail tables")),
    +-
    +-		OPT_BOOL_F(0, "all-refs", &ctx.opts.refs.want_all_refs, N_("include all refs"),          PARSE_OPT_NONEG),
    +-
    +-		OPT_BOOL_F(0, "branches", &ctx.opts.refs.want_branches, N_("include branches"),          PARSE_OPT_NONEG),
    +-		OPT_BOOL_F(0, "tags",     &ctx.opts.refs.want_tags,     N_("include tags"),              PARSE_OPT_NONEG),
    +-		OPT_BOOL_F(0, "remotes",  &ctx.opts.refs.want_remotes,  N_("include all remotes refs"),  PARSE_OPT_NONEG),
    +-		OPT_BOOL_F(0, "detached", &ctx.opts.refs.want_detached, N_("include detached HEAD"),     PARSE_OPT_NONEG),
    +-		OPT_BOOL_F(0, "other",    &ctx.opts.refs.want_other,    N_("include notes and stashes"), PARSE_OPT_NONEG),
    +-
    +-		OPT_END(),
    +-	};
    +-
    +-	show_usage_with_options_if_asked(argc, argv,
    +-					 survey_usage, survey_options);
    +-
    +-	if (isatty(2))
    +-		color_fprintf_ln(stderr,
    +-				 want_color_fd(2, GIT_COLOR_AUTO) ? GIT_COLOR_YELLOW : "",
    +-				 "(THIS IS EXPERIMENTAL, EXPECT THE OUTPUT FORMAT TO CHANGE!)");
    +-
    +-	ctx.repo = repo;
    +-
    +-	prepare_repo_settings(ctx.repo);
    +-	survey_load_config(&ctx);
    +-
    +-	argc = parse_options(argc, argv, prefix, survey_options, survey_usage, 0);
    +-
    +-	if (ctx.opts.show_progress < 0)
    +-		ctx.opts.show_progress = isatty(2);
    +-
    +-	fixup_refs_wanted(&ctx);
    +-
    +-	survey_phase_refs(&ctx);
    +-
    +-	survey_phase_objects(&ctx);
    +-
    +-	survey_report_plaintext(&ctx);
    +-
    +-	clear_survey_context(&ctx);
    +-	return 0;
    +->>>>>>> 52ca1113d6 (wincred: prevent silent credential loss when storing OAuth tokens)
    + }
    +
    + ## ci/lib.sh ##
    + remerge CONFLICT (content): Merge conflict in ci/lib.sh
    + index 1f13719ebe..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" ||
    +-<<<<<<< 6659352e7e (Drop Windows 7 support (#6325))
    + case "$CI_EVENT,$CI_BRANCH" in
    +-=======
    +-case "$GITHUB_EVENT_NAME,$CI_BRANCH" in
    +->>>>>>> 52ca1113d6 (wincred: prevent silent credential loss when storing OAuth tokens)
    + pull_request,*|push,*next*|push,*master*|push,*main*|push,*maint*)
    + 	export GIT_TEST_LONG=${GIT_TEST_LONG:-true}
    + 	;;
    +
      ## compat/win32/path-utils.c ##
    + remerge CONFLICT (content): Merge conflict in compat/win32/path-utils.c
    + index 644033dcb6..84b620756a 100644
    + --- compat/win32/path-utils.c
    + +++ compat/win32/path-utils.c
     @@
    + 
      #include "../../git-compat-util.h"
      #include "../../environment.h"
    +-<<<<<<< 6659352e7e (Drop Windows 7 support (#6325))
      #include "../../repository.h"
    -+#include "../../wrapper.h"
    -+#include "../../strbuf.h"
    -+#include "../../versioncmp.h"
    +-=======
    + #include "../../wrapper.h"
    + #include "../../strbuf.h"
    + #include "../../versioncmp.h"
    +->>>>>>> 52ca1113d6 (wincred: prevent silent credential loss when storing OAuth tokens)
      
      int win32_has_dos_drive_prefix(const char *path)
      {
    -@@ compat/win32/path-utils.c: 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);
    -+}
     
    - ## compat/win32/path-utils.h ##
    -@@ compat/win32/path-utils.h: int win32_fspathcmp(const char *a, const char *b);
    - int win32_fspathncmp(const char *a, const char *b, size_t count);
    - #define fspathncmp win32_fspathncmp
    - 
    -+void win32_warn_about_git_lfs_on_windows7(int exit_code, const char *argv0);
    -+#define warn_about_git_lfs_on_windows7 win32_warn_about_git_lfs_on_windows7
    -+
    - #endif
    + ## t/t1517-outside-repo.sh ##
    + remerge CONFLICT (content): Merge conflict in t/t1517-outside-repo.sh
    + index f0ba23fbab..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 | \
    +-<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 6659352e7e (Drop Windows 7 support (#6325))
    + 	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 ;;
    +->>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 52ca1113d6 (wincred: prevent silent credential loss when storing OAuth tokens)
    + 	*)
    + 		h_expect_outcome=expect_success
    + 		all_expect_outcome=expect_success
     
    - ## git-compat-util.h ##
    -@@ git-compat-util.h: static inline int git_offset_1st_component(const char *path)
    - #define fspathncmp git_fspathncmp
    - #endif
    + ## t/t6403-merge-file.sh ##
    + remerge CONFLICT (content): Merge conflict in t/t6403-merge-file.sh
    + index bfaff5ffa4..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 &&
    +-<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 6659352e7e (Drop Windows 7 support (#6325))
    + 	test_grep "Cannot merge binary files" merge.err
    +-================================
    +-	grep "Cannot merge binary files" merge.err
    +->>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 52ca1113d6 (wincred: prevent silent credential loss when storing OAuth tokens)
    + '
      
    -+#ifndef warn_about_git_lfs_on_windows7
    -+static inline void warn_about_git_lfs_on_windows7(int exit_code UNUSED,
    -+						  const char *argv0 UNUSED)
    -+{
    -+}
    -+#endif
    -+
    - #ifndef is_valid_path
    - #define is_valid_path(path) 1
    - #endif
    + test_expect_success 'binary files cannot be merged with --object-id' '
     
    - ## refs/reftable-backend.c ##
    -@@ refs/reftable-backend.c: static struct ref_store *reftable_be_init(struct repository *repo,
    + ## t/t8100-git-survey.sh ##
    + remerge CONFLICT (add/add): Merge conflict in t/t8100-git-survey.sh
    + index 5c9fbfb0d4..dec9d81ec6 100755
    + --- t/t8100-git-survey.sh
    + +++ t/t8100-git-survey.sh
    +@@
    + #!/bin/sh
      
    - 	reftable_set_alloc(malloc, realloc, free);
    +-<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 6659352e7e (Drop Windows 7 support (#6325))
    + test_description='git survey (deprecated shim over `git repo structure`)'
    +-================================
    +-test_description='git survey'
    +->>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 52ca1113d6 (wincred: prevent silent credential loss when storing OAuth tokens)
      
    -+	reftable_set_alloc(malloc, realloc, free);
    -+
    - 	refs_compute_filesystem_location(gitdir, payload, &is_worktree, &refdir,
    - 					 &ref_common_dir);
    + GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
    + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
    +@@ t/t8100-git-survey.sh: export TEST_PASSES_SANITIZE_LEAK
      
    -
    - ## run-command.c ##
    -@@ run-command.c: static int wait_or_whine(pid_t pid, const char *argv0, int in_signal)
    - 		 */
    - 		code += 128;
    - 	} else if (WIFEXITED(status)) {
    -+		warn_about_git_lfs_on_windows7(status, argv0);
    - 		code = WEXITSTATUS(status);
    - 	} else {
    - 		if (!in_signal)
    + . ./test-lib.sh
    + 
    +-<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 6659352e7e (Drop Windows 7 support (#6325))
    + test_expect_success 'git survey -h shows the deprecated banner' '
    + 	test_expect_code 129 git survey -h >usage &&
    + 	grep "DEPRECATED!" usage
    +-================================
    +-test_expect_success 'git survey -h shows experimental warning' '
    +-	test_expect_code 129 git survey -h >usage &&
    +-	grep "EXPERIMENTAL!" usage
    +->>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 52ca1113d6 (wincred: prevent silent credential loss when storing OAuth tokens)
    + '
    + 
    + test_expect_success 'create a semi-interesting repo' '
    +@@ t/t8100-git-survey.sh: test_expect_success 'create a semi-interesting repo' '
    + 	git update-ref -d refs/tags/two
    + '
    + 
    +-<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 6659352e7e (Drop Windows 7 support (#6325))
    + test_expect_success 'survey prints a deprecation warning' '
    + 	git survey --all-refs >out 2>err &&
    + 	grep "is deprecated" err
    +@@ t/t8100-git-survey.sh: test_expect_success 'survey --branches translates to a refs/heads/* filter' '
    + 	git repo structure --top=10 \
    + 		--ref-filter="refs/heads/*" >expected &&
    + 	test_cmp expected out
    +-================================
    +-test_expect_success 'git survey --progress' '
    +-	GIT_PROGRESS_DELAY=0 git survey --all-refs --progress >out 2>err &&
    +-	grep "Preparing object walk" err
    +-'
    +-
    +-approximate_sizes() {
    +-	# very simplistic approximate rounding
    +-	sed -Ee "s/  *(1[0-9][0-9])( |$)/ ~0.1kB\2/g" \
    +-	  -e "s/  *(4[6-9][0-9]|5[0-6][0-9])( |$)/ ~0.5kB\2/g" \
    +-	  -e "s/  *(5[6-9][0-9]|6[0-6][0-9])( |$)/ ~0.6kB\2/g" \
    +-	  -e "s/  *1(4[89][0-9]|5[0-8][0-9])( |$)/ ~1.5kB\2/g" \
    +-	  -e "s/  *1(69[0-9]|7[0-9][0-9])( |$)/ ~1.7kB\2/g" \
    +-	  -e "s/  *1(79[0-9]|8[0-9][0-9])( |$)/ ~1.8kB\2/g" \
    +-	  -e "s/  *2(1[0-9][0-9]|20[0-1])( |$)/ ~2.1kB\2/g" \
    +-	  -e "s/  *2(3[0-9][0-9]|4[0-1][0-9])( |$)/ ~2.3kB\2/g" \
    +-	  -e "s/  *2(5[0-9][0-9]|6[0-1][0-9])( |$)/ ~2.5kB\2/g" \
    +-	 "$@"
    +-}
    +-
    +-test_expect_success 'git survey (default)' '
    +-	git survey --all-refs >out 2>err &&
    +-	test_line_count = 0 err &&
    +-
    +-	test_oid_cache <<-EOF &&
    +-	commits_sizes sha1:~1.5kB | ~2.1kB
    +-	commits_sizes sha256:~1.8kB | ~2.5kB
    +-	trees_sizes sha1:~0.5kB | ~1.7kB
    +-	trees_sizes sha256:~0.6kB | ~2.3kB
    +-	blobs_sizes sha1:~0.1kB | ~0.1kB
    +-	blobs_sizes sha256:~0.1kB | ~0.1kB
    +-	tags_sizes sha1:~0.5kB | ~0.5kB
    +-	tags_sizes sha256:~0.5kB | ~0.6kB
    +-	EOF
    +-
    +-	tr , " " >expect <<-EOF &&
    +-	GIT SURVEY for "$(pwd)"
    +-	-----------------------------------------------------
    +-
    +-	REFERENCES SUMMARY
    +-	========================
    +-	,       Ref Type | Count
    +-	-----------------+------
    +-	,       Branches |     1
    +-	     Remote refs |     0
    +-	      Tags (all) |     2
    +-	Tags (annotated) |     2
    +-
    +-	REACHABLE OBJECT SUMMARY
    +-	========================
    +-	Object Type | Count
    +-	------------+------
    +-	       Tags |     4
    +-	    Commits |    10
    +-	      Trees |    10
    +-	      Blobs |    10
    +-
    +-	TOTAL OBJECT SIZES BY TYPE
    +-	===============================================
    +-	Object Type | Count | Disk Size | Inflated Size
    +-	------------+-------+-----------+--------------
    +-	    Commits |    10 | $(test_oid commits_sizes)
    +-	      Trees |    10 | $(test_oid trees_sizes)
    +-	      Blobs |    10 | $(test_oid blobs_sizes)
    +-	       Tags |     4 | $(test_oid tags_sizes)
    +-	EOF
    +-
    +-	approximate_sizes out >out-edited &&
    +-	lines=$(wc -l <expect) &&
    +-	head -n "$lines" <out-edited >out-trimmed &&
    +-	test_cmp expect out-trimmed &&
    +-
    +-	for type in "DIRECTORIES" "FILES"
    +-	do
    +-		for metric in "COUNT" "DISK SIZE" "INFLATED SIZE"
    +-		do
    +-			grep "TOP $type BY $metric" out || return 1
    +-		done || return 1
    +-	done
    +->>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 52ca1113d6 (wincred: prevent silent credential loss when storing OAuth tokens)
    + '
    + 
    + test_done

To: 8980887aa3 (Merge tag 'v2.55.0.windows.3', 2026-07-16) (cfb965a8c3..8980887aa3)

Statistics

Metric Count
Total conflicts 1
Skipped (upstreamed) 0
Resolved surgically 1
Range-diff (click to expand)
  • 1: e74765e = 1: 2a58639 mingw: skip symlink type auto-detection for network share targets
  • 2: fb0010c = 2: 8cc3545 unix-socket: avoid leak when initialization fails
  • 3: af175f4 = 3: b1d3d72 Merge branch 'prevent-accidental-ntlm-exfiltration-via-symlinks'
  • 4: fcd8f93 = 4: ebd1176 grep: prevent ^$ false match at end of file
  • 5: 0f69291 = 5: bdd572f Merge branch 'v2.53.0.windows.3'
  • 6: 3904e9f = 6: cda7d2b Merge branch 'fixes-from-the-git-mailing-list'
  • 7: bb4f1d2 = 7: de01e9f t9350: point out that refs are not updated correctly
  • 8: 79099ce = 8: 4658cd8 transport-helper: add trailing --
  • 9: 6ecd5af = 9: 899f777 remote-helper: check helper status after import/export
  • 10: d5d30df = 10: 79aedff ci: bump actions/checkout from 6 to 7
  • 11: 192da6c = 11: 50632fc Always auto-gc after calling a fast-import transport
  • 13: e91081d = 12: 72a7918 mingw: include the Python parts in the build
  • 15: ccc8080 = 13: a4bd9f8 windows: skip linking git-<command> for built-ins
  • 17: 1c1e1db = 14: 10e67d7 mingw: stop hard-coding CC = gcc
  • 19: 6ee88bc = 15: c41f86c mingw: drop the -D_USE_32BIT_TIME_T option
  • 21: 6950c6e = 16: 11d2b29 mingw: only use -Wl,--large-address-aware for 32-bit builds
  • 23: 8b4f56e = 17: 9ae4a86 mingw: avoid over-specifying --pic-executable
  • 25: 6d702fa = 18: 1e3da76 mingw: set the prefix and HOST_CPU as per MSYS2's settings
  • 27: 22b9545 = 19: d042895 mingw: only enable the MSYS2-specific stuff when compiling in MSYS2
  • 29: 0c7115b = 20: 95bdbe2 mingw: rely on MSYS2's metadata instead of hard-coding it
  • 31: b97559e = 21: 1a717ca mingw: always define ETC_* for MSYS2 environments
  • 12: f0b49a4 = 22: 31023ad ci(vs-build): adapt to Visual Studio 2026 default on windows-latest
  • 34: 038f8dd = 23: 98a73ad max_tree_depth: lower it for clang builds in general on Windows
  • 14: 18f544c = 24: 4fcbf52 vcpkg_install: detect lack of Git
  • 42: e7e26f9 = 25: 247dec3 mingw: ensure valid CTYPE
  • 16: 297412d = 26: 610861f vcpkg_install: add comment regarding slow network connections
  • 35: 1d22503 = 27: 34ec1a7 t5505/t5516: allow running without .git/branches/ in the templates
  • 65: 6cfb0f5 = 28: 9ba48d6 mingw: allow git.exe to be used instead of the "Git wrapper"
  • 18: 39607dc = 29: dbcb06c vcbuild: install ARM64 dependencies when building ARM64 binaries
  • 43: 12fa508 = 30: c7a814e t5505/t5516: fix white-space around redirectors
  • 67: 0541790 = 31: 495494b mingw: ignore HOMEDRIVE/HOMEPATH if it points to Windows' system directory
  • 20: cf68816 = 32: f1681e6 vcbuild: add an option to install individual 'features'
  • 69: 99d6b06 = 33: 5d6f56c Merge branch 'dscho-avoid-d-f-conflict-in-vs-master'
  • 22: 91e6f14 = 34: bbb1c57 cmake: allow building for Windows/ARM64
  • 71: 89df221 = 35: e7ebbd8 clink.pl: fix libexpatd.lib link error when using MSVC
  • 24: c01ccb7 = 36: 996c206 ci(vs-build) also build Windows/ARM64 artifacts
  • 73: 345fe34 = 37: 0aa08b8 Makefile: clean up .ilk files when MSVC=1
  • 26: 71310ff = 38: fefa7a5 vcbuild: stop hard-coding OpenSSL as a dependency
  • 75: 366f961 = 39: ce807b0 vcbuild: add support for compiling Windows resource files
  • 28: 93b9fc2 = 40: d2dad25 cmake(): allow setting HOST_CPU for cross-compilation
  • 77: d5e4b40 = 41: 455887f config.mak.uname: add git.rc to MSVC builds
  • 44: 27db6f5 = 42: 3e0aee7 MinGW: link as terminal server aware
  • 30: 15b3db7 = 43: b51ea39 CMake: default Visual Studio generator has changed
  • 81: 64710cb = 44: 9213dcd clink.pl: ignore no-stack-protector arg on MSVC=1 builds
  • 82: 9ab6761 = 45: 306ac08 http: optionally load libcurl lazily
  • 32: 12bbc6d = 46: e9cd7a2 mingw: demonstrate a git add issue with NTFS junctions
  • 33: c4b27c6 = 47: ef07469 .gitignore: add Visual Studio CMakeSetting.json file
  • 86: d0380da = 48: 1442ac4 clink.pl: move default linker options for MSVC=1 builds
  • 87: ce4f0df = 49: 2ec6bb2 http: support lazy-loading libcurl also on Windows
  • 36: 7ef0dae = 50: 9d2277d strbuf_realpath(): use platform-dependent API if available
  • 37: 9ef27f3 = 51: ec157b3 http: use new "best effort" strategy for Secure Channel revoke checking
  • 38: 7764783 = 52: 3ed8e1d subtree: update contrib/subtree test target
  • 39: 20697e2 = 53: bee6f21 CMakeLists: add default "x64-windows" arch for Visual Studio
  • 40: 1d1f009 = 54: cd02882 setup: properly use "%(prefix)/" when in WSL
  • 41: 706f269 = 55: fdc9fb5 Add config option windows.appendAtomically
  • 91: ba2dabd = 56: f19575c cmake: install headless-git.
  • 92: 0f64cbb = 57: 98f511f http: when loading libcurl lazily, allow for multiple SSL backends
  • 45: da50c9b = 58: 9ee30a1 mingw: prevent regressions with "drive-less" absolute paths
  • 46: 0625291 = 59: 19f181f transport: optionally disable side-band-64k
  • 47: bc8d864 = 60: b0abf63 mingw: fix fatal error working on mapped network drives on Windows
  • 48: 1213ab3 = 61: a4f727a clink.pl: fix MSVC compile script to handle libcurl-d.lib
  • 49: d636a20 = 62: 9bd369f mingw: implement a platform-specific strbuf_realpath()
  • 50: 347274f = 63: 6fb8f62 t3701: verify that we can add lots of files interactively
  • 51: 377fda3 = 64: 5fe1dcc commit: accept "scissors" with CR/LF line endings
  • 52: 369987c = 65: d190210 t0014: fix indentation
  • 53: 39ed498 = 66: a76f464 git-gui: accommodate for intent-to-add files
  • 54: 6b5c8fa = 67: dd4777f mingw: allow for longer paths in parse_interpreter()
  • 55: addbc39 = 68: f0a6eeb compat/vcbuild: document preferred way to build in Visual Studio
  • 56: 9b0c070 = 69: d91c94d http: optionally send SSL client certificate
  • 57: 58018f9 = 70: b0a3387 ci: run contrib/subtree tests in CI builds
  • 58: 212d239 = 71: 7e1813d CMake: show Win32 and Generator_platform build-option values
  • 59: d35a54b = 72: 165fcf3 compat/mingw.c: do not warn when failing to get owner
  • 60: 78e849d = 73: 6950d90 mingw: $env:TERM="xterm-256color" for newer OSes
  • 61: 3498391 = 74: bdf8bd6 winansi: check result and Buffer before using Name
  • 62: a2bff4a = 75: 53b4037 mingw: change core.fsyncObjectFiles = 1 by default
  • 63: 0f1f2a3 = 76: 7dd1675 Fix Windows version resources
  • 64: be6c692 = 77: f2f8a10 status: fix for old-style submodules with commondir
  • 96: 6b48079 = 78: 7823218 git.rc: include winuser.h
  • 97: 0b5c379 = 79: 6cb9cf9 mingw: do load libcurl dynamically by default
  • 98: b80e13d = 80: 26e7245 Add a GitHub workflow to verify that Git/Scalar work in Nano Server
  • 99: 0b1db73 = 81: 858b147 mingw: suggest windows.appendAtomically in more cases
  • 66: 58b99d6 = 82: 5ae699b revision: create mark_trees_uninteresting_dense()
  • 68: bf5b550 = 83: f26d92c survey: stub in new experimental 'git-survey' command
  • 70: 52b3fc9 = 84: e106e32 survey: add command line opts to select references
  • 72: b25405d = 85: 5b98090 survey: start pretty printing data in table form
  • 125: 06843ef = 86: c6648ad mingw: Support git_terminal_prompt with more terminals
  • 74: 08ce501 = 87: 08340e7 survey: add object count summary
  • 127: d6bc532 = 88: 1b9ad38 compat/terminal.c: only use the Windows console if bash 'read -r' fails
  • 76: 1074c85 = 89: 2c621b0 survey: summarize total sizes by object type
  • 129: 10001ca = 90: bc229a0 mingw (git_terminal_prompt): do fall back to CONIN$/CONOUT$ method
  • 78: e5d6874 = 91: 5b1b666 survey: show progress during object walk
  • 79: 5bda55e = 92: 19fe94b mingw: make sure errno is set correctly when socket operations fail
  • 80: 62abd84 = 93: 92febc6 t5563: verify that NTLM authentication works
  • 133: 6585115 = 94: fe9dc91 mingw: introduce code to detect whether we're inside a Windows container
  • 83: 3585497 = 95: c45a725 survey: add ability to track prioritized lists
  • 84: 33d9828 = 96: a62bdd9 compat/mingw: handle WSA errors in strerror
  • 85: ce5d0ba = 97: 51c3813 http: disallow NTLM authentication by default
  • 137: 001a048 = 98: 34e065a mingw: when running in a Windows container, try to rename() harder
  • 131: e607c01 = 99: 4b57e33 Win32: symlink: move phantom symlink creation to a separate function
  • 88: 8eb42d4 = 100: 6f02dde survey: add report of "largest" paths
  • 89: ad71304 = 101: 36170bf compat/mingw: drop outdated comment
  • 90: 0302f8b = 102: 35e0645 http: warn if might have failed because of NTLM
  • 141: 212f350 = 103: 2ac2262 mingw: move the file_attr_to_st_mode() function definition
  • 134: ffd3af7 = 104: 3a4b91e Introduce helper to create symlinks that knows about index_state
  • 93: e8d6291 = 105: ff4bb84 survey: add --top= option and config
  • 94: 00a7077 = 106: a9459d5 t0301: actually test credential-cache on Windows
  • 95: fc6bd9b = 107: 4f5ebab credential: advertise NTLM suppression and allow helpers to re-enable
  • 145: f9c112d = 108: 330b9bb mingw: Windows Docker volumes are not symbolic links
  • 138: 80643a6 = 109: 37f8a35 mingw: allow to specify the symlink type in .gitattributes
  • 100: 32bd825 = 110: 7178c1b win32: use native ANSI sequence processing, if possible
  • 101: 9c92293 = 111: fb30e80 common-main.c: fflush stdout buffer upon exit
  • 102: 403411a = 112: 2f51dd8 t5601/t7406(mingw): do run tests with symlink support
  • 103: 6995879 = 113: 741167e Fallback to AppData if XDG_CONFIG_HOME is unset
  • 104: 739a9a3 = 114: b73a470 run-command: be helpful with Git LFS fails on Windows 7
  • 105: 7341c45 = 115: cea3ce4 survey: clearly note the experimental nature in the output
  • 106: 95d7f4e = 116: 599ca2c credential-cache: handle ECONNREFUSED gracefully
  • 107: a89cc9b = 117: b7191b0 reftable: do make sure to use custom allocators
  • 108: 2b3e781 = 118: a936ca8 check-whitespace: avoid alerts about upstream commits
  • 109: b93e3b0 = 119: 2a45397 t/t5571-prep-push-hook.sh: Add test with writing to stderr
  • 110: 3e9b176 = 120: f9a0c33 dir: do not traverse mount points
  • 111: 3405235 = 121: ae1e324 win32: thread-utils: handle multi-socket systems
  • 112: 63e8563 = 122: 28f222c t5563: add tests for http.emptyAuth with Negotiate
  • 113: f980e21 = 123: 8519609 entry: flush fscache after creating directories and writing files
  • 155: 57ceae4 = 124: 541c218 ci(macos): skip the git p4 tests
  • 156: 2bc43fa = 125: e7741d4 mingw: work around rename() failing on a read-only file
  • 114: 55da9f6 = 126: d267378 diff-delta: widen struct delta_index size fields to size_t
  • 115: 2d7d84a = 127: 2d4d024 delta: widen create_delta_index() parameter to size_t
  • 116: 7f9860a = 128: 0f22e60 pack-objects: widen delta-cache accounting to size_t
  • 117: b7dc36d = 129: 7124643 pack-objects: widen free_unpacked() return to size_t
  • 118: e03f255 = 130: 3c5edb9 pack-objects: widen mem_usage and try_delta out-param to size_t
  • 119: e5a7dd7 = 131: 62b1eee delta: widen create_delta() and diff_delta() to size_t
  • 120: 4d72c31 = 132: 0435385 packfile, git-zlib: widen use_pack() and zstream avail fields to size_t
  • 121: eff0b09 = 133: 33961cc archive-zip: widen zlib_deflate_raw()'s maxsize local to size_t
  • 122: 2244177 = 134: b082b1d diff: widen deflate_it()'s bound local from int to size_t
  • 123: ee58c48 = 135: a6b209d http-push: widen start_put()'s size local from ssize_t to size_t
  • 124: 6e897c2 = 136: 60d4e81 t/helper/test-pack-deltas: widen do_compress()'s maxsize local to size_t
  • 126: 8cc7f10 = 137: 68cdf57 git-zlib: widen git_deflate_bound() to size_t
  • 128: 52509c5 = 138: 5b1cd92 diff: stop truncating the deflated-binary-diff size on Windows
  • 130: 1a7387c = 139: 9d1c5a7 convert: widen gather_convert_stats() helpers to size_t
  • 132: c66da83 = 140: cfe55f9 read-cache: stop truncating index blob sizes on Windows
  • 135: 4e4caf6 = 141: 9548f25 xdiff-interface: widen buffer_is_binary() size parameter to size_t
  • 136: f8b34cc = 142: 60f536e tree-walk: drop link_len cast in get_tree_entry_follow_symlinks()
  • 139: b13e725 = 143: ea3bbae combine-diff: stop truncating combined-diff blob sizes on Windows
  • 140: d230deb = 144: df3b018 tree-walk: widen init_tree_desc() and init_tree_desc_gently() to size_t
  • 142: 9512fd4 = 145: 2a90dbc Win32: symlink: add test for symlink attribute
  • 143: a82b05d = 146: 59f9c2f diff: widen textconv_object() size out-param to size_t
  • 144: a6886fa = 147: 5f2bde1 pack-objects: drop the two tree-walk casts in the preferred-base path
  • 146: 0bb3ec5 = 148: 752766d clean: do not traverse mount points
  • 147: a6d983c = 149: bd847ea pack-bitmap: stop truncating blob sizes used by --filter=blob:limit
  • 160: 9b3af8b = 150: 4dca475 Merge branch 'size-t/pack-objects-delta'
  • 148: a866d10 = 151: 19eaecd diffcore: widen struct diff_filespec.size to size_t
  • 149: 87ee7f7 = 152: 0ace1de diff-delta: widen sizeof_delta_index() return to size_t
  • 150: dadfbaa = 153: 27b2215 tree: widen struct tree.size and parse_tree_buffer() to size_t
  • 151: cbf266d = 154: 9891430 commit: widen the commit-buffer API to size_t
  • 152: fa7390b = 155: b81bd86 blame: widen find_line_starts() len parameter to size_t
  • 153: b83ec3a = 156: c03d94a grep: widen struct grep_source.size and grep_buffer() to size_t
  • 154: 00faccd = 157: 507d0aa fast-export: drop the export_blob() size cast and widen anonymize_blob()
  • 168: 9d3b20e = 158: 60831bd repo: drop the inflated-size cast in count_objects()
  • 170: d9ce312 = 159: ca510b5 unpack-objects: widen the size-passing infrastructure to size_t
  • 157: 13bcdfe = 160:

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

derrickstolee and others added 30 commits July 19, 2026 19:03
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>
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>
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>
Git LFS is now built with Go 1.21 which no longer supports Windows 7.
However, Git for Windows still wants to support Windows 7.

Ideally, Git LFS would re-introduce Windows 7 support until Git for
Windows drops support for Windows 7, but that's not going to happen:
git-for-windows#4996 (comment)

The next best thing we can do is to let the users know what is
happening, and how to get out of their fix, at least.

This is not quite as easy as it would first seem because programs
compiled with Go 1.21 or newer will simply throw an exception and fail
with an Access Violation on Windows 7.

The only way I found to address this is to replicate the logic from Go's
very own `version` command (which can determine the Go version with
which a given executable was built) to detect the situation, and in that
case offer a helpful error message.

This addresses git-for-windows#4996.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
The sparse tree walk algorithm was created in d5d2e93 (revision:
implement sparse algorithm, 2019-01-16) and involves using the
mark_trees_uninteresting_sparse() method. This method takes a repository
and an oidset of tree IDs, some of which have the UNINTERESTING flag and
some of which do not.

Create a method that has an equivalent set of preconditions but uses a
"dense" walk (recursively visits all reachable trees, as long as they
have not previously been marked UNINTERESTING). This is an important
difference from mark_tree_uninteresting(), which short-circuits if the
given tree has the UNINTERESTING flag.

A use of this method will be added in a later change, with a condition
set whether the sparse or dense approach should be used.

Signed-off-by: Derrick Stolee <stolee@gmail.com>
While this command is definitely something we _want_, chances are that
upstreaming this will require substantial changes.

We still want to be able to experiment with this before that, to focus
on what we need out of this command: To assist with diagnosing issues
with large repositories, as well as to help monitoring the growth and
the associated painpoints of such repositories.

To that end, we are about to integrate this command into
`microsoft/git`, to get the tool into the hands of users who need it
most, with the idea to iterate in close collaboration between these
users and the developers familar with Git's internals.

However, we will definitely want to avoid letting anybody have the
impression that this command, its exact inner workings, as well as its
output format, are anywhere close to stable. To make that fact utterly
clear (and thereby protect the freedom to iterate and innovate freely
before upstreaming the command), let's mark its output as experimental
in all-caps, as the first thing we do.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
In 245670c (credential-cache: check for windows specific errors, 2021-09-14)
we concluded that on Windows we would always encounter ENETDOWN where we
would expect ECONNREFUSED on POSIX systems, when connecting to unix sockets.
As reported in [1], we do encounter ECONNREFUSED on Windows if the
socket file doesn't exist, but the containing directory does and ENETDOWN if
neither exists. We should handle this case like we do on non-windows systems.

[1] git-for-windows#4762 (comment)

This fixes git-for-windows#5314

Helped-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>
The reftable library goes out of its way to use its own set of allocator
functions that can be configured using `reftable_set_alloc()`. However,
Git does not configure this.

That is not typically a problem, except when Git uses a custom allocator
via some definitions in `git-compat-util.h`, as is the case in Git for
Windows (which switched away from the long-unmaintained nedmalloc to
mimalloc).

Then, it is quite possible that Git assigns a `strbuf` (allocated via
the custom allocator) to, say, the `refname` field of a
`reftable_log_record` in `write_transaction_table()`, and later on asks
the reftable library function `reftable_log_record_release()` to release
it, but that function was compiled without using `git-compat-util.h` and
hence calls regular `free()` (i.e. _not_ the custom allocator's own
function).

This has been a problem for a long time and it was a matter of some sort
of "luck" that 1) reftables are not commonly used on Windows, and 2)
mimalloc can often ignore gracefully when it is asked to release memory
that it has not allocated.

However, a recent update to `seen` brought this problem to the
forefront, letting t1460 fail in Git for Windows, with symptoms much in
the same way as the problem I had to address in d02c37c
(t-reftable-basics: allow for `malloc` to be `#define`d, 2025-01-08)
where exit code 127 was also produced in lieu of
`STATUS_HEAP_CORRUPTION` (C0000374) because exit codes are only 7 bits
wide.

It was not possible to figure out what change in particular caused these
new failures within a reasonable time frame, as there are too many
changes in `seen` that conflict with Git for Windows' patches, I had to
stop the investigation after spending four hours on it fruitlessly.

To verify that this patch fixes the issue, I avoided using mimalloc and
temporarily patched in a "custom allocator" that would more reliably
point out problems, like this:

  diff --git a/refs/reftable-backend.c b/refs/reftable-backend.c
  index 68f3829..9421d630b9f5 100644
  --- a/refs/reftable-backend.c
  +++ b/refs/reftable-backend.c
  @@ -353,6 +353,69 @@ static int reftable_be_fsync(int fd)
   	return fsync_component(FSYNC_COMPONENT_REFERENCE, fd);
   }

  +#define DEBUG_REFTABLE_ALLOC
  +#ifdef DEBUG_REFTABLE_ALLOC
  +#include "khash.h"
  +
  +static inline khint_t __ac_X31_hash_ptr(void *ptr)
  +{
  +	union {
  +		void *ptr;
  +		char s[sizeof(void *)];
  +	} u;
  +	size_t i;
  +	khint_t h;
  +
  +	u.ptr = ptr;
  +	h = (khint_t)*u.s;
  +	for (i = 0; i < sizeof(void *); i++)
  +		h = (h << 5) - h + (khint_t)u.s[i];
  +	return h;
  +}
  +
  +#define kh_ptr_hash_func(key) __ac_X31_hash_ptr(key)
  +#define kh_ptr_hash_equal(a, b) ((a) == (b))
  +
  +KHASH_INIT(ptr, void *, int, 0, kh_ptr_hash_func, kh_ptr_hash_equal)
  +
  +static kh_ptr_t *my_malloced;
  +
  +static void *my_malloc(size_t sz)
  +{
  +	int dummy;
  +	void *ptr = malloc(sz);
  +	if (ptr)
  +		kh_put_ptr(my_malloced, ptr, &dummy);
  +	return ptr;
  +}
  +
  +static void *my_realloc(void *ptr, size_t sz)
  +{
  +	int dummy;
  +	if (ptr) {
  +		khiter_t pos = kh_get_ptr(my_malloced, ptr);
  +		if (pos >= kh_end(my_malloced))
  +			die("Was not my_malloc()ed: %p", ptr);
  +		kh_del_ptr(my_malloced, pos);
  +	}
  +	ptr = realloc(ptr, sz);
  +	if (ptr)
  +		kh_put_ptr(my_malloced, ptr, &dummy);
  +	return ptr;
  +}
  +
  +static void my_free(void *ptr)
  +{
  +	if (ptr) {
  +		khiter_t pos = kh_get_ptr(my_malloced, ptr);
  +		if (pos >= kh_end(my_malloced))
  +			die("Was not my_malloc()ed: %p", ptr);
  +		kh_del_ptr(my_malloced, pos);
  +	}
  +	free(ptr);
  +}
  +#endif
  +
   static struct ref_store *reftable_be_init(struct repository *repo,
   					  const char *gitdir,
   					  unsigned int store_flags)
  @@ -362,6 +425,11 @@ static struct ref_store *reftable_be_init(struct repository *repo,
   	int is_worktree;
   	mode_t mask;

  +#ifdef DEBUG_REFTABLE_ALLOC
  +	my_malloced = kh_init_ptr();
  +	reftable_set_alloc(my_malloc, my_realloc, my_free);
  +#endif
  +
   	mask = umask(0);
   	umask(mask);

I briefly considered contributing this "custom allocator" patch, too,
but it is unwieldy (for example, it would not work at all when compiling
with mimalloc support) and it would only waste space (or even time, if a
compile flag was introduced and exercised as part of the CI builds).
Given that it is highly unlikely that Git will lose the new
`reftable_set_alloc()` call by mistake, I rejected that idea as simply
too wasteful.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Every once in a while, whitespace errors are introduced in Git for
Windows' rebases to newer Git versions, simply by virtue of integrating
upstream commits that do not follow upstream Git's own whitespace rule.
In Git v2.50.0-rc0, for example, 03f2915 (xdiff: disable
cleanup_records heuristic with --minimal, 2025-04-29) introduced a
trailing space.

Arguably, non-actionable alerts are worse than no alerts at all, so
let's suppress those alerts that we cannot do anything about, anyway.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
The 2.53.0.rc0.windows release candidate had a regression where
writing to stderr from a pre-push hook would error out.

The regression was fixed in 2.53.0.rc1.windows and the test here ensures
that this stays fixed.

Signed-off-by: Thomas Braun <thomas.braun@virtuell-zuhause.de>
The previous commits disabled NTLM authentication by default due to its
cryptographic weaknesses. Users can re-enable it via the config setting
http.<url>.allowNTLMAuth, but this requires manual intervention.

Credential helpers may have knowledge about which servers are trusted
for NTLM authentication (e.g., known on-prem Azure DevOps instances).
To allow them to signal this trust, introduce a simple negotiation:
when NTLM is suppressed and the server offered it, Git advertises
ntlm=suppressed to the credential helper. The helper can respond with
ntlm=allow to re-enable NTLM for this request.

This happens precisely at the point where we would otherwise warn the
user about NTLM being suppressed, ensuring the capability is only
advertised when relevant.

Helped-by: Matthew John Cheetham <mjcheetham@outlook.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
It was already decided in ef22148 (clean: do not traverse mount points,
2018-12-07) that we shouldn't traverse NTFS junctions/bind mounts when
using `git clean`, partly because they're sometimes used in worktrees.
But the same check wasn't applied to `remove_dir_recurse()` in `dir.c`,
which `git worktree remove` uses. So removing a worktree suffers the
same problem we had previously with `git clean`.

Let's add the same guard from ef22148.

Signed-off-by: Maks Kuznia <makskuznia244@gmail.com>
While the currently used way to detect the number of CPU cores on
Windows is nice and straight-forward, GetSystemInfo() only gives us
access to the number of processors within the current group. [1]

While that is usually fine for systems with a single physical CPU,
separate physical sockets are typically separate groups.

Switch to using GetLogicalProcessorInformationEx() to handle multi-socket
systems better.

[1] https://learn.microsoft.com/en-us/windows/win32/api/sysinfoapi/ns-sysinfoapi-system_info#members

This fixes git-for-windows#4766

Co-Authored-by: Herman Semenov <GermanAizek@yandex.ru>
Signed-off-by: Matthias Aßhauer <mha1993@live.de>
Add tests exercising the interaction between http.emptyAuth and
servers that advertise Negotiate (SPNEGO) authentication.

Verify that auto mode gives Negotiate a chance via empty auth
(resulting in two 401 responses before falling through to
credential_fill with Basic credentials), and that false mode
strips Negotiate immediately (only one 401 response).

Signed-off-by: Matthew John Cheetham <mjcheetham@outlook.com>
When checkout.workers > 1 and core.fscache is enabled on Windows,
'git checkout <tree> -- <pathspec>' fails when restoring files into
directories that do not yet exist on disk. Two failure modes occur:

1. create_directories(): the fscache returns a stale directory listing
   that does not include a just-created directory. has_dirs_only_path()
   reports it as non-existent, triggering the unlink+mkdir recovery
   path which fails with 'cannot create directory: Directory not empty'.

2. write_pc_item(): after writing and closing a file, lstat() cannot
   see it through the stale fscache, failing with 'unable to stat
   just-written file'.

With workers=1, write_entry() calls flush_fscache() after each file,
keeping the cache in sync. With workers>1, enqueue_checkout() defers
the write (and the flush), leaving the cache stale for subsequent
entries.

Fix both by adding flush_fscache() calls after mkdir() in
create_directories() and before lstat() in write_pc_item(). On
non-Windows platforms flush_fscache() is a no-op.

Assisted-by: Claude Opus 4.6
Signed-off-by: Tyrie Vella <tyrielv@gmail.com>
Historically, the macOS jobs have always been among the longest-running
ones, and recently the `git p4` tests became another liability: They
started to fail much more often (maybe as of the switch away from the
`macos-13` pool?), requiring re-runs of the jobs that already were
responsible for long CI build times.

Of the 35 test scripts that exercise `git p4`, 32 are actually run on
macOS (3 are skipped for reasons like case-sensitivee filesystem), and
they take an accumulated runtime of over half an hour.

Furthermore, the `git p4` command is not really affected by Git for
Windows' patches, at least not as far as macOS is concerned, therefore
it is not only causing developer friction to have these long-running,
frequently failing tests, it is also quite wasteful: There has not been
a single instance so far where any `git p4` test failure in Git for
Windows had demonstrated an actionable bug.

While upstream Git is confident to have addressed the flakiness of the
`git p4` tests via ffff0bb (Use Perforce arm64 binary on macOS CI
jobs, 2025-11-16) (which got slipped in at the 11th hour into the
v2.52.0 release, fast-tracked without ever hitting `seen` even after
-rc2 was released), I am not quite so confident, and besides, the
runtime penalty of running those tests in Git for Windows' CI runs is
still a worrisome burden.

So let's just disable those tests in the CI runs, at least on macOS.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
To support Git Bash running in a MinTTY, we use a dirty trick to access
the MSYS2 pseudo terminal: we execute a Bash snippet that accesses
/dev/tty.

The idea was to fall back to writing to/reading from CONOUT$/CONIN$ if
that Bash call failed because Bash was not found.

However, we should fall back even in other error conditions, because we
have not successfully read the user input. Let's make it so.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
dscho and others added 30 commits July 19, 2026 19:04
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>
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>
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>
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>
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>
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>
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>
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 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>
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>
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>
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>
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>
`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>
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
`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>
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>
`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>
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>
Git for Windows dropped Windows 7 support a long time ago. This patch
was carried in Git for Windows without making it upstream, and exists
exclusively to support Windows 7 users. Therefore it can now go enjoy
its retirement.

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`.
Git for Windows dropped Windows 7 support a long time ago.

There is a patch (introduced in
git-for-windows#5042 and in git-for-windows#5059) to detect
when Git LFS failed to start because of lack of Windows 7 support (which
was lost somewhat surprisingly, via a Go upgrade that slipped that
change in), and to provid a helpful message to the user in that
instance.

Since Git for Windows itself does not support Windows 7 anymore, that
patch is no longer necessary, either.
Git for Windows v2.55.0(3)

Changes since Git for Windows v2.55.0(2) (July 2nd 2026):

New Features

  * Comes with Git Credential Manager v2.9.0.

Bug Fixes

  * Fixes heap overflows in the credential helper wincred, see
    GHSA-rxqw-wxqg-g7hw for full details.
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.