aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/git-am.txt
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2020-02-20 15:15:18 +0100
committerJunio C Hamano <gitster@pobox.com>2020-02-20 13:20:40 -0800
commitf3b4822899dc4ddca688de285f01e1d12aeb33b6 (patch)
treeac759c1d85dbf76e6d10c84a1cc712591da527a6 /Documentation/git-am.txt
parente8ef1e8d6edd835fcea7f88d2740d756a1353190 (diff)
downloadgit-f3b4822899dc4ddca688de285f01e1d12aeb33b6.tar.gz
am: support --show-current-patch=raw as a synonym for--show-current-patch
When "git am --show-current-patch" was added in commit 984913a210 ("am: add --show-current-patch", 2018-02-12), "git am" started recommending it as a replacement for .git/rebase-merge/patch. Unfortunately the suggestion is somewhat misguided; for example, the output "git am --show-current-patch" cannot be passed to "git apply" if it is encoded as quoted-printable or base64. To simplify worktree operations and to avoid that users poke into .git, it would be better if "git am" also provided a mode that copies .git/rebase-merge/patch to stdout. One possibility could be to have completely separate options, introducing for example --show-current-message (for .git/rebase-apply/NNNN) and --show-current-diff (for .git/rebase-apply/patch), while possibly deprecating --show-current-patch. That would even remove the need for the first two patches in the series. However, the long common prefix would have prevented using an abbreviated option such as "--show". Therefore, I chose instead to add a string argument to --show-current-patch. The new argument is optional, so that "git am --show-current-patch"'s behavior remains backwards-compatible. The next choice to make is how to handle multiple --show-current-patch options. Right now, something like "git am --abort --show-current-patch" is rejected, and the previous suggestion would likewise have naturally rejected a command line like git am --show-current-message --show-current-diff Therefore, I decided to also reject for example git am --show-current-patch=diff --show-current-patch=raw In other words the whole of --show-current-patch=xxx (including the optional argument) is treated as the command mode. I found this to be more consistent and intuitive, even though it differs from the usual "last one wins" semantics of the git command line. Add the code to parse submodes based on the above design, where for now "raw" is the only valid submode. "raw" prints the full e-mail message just like "git am --show-current-patch". Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'Documentation/git-am.txt')
-rw-r--r--Documentation/git-am.txt9
1 files changed, 5 insertions, 4 deletions
diff --git a/Documentation/git-am.txt b/Documentation/git-am.txt
index 11ca61b00b..590b711536 100644
--- a/Documentation/git-am.txt
+++ b/Documentation/git-am.txt
@@ -16,7 +16,7 @@ SYNOPSIS
[--exclude=<path>] [--include=<path>] [--reject] [-q | --quiet]
[--[no-]scissors] [-S[<keyid>]] [--patch-format=<format>]
[(<mbox> | <Maildir>)...]
-'git am' (--continue | --skip | --abort | --quit | --show-current-patch)
+'git am' (--continue | --skip | --abort | --quit | --show-current-patch[=raw])
DESCRIPTION
-----------
@@ -176,9 +176,10 @@ default. You can use `--no-utf8` to override this.
Abort the patching operation but keep HEAD and the index
untouched.
---show-current-patch::
- Show the entire e-mail message "git am" has stopped at, because
- of conflicts.
+--show-current-patch[=raw]::
+ Show the raw contents of the e-mail message at which `git am`
+ has stopped due to conflicts. The argument must be omitted or
+ `raw`.
DISCUSSION
----------