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

[BUG?] "format-patch --range-diff=$commit HEAD^ HEAD" fails

From
Junio C Hamano <gitster@pobox.com>
Date
Apr 19, 2024, 17:17 UTC
Message-ID
<xmqqbk65jmqp.fsf@gitster.g>

Immediately after "git commit --amend" of a single commit, this fails:

    $ git format-patch --range-diff=@{1} -v2 HEAD^ HEAD
    fatal: --range-diff requires --cover-letter or single patch

The intent is very clear. I know it is a single-patch topic, and I want to show what I changed with "commit --amend" as a reference to the previous version. These, on the other hand, that specify the range of commits to be emitted correctly recognises that we are talking about a single patch and does not fail.

    $ git format-patch --range-diff=@{1} -v2 HEAD^
    $ git format-patch --range-diff=@{1} -v2 -1

It seems to me that the traditional "format-patch <since> <until>" notation, which is understood by everywhere else in format-patch, is not correctly understood by the code for "--range-diff" to make this complaint, to recognise that the given range has only a single commit.

Next: Junio C Hamano
Message 1 of 2 in “[BUG?] "format-patch --range-diff=$commit HEAD^ HEAD" fails”
  1. Junio C HamanoApr 19, 2024
  2. Junio C HamanoApr 20, 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.