Web lists-archives.com

Re: Bug#925288: ITP: diff-so-fancy -- Good-lookin' diffs. Actually… nah… The best-lookin' diffs.




On Fri, Mar 22, 2019 at 03:34:37PM +0100, Adam Borowski wrote:
[snip]
> Highlighting changes inside the line is a massive improvement.
> 
> There's an implementation of this in "git" itself already, named
> diff-highlight.  Alas, either I'm a complete idiot, or its documentation is
> not quite adequate -- some time ago I wasted over an hour trying to get that
> implementation to work, without success.

[roam@straylight ~]$ cat ~/bin/hdiff
#!/bin/sh

: "${DIFF_HIGHLIGHT:=/usr/share/doc/git/contrib/diff-highlight}"

exec perl -I "$DIFF_HIGHLIGHT" -MDiffHighlight -- "$DIFF_HIGHLIGHT/diff-highlight.perl" | exec less -r
[roam@straylight ~]$ cat ~/bin/git-hdiff 
#!/bin/sh

exec git diff --color "$@" | exec hdiff
[roam@straylight ~]$ cat ~/bin/git-hshow 
#!/bin/sh

exec git show --color "$@" | exec hdiff
[roam@straylight ~]$

You're welcome... and thanks for bringing diff-highlight to my attention so
that I could whip these up :)  Now only to figure out how to get the colors
more similar to the ones that Vim uses (I use a ~/bin/vdiff script that
pipes stuff through `vim -c 'set ft=diff' -` and I really, really like its
colors)...

G'luck,
Peter

-- 
Peter Pentchev  roam@{ringlet.net,debian.org,FreeBSD.org} pp@xxxxxxxxxxxx
PGP key:        http://people.FreeBSD.org/~roam/roam.key.asc
Key fingerprint 2EE7 A7A5 17FC 124C F115  C354 651E EFB0 2527 DF13

Attachment: signature.asc
Description: PGP signature