On Sat, Aug 01, 2015 at 06:33:39PM -0700, Josh Triplett wrote:
> If the diff contains files with very large diffs, diffstat's automatic
> scaling can cause files with small diffs to display zero '-' or '+'
> characters.  This hides key information from the diffstat, namely
> the direction of the diff.  diffstat should always display at least one
> '-' for a file with lines removed, and at least one '+' for a file with
> lines added, regardless of scaling.

Steps to reproduce:

/tmp$ mkdir foo
/tmp$ cd foo/
/tmp/foo$ mkdir 1
/tmp/foo$ mkdir 2
/tmp/foo$ echo one-line > 2/only-in-2
/tmp/foo$ echo one-line > 1/only-in-1
/tmp/foo$ seq 1 100000 > 2/big-file
/tmp/foo$ diff -Naur 1 2 | diffstat
 big-file  |100000 
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 only-in-1 |    1 
 only-in-2 |    1 
 3 files changed, 100001 insertions(+), 1 deletion(-)


- Josh Triplett


-- 
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]

Reply via email to