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

[PATCH 0/7] improve range-diffs coloring and [RFC] move detection

From
Stefan Beller <sbeller@google.com>
Date
Aug 4, 2018, 01:53 UTC
Message-ID
<20180804015317.182683-1-sbeller@google.com>
This builds on top of sb/range-diff-colors, which builds on js/range-diff.
As Thomas seemed happy with the range-diff and said
"and fwiw I didn't think there's anything major that needs to be addressed."
I found it reasonable to build more on top of those series.
[1] https://public-inbox.org/git/20180729215053.GE9955@hank.intra.tgummerer.com/
It can also be found via
  git fetch https://github.com/stefanbeller/git moved-in-patches
This series provides for 2 goals, which share a common base refactoring:

The refactoring part is to allow the diff machinery to prefix old/new/context lines with prefixes as chosen by the user.

The first feature is to slightly adapt coloring of range-diff to have the file markers

  --- a/diff.c
  +++ b/diff.c
  
be shown as context color. This is done by using custom prefixes for
old/new/context lines in the inner diffs and indenting all other lines
instead by a white space indicating it to be context.

The second feature is more RFC-ish in nature and just exposes the mechanism to the user in a meaning-ful way. All of the diff family (including format-patch) as well as apply/am can use */~ instead of +/- for moved lines of code.

Thanks, Stefan

Stefan Beller (7):
  diff.c: emit_line_0 to take string instead of first sign
  diff.c: add --output-indicator-{new, old, context}
  range-diff: make use of different output indicators
  range-diff: indent special lines as context
  diff.c: rename color_moved to markup_moved
  diff.c: factor determine_line_color out of
    emit_diff_symbol_from_struct
  diff/am: enhance diff format to use */~ for moved lines
 apply.c               |  12 +++
 diff.c                | 180 ++++++++++++++++++++++++++----------------
 diff.h                |  10 ++-
 range-diff.c          |  17 +++-
 t/t3206-range-diff.sh |  12 +--
 5 files changed, 153 insertions(+), 78 deletions(-)
-- 
2.18.0.597.ga71716f1ad-goog
Next: Stefan Beller
Message 1 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.