git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 4/4] am: support --show-current-patch=diff to retrieve .git/rebase-apply/patch

From
Eric Sunshine <sunshine@sunshineco.com>
Date
Feb 19, 2020, 19:49 UTC
Message-ID
<CAPig+cR2VLDYc_UpbWySFSF49Uo0twVyGRXgVx3Z6w1R04aavg@mail.gmail.com>
In-Reply-To
<20200219161352.13562-5-pbonzini@redhat.com>
On Wed, Feb 19, 2020 at 11:15 AM <pbonzini@redhat.com> wrote:
Show 14 quoted lines
> 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.
> Add a new mode to "git am --show-current-patch" in order to straighten
> the suggestion.
>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
> diff --git a/Documentation/git-am.txt b/Documentation/git-am.txt
> @@ -16,7 +16,7 @@ SYNOPSIS
> -'git am' (--continue | --skip | --abort | --quit | --show-current-patch[=raw])
> +'git am' (--continue | --skip | --abort | --quit | --show-current-patch[=raw|diff])

Missing parentheses. To be consistent with other documentation, this should be written as:

    --show-current-patch[=(raw|diff)]
Show 5 quoted lines
> @@ -176,9 +176,11 @@ default.   You can use `--no-utf8` to override this.
> ---show-current-patch[=raw]::
> -       Show the entire e-mail message "git am" has stopped at, because
> -       of conflicts.
> +--show-current-patch[=raw|diff]::
Ditto: --show-current-patch[=(raw|diff)]::
> +       Show the message "git am" has stopped at, because of conflicts.
The weirdly-placed comma is still weird.
> +       If the argument is absent or "raw", show the raw contents of
> +       the e-mail message.  If the argument is "diff", show the diff
> +       portion only.
I think the usual term is "omitted" rather than "absent".
Suggested rewrite:
    Show the message at which `git am` has stopped due to conflicts.
    If `raw` is specified, show the raw contents of the e-mail
    message; if `diff`, show the diff portion only. Defaults to `raw`.
This also simplifies the change if the default ever flips from "raw" to "diff".
Previous: pbonzini@redhat.com
Message 15 of 15 in “am: provide a replacement for "cat .git/rebase-apply/patch"”
  1. 0/4 am: provide a replacement for "cat .git/rebase-apply/patch"pbonzini@redhat.com, Feb 19, 2020
  2. 1/4 parse-options: convert "command mode" to a flagpbonzini@redhat.com, Feb 19, 2020
  3. Eric SunshineFeb 19, 2020
  4. Johannes SchindelinFeb 20, 2020
  5. Junio C HamanoFeb 19, 2020
  6. Paolo BonziniFeb 19, 2020
  7. 2/4 am: convert "resume" variable to a structpbonzini@redhat.com, Feb 19, 2020
  8. Junio C HamanoFeb 19, 2020
  9. Paolo BonziniFeb 19, 2020
  10. 3/4 am: support --show-current-patch=raw as a synonym for--show-current-patchpbonzini@redhat.com, Feb 19, 2020
  11. Eric SunshineFeb 19, 2020
  12. Junio C HamanoFeb 19, 2020
  13. Paolo BonziniFeb 19, 2020
  14. 4/4 am: support --show-current-patch=diff to retrieve .git/rebase-apply/patchpbonzini@redhat.com, Feb 19, 2020
  15. Eric SunshineFeb 19, 2020

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.