Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
b4e8f60
revision: add --maximal-only option
derrickstolee Jan 22, 2026
bfc1b34
completion: add stash import, export
benknoble Feb 7, 2026
f4eff71
builtin/pack-objects: don't fetch objects when merging packs
pks-t Feb 11, 2026
a454cdc
doc: add caveat about round-tripping format-patch
LemmingAvalanche Feb 12, 2026
88fb80c
sparse-checkout: use string_list_sort_u
amishhaa Feb 13, 2026
046e111
templates: add .gitattributes entry for sample hooks
phillipwood Feb 13, 2026
83804c3
templates: detect commit messages containing diffs
phillipwood Feb 13, 2026
fd104ef
trace2: add macOS process ancestry tracing
mjcheetham Feb 13, 2026
088aaf1
build: include procinfo.c impl for macOS
mjcheetham Feb 13, 2026
c2a473b
trace2: refactor Windows process ancestry trace2 event
mjcheetham Feb 13, 2026
d730148
trace2: emit cmd_ancestry data for Windows
mjcheetham Feb 13, 2026
b6a125b
test-tool: extend trace2 helper with 400ancestry
mjcheetham Feb 13, 2026
3c8c638
t0213: add trace2 cmd_ancestry tests
mjcheetham Feb 13, 2026
aa94ba7
CodingGuidelines: document NEEDSWORK comments
gitster Feb 12, 2026
a7d430d
promisor-remote: refactor initialising field lists
chriscool Feb 16, 2026
3e20258
promisor-remote: allow a client to store fields
chriscool Feb 16, 2026
fe53359
clone: make filter_options local to cmd_clone()
chriscool Feb 16, 2026
f756541
fetch: make filter_options local to cmd_fetch()
chriscool Feb 16, 2026
190438b
doc: fetch: document `--filter=<filter-spec>` option
chriscool Feb 16, 2026
cd1a898
list-objects-filter-options: support 'auto' mode for --filter
chriscool Feb 16, 2026
257f2db
promisor-remote: keep advertised filters in memory
chriscool Feb 16, 2026
e15a6b2
promisor-remote: change promisor_remote_reply()'s signature
chriscool Feb 16, 2026
ef2f184
fetch-pack: wire up and enable auto filter logic
chriscool Feb 16, 2026
bf3c360
Merge branch 'kh/doc-am-format-sendmail'
gitster Feb 25, 2026
e8c6456
Merge branch 'pw/commit-msg-sample-hook'
gitster Feb 25, 2026
6b5ad01
Merge branch 'cc/lop-filter-auto'
gitster Feb 25, 2026
8d15dd1
Merge branch 'ds/revision-maximal-only'
gitster Feb 25, 2026
1a46f31
Merge branch 'jc/doc-cg-needswork'
gitster Feb 25, 2026
d21437a
Merge branch 'dk/complete-stash-import-export'
gitster Feb 25, 2026
b1f4b58
Merge branch 'ps/pack-concat-wo-backfill'
gitster Feb 25, 2026
422cae6
Merge branch 'mc/tr2-process-ancestry-cleanup'
gitster Feb 25, 2026
d1c983d
Merge branch 'ac/string-list-sort-u-and-tests'
gitster Feb 25, 2026
7b2bccb
The 7th batch
gitster Feb 25, 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
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ insert_final_newline = true

# The settings for C (*.c and *.h) files are mirrored in .clang-format. Keep
# them in sync.
[{*.{c,h,sh,bash,perl,pl,pm,txt,adoc},config.mak.*,Makefile}]
[{*.{c,h,sh,bash,perl,pl,pm,txt,adoc},config.mak.*,Makefile,templates/hooks/*.sample}]
indent_style = tab
tab_width = 8

Expand Down
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@ CODE_OF_CONDUCT.md -whitespace
/Documentation/user-manual.adoc conflict-marker-size=32
/t/t????-*.sh conflict-marker-size=32
/t/unit-tests/clar/test/expected/* whitespace=-blank-at-eof
/templates/hooks/*.sample whitespace=indent,trail,space,incomplete text eol=lf
10 changes: 10 additions & 0 deletions Documentation/CodingGuidelines
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,16 @@ Git in general, a few rough rules are:
achieve and why the changes were necessary (more on this in the
accompanying SubmittingPatches document).

- A label "NEEDSWORK:" followed by a description of the things to
be done is a way to leave in-code comments to document design
decisions yet to be made. 80% of the work to resolve a NEEDSWORK
comment is to decide if it still makes sense to do so, since the
situation around the codebase may have changed since the comment
was written. It can be a very valid change to remove an existing
NEEDSWORK comment without doing anything else, with the commit log
message describing a good argument why it does not make sense to do
the thing the NEEDSWORK comment mentioned.

Make your code readable and sensible, and don't try to be clever.

As for more concrete guidelines, just imitate the existing code
Expand Down
24 changes: 24 additions & 0 deletions Documentation/RelNotes/2.54.0.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,14 @@ UI, Workflows & Features
all configuration, even the per-user ones. The command now uses
available configuration files to find its customization.

* "auto filter" logic for large-object promisor remote.

* "git rev-list" and friends learn "--maximal-only" to show only the
commits that are not reachable by other commits.

* Command line completion (in contrib/) update for
"stash import/export".


Performance, Internal Implementation, Development Support etc.
--------------------------------------------------------------
Expand Down Expand Up @@ -62,6 +70,12 @@ Performance, Internal Implementation, Development Support etc.
* "git diff --anchored=<text>" has been optimized.
* A CodingGuidelines update.
* Add process ancestry data to trace2 on macOS to match what we
already do on Linux and Windows. Also adjust the way Windows
implementation reports this information to match the other two.
Fixes since v2.53
-----------------
Expand Down Expand Up @@ -107,6 +121,15 @@ Fixes since v2.53
duplication.
(merge 5086213bd2 pw/xdiff-cleanups later to maint).

* Update sample commit-msg hook to complain when a log message has
material mailinfo considers the end of log message in the middle.
(merge 83804c361b pw/commit-msg-sample-hook later to maint).

* "git pack-objects --stdin-packs" with "--exclude-promisor-objects"
fetched objects that are promised, which was not wanted. This has
been fixed.
(merge f4eff7116d ps/pack-concat-wo-backfill later to maint).

* Other code cleanup, docfix, build fix, etc.
(merge d79fff4a11 jk/remote-tracking-ref-leakfix later to maint).
(merge 7a747f972d dd/t5403-modernise later to maint).
Expand All @@ -127,3 +150,4 @@ Fixes since v2.53
(merge aaf3cc3d8d sd/t7003-test-path-is-helpers later to maint).
(merge 2668b6bdc4 jc/doc-rerere-update later to maint).
(merge 2f99f50f2d jc/doc-cg-c-comment later to maint).
(merge a454cdca42 kh/doc-am-format-sendmail later to maint).
33 changes: 33 additions & 0 deletions Documentation/config/promisor.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -89,3 +89,36 @@ variable. The fields are checked only if the
`promisor.acceptFromServer` config variable is not set to "None". If
set to "None", this config variable has no effect. See
linkgit:gitprotocol-v2[5].

promisor.storeFields::
A comma or space separated list of additional remote related
field names. If a client accepts an advertised remote, the
client will store the values associated with these field names
taken from the remote advertisement into its configuration,
and then reload its remote configuration. Currently,
"partialCloneFilter" and "token" are the only supported field
names.
+
For example if a server advertises "partialCloneFilter=blob:limit=20k"
for remote "foo", and that remote is accepted, then "blob:limit=20k"
will be stored for the "remote.foo.partialCloneFilter" configuration
variable.
+
If the new field value from an advertised remote is the same as the
existing field value for that remote on the client side, then no
change is made to the client configuration though.
+
When a new value is stored, a message is printed to standard error to
let users know about this.
+
Note that for security reasons, if the remote is not already
configured on the client side, nothing will be stored for that
remote. In any case, no new remote will be created and no URL will be
stored.
+
Before storing a partial clone filter, it's parsed to check it's
valid. If it's not, a warning is emitted and it's not stored.
+
Before storing a token, a check is performed to ensure it contains no
control character. If the check fails, a warning is emitted and it's
not stored.
19 changes: 19 additions & 0 deletions Documentation/fetch-options.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,25 @@ linkgit:git-config[1].
This is incompatible with `--recurse-submodules=(yes|on-demand)` and takes
precedence over the `fetch.output` config option.

`--filter=<filter-spec>`::
Use the partial clone feature and request that the server sends
a subset of reachable objects according to a given object filter.
When using `--filter`, the supplied _<filter-spec>_ is used for
the partial fetch.
+
If `--filter=auto` is used, the filter specification is determined
automatically by combining the filter specifications advertised by
the server for the promisor remotes that the client accepts (see
linkgit:gitprotocol-v2[5] and the `promisor.acceptFromServer`
configuration option in linkgit:git-config[1]).
+
For details on all other available filter specifications, see the
`--filter=<filter-spec>` option in linkgit:git-rev-list[1].
+
For example, `--filter=blob:none` will filter out all blobs (file
contents) until needed by Git. Also, `--filter=blob:limit=<size>` will
filter out all blobs of size at least _<size>_.

ifndef::git-pull[]
`--write-fetch-head`::
`--no-write-fetch-head`::
Expand Down
33 changes: 33 additions & 0 deletions Documentation/format-patch-caveats.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
The output from linkgit:git-format-patch[1] can lead to a different
commit message when applied with linkgit:git-am[1]. The patch that is
applied may also be different from the one that was generated, or patch
application may fail outright.
ifdef::git-am[]
See the <<discussion,DISCUSSION>> section above for the syntactic rules.
endif::git-am[]

ifndef::git-am[]
include::format-patch-end-of-commit-message.adoc[]
endif::git-am[]

Note that this is especially problematic for unindented diffs that occur
in the commit message; the diff in the commit message might get applied
along with the patch section, or the patch application machinery might
trip up because the patch target doesn't apply. This could for example
be caused by a diff in a Markdown code block.

The solution for this is to indent the diff or other text that could
cause problems.

This loss of fidelity might be simple to notice if you are applying
patches directly from a mailbox. However, changes originating from Git
could be applied in bulk, in which case this would be much harder to
notice. This could for example be a Linux distribution which uses patch
files to apply changes on top of the commits from the upstream
repositories. This goes to show that this behavior does not only impact
email workflows.

Given these limitations, one might be tempted to use a general-purpose
utility like patch(1) instead. However, patch(1) will not only look for
unindented diffs (like linkgit:git-am[1]) but will try to apply indented
diffs as well.
8 changes: 8 additions & 0 deletions Documentation/format-patch-end-of-commit-message.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Any line that is of the form:

* three-dashes and end-of-line, or
* a line that begins with "diff -", or
* a line that begins with "Index: "
is taken as the beginning of a patch, and the commit log message
is terminated before the first occurrence of such a line.
19 changes: 12 additions & 7 deletions Documentation/git-am.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,7 @@ applying.
create an empty commit with the contents of the e-mail message
as its log message.

[[discussion]]
DISCUSSION
----------

Expand All @@ -252,14 +253,11 @@ where the patch begins. Excess whitespace at the end of each
line is automatically stripped.

The patch is expected to be inline, directly following the
message. Any line that is of the form:
message.
include::format-patch-end-of-commit-message.adoc[]

* three-dashes and end-of-line, or
* a line that begins with "diff -", or
* a line that begins with "Index: "

is taken as the beginning of a patch, and the commit log message
is terminated before the first occurrence of such a line.
This means that the contents of the commit message can inadvertently
interrupt the processing (see the <<caveats,CAVEATS>> section below).

When initially invoking `git am`, you give it the names of the mailboxes
to process. Upon seeing the first patch that does not apply, it
Expand All @@ -283,6 +281,13 @@ commits, like running 'git am' on the wrong branch or an error in the
commits that is more easily fixed by changing the mailbox (e.g.
errors in the "From:" lines).

[[caveats]]
CAVEATS
-------

:git-am: 1
include::format-patch-caveats.adoc[]

HOOKS
-----
This command can run `applypatch-msg`, `pre-applypatch`,
Expand Down
25 changes: 20 additions & 5 deletions Documentation/git-clone.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -189,11 +189,26 @@ NOTE: see the NOTE for the `--shared` option, and also the
Use the partial clone feature and request that the server sends
a subset of reachable objects according to a given object filter.
When using `--filter`, the supplied _<filter-spec>_ is used for
the partial clone filter. For example, `--filter=blob:none` will
filter out all blobs (file contents) until needed by Git. Also,
`--filter=blob:limit=<size>` will filter out all blobs of size
at least _<size>_. For more details on filter specifications, see
the `--filter` option in linkgit:git-rev-list[1].
the partial clone filter.
+
If `--filter=auto` is used the filter specification is determined
automatically through the 'promisor-remote' protocol (see
linkgit:gitprotocol-v2[5]) by combining the filter specifications
advertised by the server for the promisor remotes that the client
accepts (see the `promisor.acceptFromServer` configuration option in
linkgit:git-config[1]). This allows the server to suggest the optimal
filter for the available promisor remotes.
+
As with other filter specifications, the "auto" value is persisted in
the configuration. This ensures that future fetches will continue to
adapt to the server's current recommendation.
+
For details on all other available filter specifications, see the
`--filter=<filter-spec>` option in linkgit:git-rev-list[1].
+
For example, `--filter=blob:none` will filter out all blobs (file
contents) until needed by Git. Also, `--filter=blob:limit=<size>` will
filter out all blobs of size at least _<size>_.

`--also-filter-submodules`::
Also apply the partial clone filter to any submodules in the repository.
Expand Down
4 changes: 4 additions & 0 deletions Documentation/git-format-patch.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -798,6 +798,10 @@ if they are part of the requested range. A simple "patch" does not
include enough information for the receiving end to reproduce the same
merge commit.

=== PATCH APPLICATION

include::format-patch-caveats.adoc[]

SEE ALSO
--------
linkgit:git-am[1], linkgit:git-send-email[1]
Expand Down
5 changes: 5 additions & 0 deletions Documentation/git-send-email.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -692,6 +692,11 @@ Links of a few such community maintained helpers are:
- https://github.com/AdityaGarg8/git-credential-email[git-msgraph]
(cross platform client that can send emails using the Microsoft Graph API)

CAVEATS
-------

include::format-patch-caveats.adoc[]

SEE ALSO
--------
linkgit:git-format-patch[1], linkgit:git-imap-send[1], mbox(5)
Expand Down
24 changes: 16 additions & 8 deletions Documentation/gitprotocol-v2.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -812,10 +812,15 @@ MUST appear first in each pr-fields, in that order.
After these mandatory fields, the server MAY advertise the following
optional fields in any order:
`partialCloneFilter`:: The filter specification used by the remote.
`partialCloneFilter`:: The filter specification for the remote. It
corresponds to the "remote.<name>.partialCloneFilter" config setting.
Clients can use this to determine if the remote's filtering strategy
is compatible with their needs (e.g., checking if both use "blob:none").
It corresponds to the "remote.<name>.partialCloneFilter" config setting.
is compatible with their needs (e.g., checking if both use
"blob:none"). Additionally they can use this through the
`--filter=auto` option in linkgit:git-clone[1]. With that option, the
filter specification of the clone will be automatically computed by
combining the filter specifications of the promisor remotes the client
accepts.
`token`:: An authentication token that clients can use when
connecting to the remote. It corresponds to the "remote.<name>.token"
Expand All @@ -826,9 +831,11 @@ are case-sensitive and MUST be transmitted exactly as specified
above. Clients MUST ignore fields they don't recognize to allow for
future protocol extensions.
For now, the client can only use information transmitted through these
fields to decide if it accepts the advertised promisor remote. In the
future that information might be used for other purposes though.
The client can use information transmitted through these fields to
decide if it accepts the advertised promisor remote. Also, the client
can be configured to store the values of these fields or use them
to automatically configure the repository (see "promisor.storeFields"
in linkgit:git-config[1] and `--filter=auto` in linkgit:git-clone[1]).
Field values MUST be urlencoded.
Expand Down Expand Up @@ -856,8 +863,9 @@ the server advertised, the client shouldn't advertise the
On the server side, the "promisor.advertise" and "promisor.sendFields"
configuration options can be used to control what it advertises. On
the client side, the "promisor.acceptFromServer" configuration option
can be used to control what it accepts. See the documentation of these
configuration options for more information.
can be used to control what it accepts, and the "promisor.storeFields"
option, to control what it stores. See the documentation of these
configuration options in linkgit:git-config[1] for more information.
Note that in the future it would be nice if the "promisor-remote"
protocol capability could be used by the server, when responding to
Expand Down
4 changes: 4 additions & 0 deletions Documentation/rev-list-options.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,10 @@ endif::git-log[]
from the point where it diverged from the remote branch, given
that arbitrary merges can be valid topic branch changes.

`--maximal-only`::
Restrict the output commits to be those that are not reachable
from any other commits in the revision range.

`--not`::
Reverses the meaning of the '{caret}' prefix (or lack thereof)
for all following revision specifiers, up to the next `--not`.
Expand Down
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -1521,6 +1521,7 @@ CLAR_TEST_SUITES += u-dir
CLAR_TEST_SUITES += u-example-decorate
CLAR_TEST_SUITES += u-hash
CLAR_TEST_SUITES += u-hashmap
CLAR_TEST_SUITES += u-list-objects-filter-options
CLAR_TEST_SUITES += u-mem-pool
CLAR_TEST_SUITES += u-oid-array
CLAR_TEST_SUITES += u-oidmap
Expand Down
Loading