[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] Coloring Side-By-Side Changes

From: Jim Meyering
Subject: Re: [PATCH] Coloring Side-By-Side Changes
Date: Sun, 15 Jan 2023 13:32:22 -0800

On Fri, Jan 6, 2023 at 5:21 PM Dabrien 'Dabe' Murphy <dabe@dabe.com> wrote:
> Hi,
> I apologize if this isn't the best way to submit patches, but I've often
> wondered why `diff -y` only colored the (red) deletions and (green)
> insertions, when it's often the `| ` side-by-side changes I want to spot
> quickly...  Maybe it's already been discussed to death, and shot down
> numerous times, but I couldn't find any specific conversations in the
> archives after the initial flurry of activity back in 2015.
> Anyway, these changes are pretty trivial and superficial -- and they
> don't seem to fail any existing regression tests -- though I freely
> admit I'm not particularly knowledgeable about the inner-workings of
> `diff`; it's wholly possible that I've missed any number of edge cases.
> [I often say, "Nothing is easy; if it is, you're not thinking hard enough."]
> I've broken it into two patches (attached), which can be applied in an
> either-or fashion to the current HEAD, depending on your desired level
> of customization:
> - https://dabe.com/misc/diffutils--side-color.diff
> -- This one simply re-uses the `ln` "Line Number" color palette /
> context, which, as far as I can tell, isn't displayed in side-by-side mode.
> - https://dabe.com/misc/diffutils--side-color-yc.diff
> -- This one adds a new `yc` "Side-By-Side Change" color palette /
> context, in case users want to customize it separately.  (Note: I just
> made up `yc`...  I didn't spend a LOT of time searching, but it didn't
> seem to be used in any, e.g., terminfo(5)-type documentation I could find.)

Thank you for the patches.
I suspect the lack of colorization there was just an oversight.
Adding the option (with configurability) seems like the right thing to do.
Would you like to write a complete patch, per README-hacking guidelines?

That would mean adding a test case, a NEWS entry, and filling out
copyright papers.

I'm about to make a new bug-fix-only release, but this feature could
become a part of the next one, likely in much less than two years.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]