Skip to content

Color moved code differently

Stefan Beller git 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 10 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2diff.c: emit duplicate lines with a different colordiff.c diff.h+29 -10 replies
2/2WIP xdiff: markup duplicates differentlyxdiff/xdiff.h xdiff/xemit.c+127 -24 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [RFC/PATCH 0/2] Color moved code differently

When moving code (e.g. a function is moved to another part of the file or to a different file), the review process is different than reviewing new code. When reviewing moved code we are only interested in the diff as where there are differences in the moved code, e.g. namespace changes.

However the inner part of these moved texts should not change. To aid a developer reviewing such code, we'll color pure moved stuff differently.

A line is colored differently if that line and the surroundign 2 lines appear as-is in the opposite part of the diff.

Example:
http://i.imgur.com/ay84q0q.png

Or apply these patches and

    git show e28eae3184b26d3cf3293e69403babb5c575342c
    git show bc9204d4ef6e0672389fdfb0d398fa9a39dba3d5
    git show 8465541e8ce8eaf16e66ab847086779768c18f2d

The code quality sucks though, hence RFC.

Thanks,
Stefan

Stefan Beller (2):
diff.c: emit duplicate lines with a different color WIP xdiff: markup duplicates differently

 diff.c        |  26 ++++++++++++
 diff.h        |   4 +-
 xdiff/xdiff.h |   1 +
 xdiff/xemit.c | 128 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
 4 files changed, 156 insertions(+), 3 deletions(-)
Signature · 1 line
2.10.0.rc2.23.gf336a1a.dirty