{"thread":{"id":"61339","subject":"[BUG?] \"format-patch --range-diff=$commit HEAD^ HEAD\" fails","startedAt":"2024-04-19T17:17:23Z","lastAt":"2024-04-20T17:30:34Z","messageCount":2,"participants":["Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"493226","messageId":"xmqqbk65jmqp.fsf@gitster.g","threadId":"61339","inReplyTo":null,"subject":"[BUG?] \"format-patch --range-diff=$commit HEAD^ HEAD\" fails","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2024-04-19T17:17:18Z","receivedAt":"2024-04-19T17:17:23Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Immediately after \"git commit --amend\" of a single commit,\nthis fails:\n\n    $ git format-patch --range-diff=@{1} -v2 HEAD^ HEAD\n    fatal: --range-diff requires --cover-letter or single patch\n\nThe intent is very clear.  I know it is a single-patch topic, and I\nwant to show what I changed with \"commit --amend\" as a reference to\nthe previous version.  These, on the other hand, that specify the\nrange of commits to be emitted correctly recognises that we are\ntalking about a single patch and does not fail.\n\n    $ git format-patch --range-diff=@{1} -v2 HEAD^\n    $ git format-patch --range-diff=@{1} -v2 -1\n\nIt seems to me that the traditional \"format-patch <since> <until>\"\nnotation, which is understood by everywhere else in format-patch, is\nnot correctly understood by the code for \"--range-diff\" to make this\ncomplaint, to recognise that the given range has only a single commit.\n\n"},{"id":"493249","messageId":"xmqqcyqk3ps8.fsf@gitster.g","threadId":"61339","inReplyTo":"xmqqbk65jmqp.fsf@gitster.g","subject":"Re: [BUG?] \"format-patch --range-diff=$commit HEAD^ HEAD\" fails","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2024-04-20T17:30:31Z","receivedAt":"2024-04-20T17:30:34Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n> Immediately after \"git commit --amend\" of a single commit,\n> this fails:\n>\n>     $ git format-patch --range-diff=@{1} -v2 HEAD^ HEAD\n\nPlease scratch this one.  I simply forgot that we have lost\nthe\n\n\tgit format-patch <his> <mine>\n\nsyntax long time ago during Git 1.4.0 timeframe [*].  I somehow was\nconfused since we still have the corresponding\n\n\trebase <since-onto> <mine>\n\nsyntax.\n\n\n[Footnote]\n * I suspect this may not have been a conscious design decision but\n   by accident during the rewrite of the command in C that I started\n   at 3eefc189 (Tentative built-in format-patch., 2006-04-18) and\n   whose final shape was documented by 2052d146 (Update\n   documentation for git-format-patch, 2006-05-31).\n"}]}