Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
fe4e607
last-modified: fix use of uninitialized memory
To1ne Nov 28, 2025
38f8805
diff-index: don't queue unchanged filepairs with diff_change()
rscharfe Nov 30, 2025
b14f1df
branch: advice using git-help(1) instead of man(1)
LemmingAvalanche Dec 2, 2025
cfdce4a
doc: remove stray text in Git data model
jvns Dec 2, 2025
8ef7355
doc: git-pull: fix 'git --rebase abort' typo
jvns Dec 3, 2025
05491b9
last-modified: support sparse checkouts
dscho Nov 29, 2025
9ce3478
meson: ignore subprojects/.wraplock
To1ne Dec 2, 2025
574ac61
meson: only detect ICONV_OMITS_BOM if possible
To1ne Dec 2, 2025
4061692
meson: use is_cross_build() where possible
To1ne Dec 3, 2025
6fd44f5
repo: remove blank line from Documentation/git-repo.adoc
lucasoshiro Dec 4, 2025
768cf99
repo: use [--format=... | -z] instead of [-z] in git-repo-info synopsis
lucasoshiro Dec 4, 2025
76c0704
repo: add -z as an alias for --format=nul to git-repo-structure
lucasoshiro Dec 4, 2025
794c979
Merge branch 'tc/last-modified-active-paths-optimization'
gitster Dec 14, 2025
84ca5a2
Merge branch 'rs/diff-index-find-copies-harder-optim'
gitster Dec 14, 2025
2178707
Merge branch 'js/last-modified-with-sparse-checkouts'
gitster Dec 14, 2025
25ce088
Merge branch 'tc/meson-cross-compile-fix'
gitster Dec 14, 2025
c382988
Merge branch 'je/doc-pull'
gitster Dec 14, 2025
2378ebc
Merge branch 'kh/advise-w-git-help-in-branch'
gitster Dec 14, 2025
affdbe4
Merge branch 'lo/repo-struct-z'
gitster Dec 14, 2025
f29e987
Merge branch 'je/doc-data-model'
gitster Dec 14, 2025
d8af7ca
The eighth batch
gitster Dec 14, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions Documentation/RelNotes/2.53.0.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ UI, Workflows & Features
* The use of "revision" (a connected set of commits) has been
clarified in the "git replay" documentation.

* A help message from "git branch" now mentions "git help" instead of
"man" when suggesting to read some documentation.

* "git repo struct" learned to take "-z" as a synonym to "--format=nul".


Performance, Internal Implementation, Development Support etc.
--------------------------------------------------------------
Expand All @@ -51,6 +56,10 @@ Performance, Internal Implementation, Development Support etc.
* Code refactoring around object database sources.
* Halve the memory consumed by artificial filepairs created during
"git diff --find-copioes-harder", also making the operation run
faster.
Fixes since v2.52
-----------------
Expand Down Expand Up @@ -150,9 +159,18 @@ Fixes since v2.52
* The way patience diff finds LCS has been optimized.
(merge c7e3b8085b yc/xdiff-patience-optim later to maint).

* Recent optimization to "last-modified" command introduced use of
uninitialized block of memory, which has been corrected.
(merge fe4e60759b tc/last-modified-active-paths-optimization later to maint).

* "git last-modified" used to mishandle "--" to mark the beginning of
pathspec, which has been corrected.
(merge 05491b90ce js/last-modified-with-sparse-checkouts later to maint).

* Other code cleanup, docfix, build fix, etc.
(merge 46207a54cc qj/doc-http-bad-want-response later to maint).
(merge df90eccd93 kh/doc-commit-extra-references later to maint).
(merge f18aa68861 rs/xmkstemp-simplify later to maint).
(merge fddba8f737 ja/doc-synopsis-style later to maint).
(merge 22ce0cb639 en/xdiff-cleanup-2 later to maint).
(merge 8ef7355a8f je/doc-pull later to maint).
4 changes: 2 additions & 2 deletions Documentation/git-pull.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ You can also set the configuration options `pull.rebase`, `pull.squash`,
or `pull.ff` with your preferred behaviour.

If there's a merge conflict during the merge or rebase that you don't
want to handle, you can safely abort it with `git merge --abort` or `git
--rebase abort`.
want to handle, you can safely abort it with `git merge --abort` or
`git rebase --abort`.

OPTIONS
-------
Expand Down
11 changes: 6 additions & 5 deletions Documentation/git-repo.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ git-repo - Retrieve information about the repository
SYNOPSIS
--------
[synopsis]
git repo info [--format=(keyvalue|nul)] [-z] [--all | <key>...]
git repo structure [--format=(table|keyvalue|nul)]
git repo info [--format=(keyvalue|nul) | -z] [--all | <key>...]
git repo structure [--format=(table|keyvalue|nul) | -z]

DESCRIPTION
-----------
Expand All @@ -19,7 +19,7 @@ THIS COMMAND IS EXPERIMENTAL. THE BEHAVIOR MAY CHANGE.

COMMANDS
--------
`info [--format=(keyvalue|nul)] [-z] [--all | <key>...]`::
`info [--format=(keyvalue|nul) | -z] [--all | <key>...]`::
Retrieve metadata-related information about the current repository. Only
the requested data will be returned based on their keys (see "INFO KEYS"
section below).
Expand All @@ -44,13 +44,12 @@ supported:
+
`-z` is an alias for `--format=nul`.

`structure [--format=(table|keyvalue|nul)]`::
`structure [--format=(table|keyvalue|nul) | -z]`::
Retrieve statistics about the current repository structure. The
following kinds of information are reported:
+
* Reference counts categorized by type
* Reachable object counts categorized by type

+
The output format can be chosen through the flag `--format`. Three formats are
supported:
Expand All @@ -72,6 +71,8 @@ supported:
the delimiter between the key and value instead of '='. Unlike the
`keyvalue` format, values containing "unusual" characters are never
quoted.
+
`-z` is an alias for `--format=nul`.

INFO KEYS
---------
Expand Down
2 changes: 0 additions & 2 deletions Documentation/gitdatamodel.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -235,8 +235,6 @@ there will no longer be a branch that points at the old commit.
The old commit is recorded in the current branch's <<reflogs,reflog>>,
so it is still "reachable", but when the reflog entry expires it may
become unreachable and get deleted.

the old commit will usually not be reachable, so it may be deleted eventually.
Reachable objects will never be deleted.

[[index]]
Expand Down
2 changes: 1 addition & 1 deletion branch.c
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ int validate_branchname(const char *name, struct strbuf *ref)
if (check_branch_ref(ref, name)) {
int code = die_message(_("'%s' is not a valid branch name"), name);
advise_if_enabled(ADVICE_REF_SYNTAX,
_("See `man git check-ref-format`"));
_("See 'git help check-ref-format'"));
exit(code);
}

Expand Down
2 changes: 1 addition & 1 deletion builtin/branch.c
Original file line number Diff line number Diff line change
Expand Up @@ -591,7 +591,7 @@ static void copy_or_rename_branch(const char *oldname, const char *newname, int
else {
int code = die_message(_("invalid branch name: '%s'"), oldname);
advise_if_enabled(ADVICE_REF_SYNTAX,
_("See `man git check-ref-format`"));
_("See 'git help check-ref-format'"));
exit(code);
}
}
Expand Down
5 changes: 3 additions & 2 deletions builtin/last-modified.c
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ static void process_parent(struct last_modified *lm,
if (!(parent->object.flags & PARENT1))
active_paths_free(lm, parent);

memset(lm->scratch->words, 0x0, lm->scratch->word_alloc);
memset(lm->scratch->words, 0x0, lm->scratch->word_alloc * sizeof(eword_t));
diff_queue_clear(&diff_queued_diff);
}

Expand Down Expand Up @@ -525,7 +525,8 @@ int cmd_last_modified(int argc, const char **argv, const char *prefix,

argc = parse_options(argc, argv, prefix, last_modified_options,
last_modified_usage,
PARSE_OPT_KEEP_ARGV0 | PARSE_OPT_KEEP_UNKNOWN_OPT);
PARSE_OPT_KEEP_ARGV0 | PARSE_OPT_KEEP_UNKNOWN_OPT |
PARSE_OPT_KEEP_DASHDASH);

repo_config(repo, git_default_config, NULL);

Expand Down
8 changes: 6 additions & 2 deletions builtin/repo.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
#include "utf8.h"

static const char *const repo_usage[] = {
"git repo info [--format=(keyvalue|nul)] [-z] [--all | <key>...]",
"git repo structure [--format=(table|keyvalue|nul)]",
"git repo info [--format=(keyvalue|nul) | -z] [--all | <key>...]",
"git repo structure [--format=(table|keyvalue|nul) | -z]",
NULL
};

Expand Down Expand Up @@ -529,6 +529,10 @@ static int cmd_repo_structure(int argc, const char **argv, const char *prefix,
OPT_CALLBACK_F(0, "format", &format, N_("format"),
N_("output format"),
PARSE_OPT_NONEG, parse_format_cb),
OPT_CALLBACK_F('z', NULL, &format, NULL,
N_("synonym for --format=nul"),
PARSE_OPT_NONEG | PARSE_OPT_NOARG,
parse_format_cb),
OPT_BOOL(0, "progress", &show_progress, N_("show progress")),
OPT_END()
};
Expand Down
13 changes: 6 additions & 7 deletions diff-lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -418,13 +418,12 @@ static int show_modified(struct rev_info *revs,
}

oldmode = old_entry->ce_mode;
if (mode == oldmode && oideq(oid, &old_entry->oid) && !dirty_submodule &&
!revs->diffopt.flags.find_copies_harder)
return 0;

diff_change(&revs->diffopt, oldmode, mode,
&old_entry->oid, oid, 1, !is_null_oid(oid),
old_entry->name, 0, dirty_submodule);
if (mode != oldmode || !oideq(oid, &old_entry->oid) || dirty_submodule)
diff_change(&revs->diffopt, oldmode, mode,
&old_entry->oid, oid, 1, !is_null_oid(oid),
old_entry->name, 0, dirty_submodule);
else if (revs->diffopt.flags.find_copies_harder)
diff_same(&revs->diffopt, mode, oid, old_entry->name);
return 0;
}

Expand Down
20 changes: 20 additions & 0 deletions diff.c
Original file line number Diff line number Diff line change
Expand Up @@ -7399,6 +7399,26 @@ void diff_change(struct diff_options *options,
concatpath, old_dirty_submodule, new_dirty_submodule);
}

void diff_same(struct diff_options *options,
unsigned mode,
const struct object_id *oid,
const char *concatpath)
{
struct diff_filespec *one;

if (S_ISGITLINK(mode) && is_submodule_ignored(concatpath, options))
return;

if (options->prefix &&
strncmp(concatpath, options->prefix, options->prefix_length))
return;

one = alloc_filespec(concatpath);
fill_filespec(one, oid, 1, mode);
one->count++;
diff_queue(&diff_queued_diff, one, one);
}

struct diff_filepair *diff_unmerge(struct diff_options *options, const char *path)
{
struct diff_filepair *pair;
Expand Down
5 changes: 5 additions & 0 deletions diff.h
Original file line number Diff line number Diff line change
Expand Up @@ -572,6 +572,11 @@ void diff_change(struct diff_options *,
const char *fullpath,
unsigned dirty_submodule1, unsigned dirty_submodule2);

void diff_same(struct diff_options *,
unsigned mode,
const struct object_id *oid,
const char *fullpath);

struct diff_filepair *diff_unmerge(struct diff_options *, const char *path);

void compute_diffstat(struct diff_options *options, struct diffstat_t *diffstat,
Expand Down
4 changes: 2 additions & 2 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -1064,7 +1064,7 @@ if iconv.found()
}
'''

if compiler.run(iconv_omits_bom_source,
if meson.can_run_host_binaries() and compiler.run(iconv_omits_bom_source,
dependencies: iconv,
name: 'iconv omits BOM',
).returncode() != 0
Expand Down Expand Up @@ -1492,7 +1492,7 @@ if not has_bsd_sysctl
endif
endif

if not meson.is_cross_build() and compiler.run('''
if meson.can_run_host_binaries() and compiler.run('''
#include <stdio.h>

int main(int argc, const char **argv)
Expand Down
1 change: 1 addition & 0 deletions subprojects/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
/*/
.wraplock
7 changes: 7 additions & 0 deletions t/t1901-repo-structure.sh
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,13 @@ test_expect_success 'keyvalue and nul format' '
tr "\n=" "\0\n" <expect >expect_nul &&
git repo structure --format=nul >out 2>err &&

test_cmp expect_nul out &&
test_line_count = 0 err &&

# "-z", as a synonym to "--format=nul", participates in the
# usual "last one wins" rule.
git repo structure --format=table -z >out 2>err &&

test_cmp expect_nul out &&
test_line_count = 0 err
)
Expand Down
6 changes: 3 additions & 3 deletions t/t3200-branch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1707,9 +1707,9 @@ test_expect_success '--track overrides branch.autoSetupMerge' '
'

test_expect_success 'errors if given a bad branch name' '
cat <<-\EOF >expect &&
fatal: '\''foo..bar'\'' is not a valid branch name
hint: See `man git check-ref-format`
cat <<-EOF >expect &&
fatal: ${SQ}foo..bar${SQ} is not a valid branch name
hint: See ${SQ}git help check-ref-format${SQ}
hint: Disable this message with "git config set advice.refSyntax false"
EOF
test_must_fail git branch foo..bar >actual 2>&1 &&
Expand Down
8 changes: 8 additions & 0 deletions t/t8020-last-modified.sh
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,14 @@ test_expect_success 'last-modified subdir' '
EOF
'

test_expect_success 'last-modified in sparse checkout' '
test_when_finished "git sparse-checkout disable" &&
git sparse-checkout set b &&
check_last_modified -- a <<-\EOF
3 a
EOF
'

test_expect_success 'last-modified subdir recursive' '
check_last_modified -r a <<-\EOF
3 a/b/file
Expand Down