summaryrefslogtreecommitdiffstats
path: root/Documentation
diff options
context:
space:
mode:
authorJiang Xin <worldhello.net@gmail.com>2026-04-04 11:53:49 +0800
committerJiang Xin <worldhello.net@gmail.com>2026-04-04 11:57:24 +0800
commitfc2a6741f71c71ddc7e1cc71c8f6289fcda2ff2d (patch)
treebaec3af2039bd59c01e049f3bd9e10e233d44a1d /Documentation
parent82747b07cc0f7d6fd8237633c1eb533050efba3d (diff)
parent8de2f1b07a8053d7f1aad70dc1131d6afcf5a28a (diff)
downloadgit-fc2a6741f71c71ddc7e1cc71c8f6289fcda2ff2d.tar.gz
git-fc2a6741f71c71ddc7e1cc71c8f6289fcda2ff2d.zip
Merge branch 'master' of https://github.com/git/git
Upstream adds 18 new translatable messages. * 'master' of https://github.com/git/git: (41 commits) A bit more on top of 2.54-rc0 ... Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
Diffstat (limited to 'Documentation')
-rw-r--r--Documentation/RelNotes/2.54.0.adoc11
-rw-r--r--Documentation/config/format.adoc5
-rw-r--r--Documentation/config/hook.adoc30
-rw-r--r--Documentation/git-backfill.adoc5
-rw-r--r--Documentation/git-format-patch.adoc20
-rw-r--r--Documentation/git-hook.adoc27
-rw-r--r--Documentation/git-replay.adoc52
-rw-r--r--Documentation/pretty-formats.adoc4
8 files changed, 120 insertions, 34 deletions
diff --git a/Documentation/RelNotes/2.54.0.adoc b/Documentation/RelNotes/2.54.0.adoc
index 4ce30d9d5b..629e603f43 100644
--- a/Documentation/RelNotes/2.54.0.adoc
+++ b/Documentation/RelNotes/2.54.0.adoc
@@ -109,6 +109,16 @@ UI, Workflows & Features
* "git repo info -h" and "git repo structure -h" limit their help output
to the part that is specific to the subcommand.
+ * "git format-patch --cover-letter" learns to use a simpler format
+ instead of the traditional shortlog format to list its commits with
+ a new --commit-list-format option and format.commitListFormat
+ configuration variable.
+
+ * `git backfill` learned to accept revision and pathspec arguments.
+
+ * "git replay" (experimental) learns, in addition to "pick" and
+ "replay", a new operating mode "revert".
+
Performance, Internal Implementation, Development Support etc.
--------------------------------------------------------------
@@ -495,3 +505,4 @@ Fixes since v2.53
(merge fc8a4f15e7 gi/doc-boolean-config-typofix later to maint).
(merge 37182267a0 kh/doc-interpret-trailers-1 later to maint).
(merge f64c50e768 jc/rerere-modern-strbuf-handling later to maint).
+ (merge 699248d89e th/t8003-unhide-git-failures later to maint).
diff --git a/Documentation/config/format.adoc b/Documentation/config/format.adoc
index ab0710e86a..dbd186290b 100644
--- a/Documentation/config/format.adoc
+++ b/Documentation/config/format.adoc
@@ -101,6 +101,11 @@ format.coverLetter::
generate a cover-letter only when there's more than one patch.
Default is false.
+format.commitListFormat::
+ When the `--cover-letter-format` option is not given, `format-patch`
+ uses the value of this variable to decide how to format the entry of
+ each commit. Defaults to `shortlog`.
+
format.outputDirectory::
Set a custom directory to store the resulting files instead of the
current working directory. All directory components will be created.
diff --git a/Documentation/config/hook.adoc b/Documentation/config/hook.adoc
index 64e845a260..9e78f26439 100644
--- a/Documentation/config/hook.adoc
+++ b/Documentation/config/hook.adoc
@@ -1,23 +1,23 @@
-hook.<name>.command::
- The command to execute for `hook.<name>`. `<name>` is a unique
- "friendly" name that identifies this hook. (The hook events that
- trigger the command are configured with `hook.<name>.event`.) The
- value can be an executable path or a shell oneliner. If more than
- one value is specified for the same `<name>`, only the last value
- parsed is used. See linkgit:git-hook[1].
+hook.<friendly-name>.command::
+ The command to execute for `hook.<friendly-name>`. `<friendly-name>`
+ is a unique name that identifies this hook. The hook events that
+ trigger the command are configured with `hook.<friendly-name>.event`.
+ The value can be an executable path or a shell oneliner. If more than
+ one value is specified for the same `<friendly-name>`, only the last
+ value parsed is used. See linkgit:git-hook[1].
-hook.<name>.event::
- The hook events that trigger `hook.<name>`. The value is the name
- of a hook event, like "pre-commit" or "update". (See
+hook.<friendly-name>.event::
+ The hook events that trigger `hook.<friendly-name>`. The value is the
+ name of a hook event, like "pre-commit" or "update". (See
linkgit:githooks[5] for a complete list of hook events.) On the
- specified event, the associated `hook.<name>.command` is executed.
- This is a multi-valued key. To run `hook.<name>` on multiple
+ specified event, the associated `hook.<friendly-name>.command` is executed.
+ This is a multi-valued key. To run `hook.<friendly-name>` on multiple
events, specify the key more than once. An empty value resets
the list of events, clearing any previously defined events for
- `hook.<name>`. See linkgit:git-hook[1].
+ `hook.<friendly-name>`. See linkgit:git-hook[1].
-hook.<name>.enabled::
- Whether the hook `hook.<name>` is enabled. Defaults to `true`.
+hook.<friendly-name>.enabled::
+ Whether the hook `hook.<friendly-name>` is enabled. Defaults to `true`.
Set to `false` to disable the hook without removing its
configuration. This is particularly useful when a hook is defined
in a system or global config file and needs to be disabled for a
diff --git a/Documentation/git-backfill.adoc b/Documentation/git-backfill.adoc
index b8394dcf22..246ab417c2 100644
--- a/Documentation/git-backfill.adoc
+++ b/Documentation/git-backfill.adoc
@@ -63,9 +63,12 @@ OPTIONS
current sparse-checkout. If the sparse-checkout feature is enabled,
then `--sparse` is assumed and can be disabled with `--no-sparse`.
+You may also specify the commit limiting options from linkgit:git-rev-list[1].
+
SEE ALSO
--------
-linkgit:git-clone[1].
+linkgit:git-clone[1],
+linkgit:git-rev-list[1]
GIT
---
diff --git a/Documentation/git-format-patch.adoc b/Documentation/git-format-patch.adoc
index 36146006fa..5662382450 100644
--- a/Documentation/git-format-patch.adoc
+++ b/Documentation/git-format-patch.adoc
@@ -24,6 +24,7 @@ SYNOPSIS
[(--reroll-count|-v) <n>]
[--to=<email>] [--cc=<email>]
[--[no-]cover-letter] [--quiet]
+ [--commit-list-format=<format-spec>]
[--[no-]encode-email-headers]
[--no-notes | --notes[=<ref>]]
[--interdiff=<previous>]
@@ -318,9 +319,21 @@ feeding the result to `git send-email`.
--cover-letter::
--no-cover-letter::
- In addition to the patches, generate a cover letter file
- containing the branch description, shortlog and the overall diffstat. You can
- fill in a description in the file before sending it out.
+ In addition to the patches, generate a cover letter file containing the
+ branch description, commit list and the overall diffstat. You can fill
+ in a description in the file before sending it out.
+
+--commit-list-format=<format-spec>::
+ Specify the format in which to generate the commit list of the patch
+ series. The accepted values for format-spec are `shortlog`, `modern` or
+ a format-string prefixed with `log:`. E.g. `log: %s (%an)`.
+ `modern` is the same as `log:%w(72)[%(count)/%(total)] %s`.
+ The `log:` prefix can be omitted if the format-string has a `%` in it
+ (expecting that it is part of `%<placeholder>`).
+ Defaults to the `format.commitListFormat` configuration variable, if
+ set, or `shortlog`.
+ This option given from the command-line implies the use of
+ `--cover-letter` unless `--no-cover-letter` is given.
--encode-email-headers::
--no-encode-email-headers::
@@ -453,6 +466,7 @@ with configuration variables.
signOff = true
outputDirectory = <directory>
coverLetter = auto
+ commitListFormat = shortlog
coverFromDescription = auto
------------
diff --git a/Documentation/git-hook.adoc b/Documentation/git-hook.adoc
index 12d2701b52..318c637bd8 100644
--- a/Documentation/git-hook.adoc
+++ b/Documentation/git-hook.adoc
@@ -8,8 +8,8 @@ git-hook - Run git hooks
SYNOPSIS
--------
[verse]
-'git hook' run [--ignore-missing] [--to-stdin=<path>] <hook-name> [-- <hook-args>]
-'git hook' list [-z] <hook-name>
+'git hook' run [--allow-unknown-hook-name] [--ignore-missing] [--to-stdin=<path>] <hook-name> [-- <hook-args>]
+'git hook' list [--allow-unknown-hook-name] [-z] [--show-scope] <hook-name>
DESCRIPTION
-----------
@@ -44,7 +44,7 @@ event`), and then `~/bin/spellchecker` will have a chance to check your commit
message (during the `commit-msg` hook event).
Commands are run in the order Git encounters their associated
-`hook.<name>.event` configs during the configuration parse (see
+`hook.<friendly-name>.event` configs during the configuration parse (see
linkgit:git-config[1]). Although multiple `hook.linter.event` configs can be
added, only one `hook.linter.command` event is valid - Git uses "last-one-wins"
to determine which command to run.
@@ -76,10 +76,10 @@ first start `~/bin/linter --cpp20` and second start `~/bin/leak-detector`. It
would evaluate the output of each when deciding whether to proceed with the
commit.
-For a full list of hook events which you can set your `hook.<name>.event` to,
+For a full list of hook events which you can set your `hook.<friendly-name>.event` to,
and how hooks are invoked during those events, see linkgit:githooks[5].
-Git will ignore any `hook.<name>.event` that specifies an event it doesn't
+Git will ignore any `hook.<friendly-name>.event` that specifies an event it doesn't
recognize. This is intended so that tools which wrap Git can use the hook
infrastructure to run their own hooks; see "WRAPPERS" for more guidance.
@@ -113,7 +113,7 @@ Any positional arguments to the hook should be passed after a
mandatory `--` (or `--end-of-options`, see linkgit:gitcli[7]). See
linkgit:githooks[5] for arguments hooks might expect (if any).
-list [-z]::
+list [-z] [--show-scope]::
Print a list of hooks which will be run on `<hook-name>` event. If no
hooks are configured for that event, print a warning and return 1.
Use `-z` to terminate output lines with NUL instead of newlines.
@@ -121,6 +121,13 @@ list [-z]::
OPTIONS
-------
+--allow-unknown-hook-name::
+ By default `git hook run` and `git hook list` will bail out when
+ `<hook-name>` is not a hook event known to Git (see linkgit:githooks[5]
+ for the list of known hooks). This is meant to help catch typos
+ such as `prereceive` when `pre-receive` was intended. Pass this
+ flag to allow unknown hook names.
+
--to-stdin::
For "run"; specify a file which will be streamed into the
hook's stdin. The hook will receive the entire file from
@@ -134,6 +141,12 @@ OPTIONS
-z::
Terminate "list" output lines with NUL instead of newlines.
+--show-scope::
+ For "list"; prefix each configured hook's friendly name with a
+ tab-separated config scope (e.g. `local`, `global`, `system`),
+ mirroring the output style of `git config --show-scope`. Traditional
+ hooks from the hookdir are unaffected.
+
WRAPPERS
--------
@@ -153,7 +166,7 @@ Then, in your 'mywrapper' tool, you can invoke any users' configured hooks by
running:
----
-git hook run mywrapper-start-tests \
+git hook run --allow-unknown-hook-name mywrapper-start-tests \
# providing something to stdin
--stdin some-tempfile-123 \
# execute hooks in serial
diff --git a/Documentation/git-replay.adoc b/Documentation/git-replay.adoc
index 8d696ce3ab..997097e420 100644
--- a/Documentation/git-replay.adoc
+++ b/Documentation/git-replay.adoc
@@ -9,7 +9,7 @@ git-replay - EXPERIMENTAL: Replay commits on a new base, works with bare repos t
SYNOPSIS
--------
[verse]
-(EXPERIMENTAL!) 'git replay' ([--contained] --onto <newbase> | --advance <branch>) [--ref-action[=<mode>]] <revision-range>
+(EXPERIMENTAL!) 'git replay' ([--contained] --onto <newbase> | --advance <branch> | --revert <branch>) [--ref-action[=<mode>]] <revision-range>
DESCRIPTION
-----------
@@ -42,6 +42,25 @@ The history is replayed on top of the <branch> and <branch> is updated to
point at the tip of the resulting history. This is different from `--onto`,
which uses the target only as a starting point without updating it.
+--revert <branch>::
+ Starting point at which to create the reverted commits; must be a
+ branch name.
++
+When `--revert` is specified, the commits in the revision range are reverted
+(their changes are undone) and the reverted commits are created on top of
+<branch>. The <branch> is then updated to point at the new commits. This is
+the same as running `git revert <revision-range>` but does not update the
+working tree.
++
+The commit messages follow `git revert` conventions: they are prefixed with
+"Revert" and include "This reverts commit <hash>." When reverting a commit
+whose message starts with "Revert", the new message uses "Reapply" instead.
+Unlike cherry-pick which preserves the original author, revert commits use
+the current user as the author, matching the behavior of `git revert`.
++
+This option is mutually exclusive with `--onto` and `--advance`. It is also
+incompatible with `--contained` (which is a modifier for `--onto` only).
+
--contained::
Update all branches that point at commits in
<revision-range>. Requires `--onto`.
@@ -60,10 +79,11 @@ The default mode can be configured via the `replay.refAction` configuration vari
<revision-range>::
Range of commits to replay; see "Specifying Ranges" in
- linkgit:git-rev-parse[1]. In `--advance <branch>` mode, the
- range should have a single tip, so that it's clear to which tip the
- advanced <branch> should point. Any commits in the range whose
- changes are already present in the branch the commits are being
+ linkgit:git-rev-parse[1]. In `--advance <branch>` or
+ `--revert <branch>` mode, the range should have a single tip,
+ so that it's clear to which tip the advanced or reverted
+ <branch> should point. Any commits in the range whose changes
+ are already present in the branch the commits are being
replayed onto will be dropped.
:git-replay: 1
@@ -84,9 +104,10 @@ When using `--ref-action=print`, the output is usable as input to
update refs/heads/branch3 ${NEW_branch3_HASH} ${OLD_branch3_HASH}
where the number of refs updated depends on the arguments passed and
-the shape of the history being replayed. When using `--advance`, the
-number of refs updated is always one, but for `--onto`, it can be one
-or more (rebasing multiple branches simultaneously is supported).
+the shape of the history being replayed. When using `--advance` or
+`--revert`, the number of refs updated is always one, but for `--onto`,
+it can be one or more (rebasing multiple branches simultaneously is
+supported).
There is no stderr output on conflicts; see the <<exit-status,EXIT
STATUS>> section below.
@@ -152,6 +173,21 @@ all commits they have since `base`, playing them on top of
`origin/main`. These three branches may have commits on top of `base`
that they have in common, but that does not need to be the case.
+To revert commits on a branch:
+
+------------
+$ git replay --revert main topic~2..topic
+------------
+
+This reverts the last two commits from `topic`, creating revert commits on
+top of `main`, and updates `main` to point at the result. This is useful when
+commits from `topic` were previously merged or cherry-picked into `main` and
+need to be undone.
+
+NOTE: For reverting an entire merge request as a single commit (rather than
+commit-by-commit), consider using `git merge-tree --merge-base $TIP HEAD $BASE`
+which can avoid unnecessary merge conflicts.
+
GIT
---
Part of the linkgit:git[1] suite
diff --git a/Documentation/pretty-formats.adoc b/Documentation/pretty-formats.adoc
index 5405e57a60..2ae0eb11a9 100644
--- a/Documentation/pretty-formats.adoc
+++ b/Documentation/pretty-formats.adoc
@@ -253,6 +253,10 @@ The placeholders are:
linkgit:git-rev-list[1])
+%d+:: ref names, like the --decorate option of linkgit:git-log[1]
+%D+:: ref names without the " (", ")" wrapping.
++%(count)+:: the number of a patch within a patch series. Used only in
+ `--commit-list-format` in `format-patch`
++%(total)+:: the total number of patches in a patch series. Used only in
+ `--commit-list-format` in `format-patch`
++%(decorate++`[:<option>,...]`++)++::
ref names with custom decorations. The `decorate` string may be followed by a
colon and zero or more comma-separated options. Option values may contain