Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
aef8430
commit: clarify FROM_REBASE_PICK and is_from_rebase() names
newren Sep 1, 2026
d692305
commit: allow a partial commit when a rebase pick becomes empty
newren Sep 1, 2026
a383728
commit: reword the empty-commit rebase amend error
newren Sep 1, 2026
6257588
commit: refuse to amend during conflict resolution
newren Sep 1, 2026
cc499d4
commit: refuse partial commits during conflict resolution
newren Sep 1, 2026
95d4895
repository: make repo_clear() idempotent
peff Sep 2, 2026
2c03739
submodule--helper: free URL when repository setup fails
peff Sep 2, 2026
7662148
history: do not dereference NULL when parent tree is missing
wildoranges Sep 3, 2026
88d06b1
pathspec: match and original in pathspec_item are const
gitster Sep 3, 2026
c655855
doc: git: list gitdatamodel(7) as a concept guide
LemmingAvalanche Sep 5, 2026
5745353
doc: git: link to the gitdatamodel(7) tutorial
LemmingAvalanche Sep 5, 2026
5720c09
doc: glossary: link four of the terms to gitdatamodel(7)
LemmingAvalanche Sep 5, 2026
ec60248
doc: datamodel: link to the glossary
LemmingAvalanche Sep 5, 2026
3e45748
t3507: check no CHERRY_PICK_HEAD after conflicting --no-commit
lexfrei Sep 5, 2026
81c1e0b
doc: cherry-pick: note --no-commit skips CHERRY_PICK_HEAD
lexfrei Sep 5, 2026
7129d77
fetch-pack: trace packfile URI downloads
tnm-oai Jul 26, 2026
8a63196
lint-gitlink: don't use empty lower bound in .{0,8}
taahol Sep 7, 2026
609ea23
doc: fix conjoined maintenance strategies in git-config(1)
brighamcampbell Sep 10, 2026
7792e40
ci: use system asciidoctor
peff Sep 2, 2026
a449fe1
Merge branch 'jk/ci-use-system-asciidoctor'
gitster Sep 14, 2026
cee3798
Merge branch 'bc/maintenance-doc-markup-fix-for-asciidoc'
gitster Sep 14, 2026
a334b7e
Merge branch 'en/no-amend-during-conflicts'
gitster Sep 14, 2026
830d747
Merge branch 'jk/submodule-error-leak'
gitster Sep 14, 2026
d5cd54c
Merge branch 'jc/pathspec-match-const'
gitster Sep 14, 2026
223518f
Merge branch 'tn/fetch-pack-trace-packfile-uri'
gitster Sep 14, 2026
7c051fe
Merge branch 'kh/doc-datamodel'
gitster Sep 14, 2026
994e80a
Merge branch 'as/cherry-pick-no-commit-doc'
gitster Sep 14, 2026
d7e8ff8
Merge branch 'jc/history-missing-tree-errorfix'
gitster Sep 14, 2026
584621d
Merge branch 'ta/lint-gitlink-older-perl-fix'
gitster Sep 14, 2026
3699d22
2nd batch for -rc1
gitster Sep 14, 2026
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
40 changes: 39 additions & 1 deletion Documentation/RelNotes/2.56.0.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,11 @@ UI, Workflows & Features
drop merge commits and linearize the replayed history, mimicking 'git
rebase --no-rebase-merges'.

* The documentation for 'git cherry-pick' has been updated to clarify
that the '--no-commit' option intentionally skips setting the
'CHERRY_PICK_HEAD' ref. A test has also been added to ensure this
behavior holds even when the operation stops for conflicts.


Performance, Internal Implementation, Development Support etc.
--------------------------------------------------------------
Expand Down Expand Up @@ -518,6 +523,11 @@ Performance, Internal Implementation, Development Support etc.
the main 'git.exe' to be used directly without the extra wrapper
process on Windows.

* The process of downloading packfile URIs in protocol v2 has been
instrumented with a Trace2 region. This visibility allows tracking
the cumulative time spent downloading external packs and the number
of advertised URIs without emitting a separate event per pack.


Fixes since v2.55
-----------------
Expand Down Expand Up @@ -819,7 +829,35 @@ Fixes since v2.55
package manager instead of pinning to an older version via gem.
Additionally, an obsolete variable used for retired Azure Pipelines
environments has been removed.
(merge 1c1eed13bd jk/ci-use-system-asciidoctor later to maint).

* Teach 'am', 'revert', and 'rebase' that running 'commit --amend' or a
partial 'commit <paths>' makes no sense during operations that stop
and return control to the user to resolve conflicts left in the
working tree, just like 'cherry-pick' and 'merge' do.
(merge cc499d40e5 en/no-amend-during-conflicts later to maint).

* The error path in 'git submodule--helper' has been updated to plug a
memory leak when a repository handle could not be obtained,
leveraging an updated idempotent repo_clear().
(merge 2c03739705 jk/submodule-error-leak later to maint).

* Two members in "struct pathspec_item" were of type "char *", but
nobody updated the string through these pointers. They have been
made "const char *" instead.
(merge 88d06b1c91 jc/pathspec-match-const later to maint).

* The gitdatamodel documentation page has been linked from a handful
of key documentaiton pages.
(merge ec602484bd kh/doc-datamodel later to maint).

* Running "git history" in a corrupt repository can (unsurprisingly)
segfault when a necessary tree object is not found.
(merge 76621488e8 jc/history-missing-tree-errorfix later to maint).

* The development helper script to lint gitlink references in the
documentation has been updated to avoid a newer Perl regular
expression syntax that breaks on older Perl versions.
(merge 8a631963a9 ta/lint-gitlink-older-perl-fix later to maint).

* Other code cleanup, docfix, build fix, etc.
(merge 026636128f ss/submittingpatches-typofix later to maint).
Expand Down
1 change: 1 addition & 0 deletions Documentation/config/maintenance.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ The possible strategies are:
This repacking strategy is a full replacement for the `gc` strategy and is
recommended for large repositories. This is the default strategy for manual
maintenance.
+
* `incremental`: This setting optimizes for performing small maintenance
activities that do not delete any data. This does not schedule the `gc`
task, but runs the `prefetch` and `commit-graph` tasks hourly, the
Expand Down
8 changes: 7 additions & 1 deletion Documentation/git-cherry-pick.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ happens:
1. The current branch and `HEAD` pointer stay at the last commit
successfully made.
2. The `CHERRY_PICK_HEAD` ref is set to point at the commit that
introduced the change that is difficult to apply.
introduced the change that is difficult to apply, unless the
`--no-commit` option was given.
3. Paths in which the change applied cleanly are updated both
in the index file and in your working tree.
4. For conflicting paths, the index file records up to three
Expand Down Expand Up @@ -101,6 +102,11 @@ OPTIONS
+
This is useful when cherry-picking more than one commits'
effect to your index in a row.
+
This option does not record `CHERRY_PICK_HEAD`, so a plain `git commit`
afterwards records you as the author. That is by design: what you are
building is your own work, which you keep changing before committing,
rather than a reproduction of the original commit.

-s::
--signoff::
Expand Down
12 changes: 8 additions & 4 deletions Documentation/git.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ and full access to internals.
See linkgit:gittutorial[7] to get started, then see
linkgit:giteveryday[7] for a useful minimum set of
commands. The link:user-manual.html[Git User's Manual] has a more
in-depth introduction.
in-depth introduction. See linkgit:gitdatamodel[7] if you want to
learn about the data model and important terminology.

After you mastered the basic concepts, you can come back to this
page to learn what commands Git offers. You can learn more about
Expand Down Expand Up @@ -469,7 +470,9 @@ Higher level SCMs may provide and manage additional information in the

Terminology
-----------
Please see linkgit:gitglossary[7].
Please see linkgit:gitglossary[7]. See linkgit:gitdatamodel[7] for a
discussion of the core data model, which includes important terminology
used throughout the documentation.


Environment Variables
Expand Down Expand Up @@ -1199,8 +1202,9 @@ SEE ALSO
--------
linkgit:gittutorial[7], linkgit:gittutorial-2[7],
linkgit:giteveryday[7], linkgit:gitcvs-migration[7],
linkgit:gitglossary[7], linkgit:gitcore-tutorial[7],
linkgit:gitcli[7], link:user-manual.html[The Git User's Manual],
linkgit:gitglossary[7], linkgit:gitdatamodel[7],
linkgit:gitcore-tutorial[7], linkgit:gitcli[7],
link:user-manual.html[The Git User's Manual],
linkgit:gitworkflows[7]

GIT
Expand Down
4 changes: 4 additions & 0 deletions Documentation/gitdatamodel.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,10 @@ $ git reflog main --date=iso --no-decorate
4ccb6d7 main@{2025-09-29 15:16:48 -0400}: commit (initial): Initial commit
----

SEE ALSO
--------
linkgit:gitglossary[7]

GIT
---
Part of the linkgit:git[1] suite
1 change: 1 addition & 0 deletions Documentation/gitglossary.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ include::glossary-content.adoc[]

SEE ALSO
--------
linkgit:gitdatamodel[7],
linkgit:gittutorial[7],
linkgit:gittutorial-2[7],
linkgit:gitcvs-migration[7],
Expand Down
13 changes: 10 additions & 3 deletions Documentation/glossary-content.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,8 @@ for a more flexible and robust system to do the same thing.
as objects. The index is a stored version of your
<<def_working_tree,working tree>>. Truth be told, it can also contain a second, and even
a third version of a working tree, which are used
when <<def_merge,merging>>.
when <<def_merge,merging>>. See "THE INDEX" in
linkgit:gitdatamodel[7] for details.

[[def_index_entry]]index entry::
The information regarding a particular file, stored in the
Expand Down Expand Up @@ -290,7 +291,8 @@ This commit is referred to as a "merge commit", or sometimes just a
[[def_object]]object::
The unit of storage in Git. It is uniquely identified by the
<<def_SHA1,SHA-1>> of its contents. Consequently, an
object cannot be changed.
object cannot be changed. See "OBJECTS" in
linkgit:gitdatamodel[7] for details.

[[def_object_database]]object database::
Stores a set of "objects", and an individual <<def_object,object>> is
Expand Down Expand Up @@ -587,12 +589,17 @@ extended in the future:
Different subhierarchies are used for different purposes. For example,
the `refs/heads/` hierarchy is used to represent local branches whereas
the `refs/tags/` hierarchy is used to represent local tags..
+
See also "REFERENCES" in linkgit:gitdatamodel[7].

[[def_reflog]]reflog::
A reflog shows the local "history" of a ref. In other words,
it can tell you what the 3rd last revision in _this_ repository
was, and what was the current state in _this_ repository,
yesterday 9:14pm. See linkgit:git-reflog[1] for details.
yesterday 9:14pm.
+
See "REFLOGS" in linkgit:gitdatamodel[7] for a short explanation of the
format. See linkgit:git-reflog[1] for details.

[[def_refspec]]refspec::
A "refspec" is used by <<def_fetch,fetch>> and
Expand Down
2 changes: 1 addition & 1 deletion Documentation/lint-gitlink.perl
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ sub report {
while (<>) {
my $line = $_;
next if $line =~ /^\s*(ifn?def|endif)::/;
while ($line =~ m/(.{,8})((git[-a-z]+|scalar)\[(\d)*\])/g) {
while ($line =~ m/(.{0,8})((git[-a-z]+|scalar)\[(\d)*\])/g) {
my $pos = pos $line;
my ($macro, $target, $page, $section) = ($1, $2, $3, $4);
if ( $macro ne "linkgit:" ) {
Expand Down
65 changes: 46 additions & 19 deletions builtin/commit.c
Original file line number Diff line number Diff line change
Expand Up @@ -515,13 +515,25 @@ static const char *prepare_index(const char **argv, const char *prefix,
*/
commit_style = COMMIT_PARTIAL;

if (whence != FROM_COMMIT) {
if (whence == FROM_MERGE)
die(_("cannot do a partial commit during a merge."));
else if (is_from_cherry_pick(whence))
die(_("cannot do a partial commit during a cherry-pick."));
else if (is_from_rebase(whence))
die(_("cannot do a partial commit during a rebase."));
switch (sequencer_ongoing_operation(the_repository, whence)) {
case ONGOING_NONE:
break;
case ONGOING_MERGE:
die(_("cannot do a partial commit during a merge."));
case ONGOING_CHERRY_PICK:
die(_("cannot do a partial commit during a cherry-pick."));
case ONGOING_REBASE_NOW_EMPTY:
/*
* A pick that became empty is not a conflict, and creating
* a new commit (partial or not) poses no problem.
*/
break;
case ONGOING_REVERT:
die(_("cannot do a partial commit during a revert."));
case ONGOING_AM:
die(_("cannot do a partial commit during an am session."));
case ONGOING_REBASE_CONFLICT:
die(_("cannot do a partial commit while resolving conflicts during a rebase."));
}

if (list_paths(&partial, !current_head ? NULL : "HEAD", &pathspec))
Expand Down Expand Up @@ -893,7 +905,7 @@ static int prepare_to_commit(const char *index_file, const char *prefix,
*/
else if (whence == FROM_MERGE)
hook_arg1 = "merge";
else if (is_from_cherry_pick(whence) || whence == FROM_REBASE_PICK) {
else if (is_from_cherry_pick(whence) || is_from_rebase_now_empty(whence)) {
hook_arg1 = "commit";
hook_arg2 = "CHERRY_PICK_HEAD";
}
Expand Down Expand Up @@ -1086,7 +1098,7 @@ static int prepare_to_commit(const char *index_file, const char *prefix,
if (amend)
fputs(_(empty_amend_advice), stderr);
else if (is_from_cherry_pick(whence) ||
whence == FROM_REBASE_PICK) {
is_from_rebase_now_empty(whence)) {
fputs(_(empty_cherry_pick_advice), stderr);
if (whence == FROM_CHERRY_PICK_SINGLE)
fputs(_(empty_cherry_pick_advice_single), stderr);
Expand Down Expand Up @@ -1326,15 +1338,30 @@ static int parse_and_validate_options(int argc, const char *argv[],
use_editor = 0;

/* Sanity check options */
if (amend && !current_head)
die(_("You have nothing to amend."));
if (amend && whence != FROM_COMMIT) {
if (whence == FROM_MERGE)
if (amend) {
if (!current_head)
die(_("You have nothing to amend."));
/*
* Refuse to amend in the middle of any operation that is
* meant to record its result as a new commit on top of HEAD
* rather than by rewriting HEAD.
*/
switch (sequencer_ongoing_operation(s->repo, whence)) {
case ONGOING_NONE:
break;
case ONGOING_MERGE:
die(_("You are in the middle of a merge -- cannot amend."));
else if (is_from_cherry_pick(whence))
case ONGOING_CHERRY_PICK:
die(_("You are in the middle of a cherry-pick -- cannot amend."));
else if (whence == FROM_REBASE_PICK)
die(_("You are in the middle of a rebase -- cannot amend."));
case ONGOING_REBASE_NOW_EMPTY:
die(_("The now-empty commit has been dropped -- cannot amend."));
case ONGOING_REVERT:
die(_("You are in the middle of a revert -- cannot amend."));
case ONGOING_AM:
die(_("You are in the middle of an am session -- cannot amend."));
case ONGOING_REBASE_CONFLICT:
die(_("You are resolving conflicts during a rebase -- cannot amend."));
}
}
if (fixup_message && squash_message)
die(_("options '%s' and '%s' cannot be used together"), "--squash", "--fixup");
Expand All @@ -1353,7 +1380,7 @@ static int parse_and_validate_options(int argc, const char *argv[],
if (amend && !use_message && !fixup_message)
use_message = "HEAD";
if (!use_message && !is_from_cherry_pick(whence) &&
!is_from_rebase(whence) && renew_authorship)
!is_from_rebase_now_empty(whence) && renew_authorship)
die(_("--reset-author can be used only with -C, -c or --amend."));
if (use_message) {
use_message_buffer = read_commit_message(use_message);
Expand All @@ -1362,7 +1389,7 @@ static int parse_and_validate_options(int argc, const char *argv[],
author_message_buffer = use_message_buffer;
}
}
if ((is_from_cherry_pick(whence) || whence == FROM_REBASE_PICK) &&
if ((is_from_cherry_pick(whence) || is_from_rebase_now_empty(whence)) &&
!renew_authorship) {
author_message = "CHERRY_PICK_HEAD";
author_message_buffer = read_commit_message(author_message);
Expand Down Expand Up @@ -1887,7 +1914,7 @@ int cmd_commit(int argc,
if (!reflog_msg)
reflog_msg = is_from_cherry_pick(whence)
? "commit (cherry-pick)"
: is_from_rebase(whence)
: is_from_rebase_now_empty(whence)
? "commit (rebase)"
: "commit";
commit_list_insert(current_head, &parents);
Expand Down
4 changes: 4 additions & 0 deletions builtin/history.c
Original file line number Diff line number Diff line change
Expand Up @@ -786,6 +786,10 @@ static int write_ondisk_index(struct repository *repo,
opts.dst_index = &index;

tree = repo_parse_tree_indirect(repo, oid);
if (!tree) {
ret = error(_("unable to parse tree %s"), oid_to_hex(oid));
goto out;
}
init_tree_desc(&tree_desc, &tree->object.oid, tree->buffer, tree->size);

if (unpack_trees(1, &tree_desc, &opts)) {
Expand Down
10 changes: 7 additions & 3 deletions builtin/submodule--helper.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ static int get_default_remote_submodule(const char *module_path, char **default_
struct repository subrepo;
const char *remote_name = NULL;
char *url = NULL;
int ret = 0;

sub = submodule_from_path(the_repository, null_oid(the_hash_algo), module_path);
if (sub && sub->url) {
Expand All @@ -96,9 +97,11 @@ static int get_default_remote_submodule(const char *module_path, char **default_
}

if (repo_submodule_init(&subrepo, the_repository, module_path,
null_oid(the_hash_algo)) < 0)
return die_message(_("could not get a repository handle for submodule '%s'"),
null_oid(the_hash_algo)) < 0) {
ret = die_message(_("could not get a repository handle for submodule '%s'"),
module_path);
goto out;
}

/* Look up by URL first */
if (url)
Expand All @@ -108,10 +111,11 @@ static int get_default_remote_submodule(const char *module_path, char **default_

*default_remote = xstrdup(remote_name);

out:
repo_clear(&subrepo);
free(url);

return 0;
return ret;
}

static int module_get_default_remote(int argc, const char **argv, const char *prefix,
Expand Down
4 changes: 2 additions & 2 deletions ci/install-dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -164,9 +164,9 @@ sparse)
libexpat-dev gettext zlib1g-dev sparse
;;
Documentation)
sudo apt-get -q -y install asciidoc xmlto docbook-xsl-ns make ruby
sudo apt-get -q -y install asciidoc xmlto docbook-xsl-ns make ruby \
asciidoctor

sudo gem install --version 1.5.8 asciidoctor
sudo gem install concurrent-ruby
;;
esac
Expand Down
1 change: 1 addition & 0 deletions command-list.txt
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,7 @@ gitcli userinterfaces
gitcore-tutorial guide
gitcredentials guide
gitcvs-migration guide
gitdatamodel guide
gitdiffcore guide
giteveryday guide
gitfaq guide
Expand Down
12 changes: 12 additions & 0 deletions fetch-pack.c
Original file line number Diff line number Diff line change
Expand Up @@ -1853,6 +1853,13 @@ static struct ref *do_fetch_pack_v2(struct fetch_pack_args *args,
}
}

if (packfile_uris.nr) {
trace2_region_enter("fetch-pack", "packfile-uris",
the_repository);
trace2_data_intmax("fetch-pack", the_repository,
"packfile-uris/count", packfile_uris.nr);
}

for (i = 0; i < packfile_uris.nr; i++) {
bool created_keep;
int j;
Expand Down Expand Up @@ -1906,6 +1913,11 @@ static struct ref *do_fetch_pack_v2(struct fetch_pack_args *args,
repo_get_object_directory(the_repository),
packhash));
}

if (packfile_uris.nr)
trace2_region_leave("fetch-pack", "packfile-uris",
the_repository);

string_list_clear(&packfile_uris, 0);
strvec_clear(&index_pack_args);

Expand Down
Loading