Re: A better git diff --word-diff (--word-diff-regex) ?

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

 



On Mon, Mar 19, 2012 at 10:44:31AM +0100, Piotr Krukowiecki wrote:

> is there a way to configure --word-diff to be a more programming
> language friendly? For example if I add one parameter to a function
> declaration, I'd like to see only the addition of the parameter as the
> change. But currently it shows much more.
> 
> For example if
>   void foo(int x);
> is changed to
>   void foo(int x, int y);
> I'd like to see only ",int y" as the change, not "x, int y);".

This does not directly answer your question, but you may want to look at
the diff-highlight script in contrib/diff-highlight. I wrote it because
I found word-diff often unreadable, but still wanted something to
highlight small changes on a line like this.

On your example, it produces:

  -void foo(int x);
  +void foo(int x{+, int y});

except that the {+...} bit is highlighted by color, which makes it quite
readable.

-Peff
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]