Re: "git diff --stat" doesn't show added empty file
- From
Michael J Gruber <git@drmicha.warpmail.net>
- Date
- Jan 12, 2009, 15:41 UTC
- Message-ID
- <496B64BA.7000408@drmicha.warpmail.net>
- In-Reply-To
- <alpine.DEB.1.00.0901121319210.3586@pacific.mpi-cbg.de>
Johannes Schindelin venit, vidit, dixit 01/12/09 13:19:
Show 18 quoted lines
> Hi, > > On Mon, 12 Jan 2009, Ping Yin wrote: > >> $ git --version >> git version 1.6.1.9.g97c34 >> $ mkdir test && cd test && git init && git commit --allow-empty -m >> "Initial commit" >> $ touch .gitignore && git add .gitignore && git commit -m "Add empty .gitignore" >> $ git diff --stat HEAD^.. >> 0 files changed, 0 insertions(+), 0 deletions(-) >> >> May be the following is better? >> >> .gitignore | 0 + >> 1 files changed, 0 insertions(+), 0 deletions(-) > > Have fun coding that.
Removing 5 lines from diff.c does the job, except for the " +" after 0, but I don't know if that output is really better. Is the addition/removal of an empty file a file change? It's certainly a change of the containing dir, which git does not track. I don't see how to distinguish addition from removal of an empty file at that point in the code yet. This might be the "fun" part...
Michael