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

Re: [RFC PATCH 7/7] diff/am: enhance diff format to use */~ for moved lines

From
Junio C Hamano <gitster@pobox.com>
Date
Aug 4, 2018, 17:15 UTC
Message-ID
<xmqqtvoarr3d.fsf@gitster-ct.c.googlers.com>
In-Reply-To
<20180804015317.182683-8-sbeller@google.com>
Stefan Beller <sbeller@google.com> writes:
Show 13 quoted lines
> Try it out via
>     ./git-format-patch --mark-moved 15ef69314d^..15ef69314d
> to see if you like it.
>
> This separates the coloring decision from the detection of moved lines.
> When giving --mark-moved, move detection is still performed and the output
> markers are adjusted to */~ for new and old code.
>
> git-apply and git-am will also accept these patches by rewriting those
> signs back to +/-.
>
> Signed-off-by: Stefan Beller <sbeller@google.com>
> ---

This does not have anything to do with the range-diff topic, but would stand on its own merit.

I have a mixed feeling about this.

If you need to convince "GNU patch" maintainers to accept these two signs, then probably it is not worth the battle of incompatiblity. If it is truly a worthy innovation, they would follow suit, which is how they learned to take our renaming diffs without us prodding them. I just do not get the gut feeling that it would happen for this particular thing, and I am not convinced myself enough to sell this to "patch" maintainers and expect to be taken seriously.

When reviewing anything complex that would be helped by moved code highlighting, I do not think a normal person would choose to review such a change only inside MUA. I certainly won't. I'd rather apply the patch and view it within a larger context than the piece of e-mail that was originally sent offers, with better tools like -W and --color-moved applied locally. So in that sense, I do not think I'd appreciate lines that begin with '~'/'*' as different kind of '-'/'+', as helpful hints; at least until my eyes get used to them, they would only appear as distraction.

In other words, I have this nagging suspicion that people who suggested to you that this would help in e-mail workflow are misguided and they do not understand e-mail workflow in the first place, but perhaps it is just me.

Thanks.
Previous: Stefan BellerNext: Stefan Beller
Message 9 of 13 in “improve range-diffs coloring and [RFC] move detection”
  1. 0/7 improve range-diffs coloring and [RFC] move detectionStefan Beller, Aug 4, 2018
  2. 1/7 diff.c: emit_line_0 to take string instead of first signStefan Beller, Aug 4, 2018
  3. 2/7 diff.c: add --output-indicator-{new, old, context}Stefan Beller, Aug 4, 2018
  4. 3/7 range-diff: make use of different output indicatorsStefan Beller, Aug 4, 2018
  5. 4/7 range-diff: indent special lines as contextStefan Beller, Aug 4, 2018
  6. 5/7 diff.c: rename color_moved to markup_movedStefan Beller, Aug 4, 2018
  7. 6/7 diff.c: factor determine_line_color out of emit_diff_symbol_from_structStefan Beller, Aug 4, 2018
  8. 7/7 diff/am: enhance diff format to use */~ for moved linesStefan Beller, Aug 4, 2018
  9. Junio C HamanoAug 4, 2018
  10. Stefan BellerAug 6, 2018
  11. Junio C HamanoAug 4, 2018
  12. Stefan BellerAug 6, 2018
  13. Junio C HamanoAug 6, 2018

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.