Thread (2 messages) flat view 2 messages, 2 authors, 2016-06-15

Re: [PATCH] Built-in diff driver shows Index: line.

From: Linus Torvalds <torvalds@osdl.org>
Date: 2016-06-15 22:41:55


On Thu, 28 Apr 2005, Junio C Hamano wrote:
So I'd say we'd punt this one for now, unless somebody else has
a better idea.
It's trivially easy to do it with a external diff helper.

So you can do it with a few lines of GIT_EXTERNAL_DIFF, and the hardest 
part is showing it in a nice format (ie do the normalization of the 
results that diffstat does).

The external diff program can _literally_ just do something like

	#!/bin/sh
	name="$1"
	src="$2"
	dst="$5"
	diff "$src" "$dst" | cut -c1 | grep '[<>]' | sort | uniq -c

and the output should be something like

    458 <
    104 >

which means "458 lines removed, 104 lines added". Pretty-print it some, 
and you're done.

Hacky hacky,

		Linus
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help