git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Kai Grossjohann <kai.grossjohann@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: Documentation: "git am" should point to "git format-patch"
Date: Tue, 21 Mar 2023 10:27:08 -0700	[thread overview]
Message-ID: <xmqq1qlij9qr.fsf@gitster.g> (raw)
In-Reply-To: <CAFmGgWVVdgQj_gzcDw4Lyzt1aBc-7oyt8=JT3GskHegUu+8sTg@mail.gmail.com> (Kai Grossjohann's message of "Tue, 21 Mar 2023 17:40:32 +0100")

Kai Grossjohann <kai.grossjohann@gmail.com> writes:

> The man page of "git format-patch" already mentions that its output
> can be consumed by "git am".  I suggest to add a similar remark to the
> man page of "git am" to mention that it consumes output from "git
> format-patch".

There were two reasons we didn't do this.  As "git am" is designed
to grok e-mailed patches, not necessarily taken out of a Git
repostiory or even if it came from a Git repository not necessarily
produced with format-patch, we didn't want to single it out as the
"blessed" input producer to the command.  Also, in the original
workflow that "git am" was invented for, the user of "am" was
expected to be a different person than the users of "format-patch".

But I think that it is a very safe change to make in 2023.  Thanks
to the effort by many contributors, Git ended up becoming a bit more
popular than we initially thought it would be, and "format-patch",
which took me a few weeks to pursuade Linus to take in 2005, seems
to have become the de-facto standard tool to produce patch e-mails.

Interestingly, the documentation for "git apply", which is listed in
SEE ALSO section of "git am" documentation, does mention "am" and
"format-patch" as two things that are related but different from
"apply" in an early part.


 Documentation/git-am.txt | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git c/Documentation/git-am.txt w/Documentation/git-am.txt
index 0c1dfb3c98..900be198b1 100644
--- c/Documentation/git-am.txt
+++ w/Documentation/git-am.txt
@@ -24,7 +24,9 @@ DESCRIPTION
 -----------
 Splits mail messages in a mailbox into commit log message,
 authorship information and patches, and applies them to the
-current branch.
+current branch. You could think of it as a reverse operation
+of linkgit:git-format-patch[1] run on a branch with a straight
+history without merges.
 
 OPTIONS
 -------
@@ -273,7 +275,8 @@ include::config/am.txt[]
 
 SEE ALSO
 --------
-linkgit:git-apply[1].
+linkgit:git-apply[1],
+linkgit:git-format-patch[1].
 
 GIT
 ---

      reply	other threads:[~2023-03-21 17:27 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-21 16:40 Documentation: "git am" should point to "git format-patch" Kai Grossjohann
2023-03-21 17:27 ` Junio C Hamano [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqq1qlij9qr.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=kai.grossjohann@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).