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

Re: [PATCH 2/2] format-patch: move range/inter diff at the end of a single patch output

From
DSDragan Simic <dsimic@manjaro.org>
Date
May 27, 2024, 12:59 UTC
Message-ID
<a4f6cf69b5fb189a80f69dcf6d5a8731@manjaro.org>
In-Reply-To
<ZlQX0FmIsz2eFgsC@tanuki>
On 2024-05-27 07:19, Patrick Steinhardt wrote:
Show 47 quoted lines
> On Fri, May 24, 2024 at 02:46:43PM -0700, Junio C Hamano wrote:
>> Patrick Steinhardt <ps@pks.im> writes:
>> > On Thu, May 23, 2024 at 03:50:07PM -0700, Junio C Hamano wrote:
>> > I also think that there's a bug here. The output from the above command
>> > is:
>> > ...
>> >     --- a/blorp
>> >     +++ b/blorp
>> >     @@ -1 +1 @@
>> >     -fnorp
>> >     +fleep
>> >     Interdiff against v1:
>> >       diff --git a/blorp b/blorp
>> > ...
>> >
>> > The diff is before the separator for the signature, and there is no
>> > clear delimiter between the actual diff and the interdiff.
>> 
>> Earlier Eric expressed concern about writing this out _after_ the
>> mail signature mark "-- ", so the output deliberately goes before
>> it.  There is no need for any marker after the last line of the
>> patch.  "Interdiff against ..." is a clear enough delimiter.
>> 
>> FWIW, the parsing of patches has always paid attention to the
>> lengths recorded in @@ ... @@ hunk headers, and the parser notices
>> where the run of ("diff --git a/... b/..." followed by a patch) ends
>> and stops without problems.  On the other hand, if you remove the
>> line "+fleep" in the above example and try to feed it to "git
>> apply", it would correctly notice that it failed to see the expected
>> one line of postimage and complains (because it sees "Interdiff
>> against..."  when it expects to see a line that begins with a plus).
>> 
>> So, I do not see any problem with the output from this cocde at all.
>> 
>> Thanks for careful reading.
> 
> The machine can cope alright. But I think that it's way harder to parse
> for a human if there is no clear visual delimiter between the diff and
> the interdiff. And "Interdiff" isn't quite ideal in my opinion because
> it is text, only, and may be quite easy to miss if it follows a long
> diff.
> 
> The signature mark may not be ideal here as an indicator. Mail readers
> may hide signatures, color them differently or other stuff. But I think
> there should be some indicator here that visually highlights the fact
> that one section is ending and another section is starting. This could
> either be a newline, or the triple-dashes as we use in other places.
I agree about the need for having a distinctive separator.
Previous: Patrick SteinhardtNext: Junio C Hamano
Message 7 of 18 in “give range-diff at the end of single patch output”
  1. 0/2 give range-diff at the end of single patch outputJunio C Hamano, May 23, 2024
  2. 1/2 show_log: factor out interdiff/range-diff generationJunio C Hamano, May 23, 2024
  3. 2/2 format-patch: move range/inter diff at the end of a single patch outputJunio C Hamano, May 23, 2024
  4. Patrick SteinhardtMay 24, 2024
  5. Junio C HamanoMay 24, 2024
  6. Patrick SteinhardtMay 27, 2024
  7. Dragan SimicMay 27, 2024
  8. Junio C HamanoMay 27, 2024
  9. Patrick SteinhardtMay 28, 2024
  10. Junio C HamanoMay 28, 2024
  11. Patrick SteinhardtMay 29, 2024
  12. Junio C HamanoMay 29, 2024
  13. Dragan SimicMay 30, 2024
  14. 2/2 format-patch: move range/inter diff at the end of a single patch outputJunio C Hamano, May 24, 2024
  15. Dragan SimicMay 23, 2024
  16. Junio C HamanoMay 23, 2024
  17. Dragan SimicMay 23, 2024
  18. Junio C HamanoMay 24, 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.