Skip to content

am: provide a replacement for "cat .git/rebase-apply/patch"

[email protected] git 2 versions – New

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest5 patches 0 repliesNew
  2. v14 patches 10 repliesSuperseded

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5parse-options: add testcases for OPT_CMDMODE()t/helper/test-parse-options.c t/t0040-parse-options.sh+20 -00 replies
2/5parse-options: convert "command mode" to a flagparse-options.c parse-options.h+13 -150 replies
3/5am: convert "resume" variable to a structbuiltin/am.c+18 -140 replies
4/5am: support --show-current-patch=raw as a synonym for--show-current-patchDocumentation/git-am.txt builtin/am.c contrib/completion/git-completion.bash +1 more+73 -100 replies
5/5am: support --show-current-patch=diff to retrieve .git/rebase-apply/patchDocumentation/git-am.txt builtin/am.c contrib/completion/git-completion.bash +1 more+24 -80 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [PATCH v2 0/5] am: provide a replacement for "cat .git/rebase-apply/patch"

From: Paolo Bonzini <[email protected]>

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 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.

This series adds a new mode to "git am --show-current-patch" in order to straighten the suggestion. "--show-current-patch" grows an optional argument, where the default behavior can now also be obtained with "--show-current-patch=raw" and ".git/rebase-apply/patch" can be retrieved with "--show-current-patch=diff".

This requires a little surgery in patches 1 and 2 in order to convert --show-current-patch from OPTION_CMDMODE to OPTION_CALLBACK. After this, the last two patches implement the new syntax and feature.

Thanks,

Paolo

v1->v2: - split testcases to a separate patch [Junio]
- improve commit messages [Junio]
- fix spacing in designated initializer [Junio]
- use test_i18ngrep [Eric]
- replace abort with BUG [Eric]
- replace "diff|raw" with "(diff|raw)" in docs and help [Eric]
- improve docs wording [Eric]

Paolo Bonzini (5):
parse-options: add testcases for OPT_CMDMODE()
parse-options: convert "command mode" to a flag
am: convert "resume" variable to a struct
am: support --show-current-patch=raw as a synonym
for--show-current-patch
am: support --show-current-patch=diff to retrieve
.git/rebase-apply/patch

 Documentation/git-am.txt               | 10 +--
 builtin/am.c                           | 96 ++++++++++++++++++++------
 contrib/completion/git-completion.bash |  5 ++
 parse-options.c                        | 20 +++---
 parse-options.h                        |  8 +--
 t/helper/test-parse-options.c          |  2 +
 t/t0040-parse-options.sh               | 18 +++++
 t/t4150-am.sh                          | 20 ++++++
 8 files changed, 140 insertions(+), 39 deletions(-)
Signature · 1 line
2.21.1