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

Re: [PATCH] doc/git-format-patch: link git-apply

From
Junio C Hamano <gitster@pobox.com>
Date
Sep 23, 2024, 17:03 UTC
Message-ID
<xmqqtte62tgz.fsf@gitster.g>
In-Reply-To
<pull.1785.git.git.1727010037470.gitgitgadget@gmail.com>
"Alexander Ziaee via GitGitGadget" <gitgitgadget@gmail.com> writes:
> From: Alexander Ziaee <ziaee@google.com>
>
> git formatted patches can be applied with git-apply(1),

Not necessarily. They are meant to be consumed via "am", which knows how to unwrap MIME, split the message into the log part and the diff part, and create a commit out of the result, by calling "mailinfo", "apply" and "comimt-tree" as the underlying mechanism.

Simple patches can often be consumed by "apply", but that is not guaranteed.

To put it another way, if we link "apply" because format-patch output can (sometimes) be consumed with the command in order to use its the diff part, we would need to link "mailinfo" because the format-patch output can (always) be consumed with the command in order to extract the log message part and separate the diff part out. So I am modereately negative on this change, especially we already refer readers to "am" (and "am" in turn refers to "apply").

Thanks.
Show 28 quoted lines
> so link git-apply(1) in git-format-patch(1) § see also.
>
> Signed-off-by:	Alexander Ziaee <ziaee@google.com>
> ---
>     doc/git-format-patch: link git-apply
>
> Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-1785%2Fconcussious%2Fmaster-v1
> Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-1785/concussious/master-v1
> Pull-Request: https://github.com/git/git/pull/1785
>
>  Documentation/git-format-patch.txt | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/Documentation/git-format-patch.txt b/Documentation/git-format-patch.txt
> index 8708b315930..eeebc805d6c 100644
> --- a/Documentation/git-format-patch.txt
> +++ b/Documentation/git-format-patch.txt
> @@ -790,7 +790,7 @@ merge commit.
>  
>  SEE ALSO
>  --------
> -linkgit:git-am[1], linkgit:git-send-email[1]
> +linkgit:git-am[1], linkgit:git-apply[1], linkgit:git-send-email[1]
>  
>  GIT
>  ---
>
> base-commit: 94b60adee30619a05296cf5ed6addb0e6d4e25dc
Previous: Alexander Ziaee via GitGitGadget
Message 2 of 2 in “doc/git-format-patch: link git-apply”
  1. doc/git-format-patch: link git-applyAlexander Ziaee via GitGitGadget, Sep 22, 2024
  2. Junio C HamanoSep 23, 2024

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.