Fix git diff --stat for interesting - but empty - file changes

2012-10-17 Thread Linus Torvalds
The behavior of git diff --stat is rather odd for files that have zero lines of changes: it will discount them entirely unless they were renames. Which means that the stat output will simply not show files that only had other changes: they were created or deleted, or their mode was changed. Now,

Re: Fix git diff --stat for interesting - but empty - file changes

2012-10-17 Thread Junio C Hamano
Linus Torvalds torva...@linux-foundation.org writes: So if you did chmod +x Makefile git diff --stat before, it would show empty ( 0 files changed), with this it shows Makefile | 0 1 file changed, 0 insertions(+), 0 deletions(-) which I think is a more correct diffstat (and

Re: Fix git diff --stat for interesting - but empty - file changes

2012-10-17 Thread Linus Torvalds
On Wed, Oct 17, 2012 at 11:28 AM, Junio C Hamano gits...@pobox.com wrote: I think listing a file whose content remain unchanged with 0 as the number of lines affected makes sense, and it will mesh well with Duy's http://thread.gmane.org/gmane.comp.version-control.git/207749 I first