git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Michael J Gruber <git@drmicha.warpmail.net>
To: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Cc: Ping Yin <pkufranky@gmail.com>, Git Mailing List <git@vger.kernel.org>
Subject: Re: "git diff --stat" doesn't show added empty file
Date: Mon, 12 Jan 2009 16:41:46 +0100	[thread overview]
Message-ID: <496B64BA.7000408@drmicha.warpmail.net> (raw)
In-Reply-To: <alpine.DEB.1.00.0901121319210.3586@pacific.mpi-cbg.de>

Johannes Schindelin venit, vidit, dixit 01/12/09 13:19:
> 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

  reply	other threads:[~2009-01-12 15:43 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-12  3:36 "git diff --stat" doesn't show added empty file Ping Yin
2009-01-12 12:19 ` Johannes Schindelin
2009-01-12 15:41   ` Michael J Gruber [this message]
2009-01-13 11:27     ` Johannes Schindelin
2009-01-12 16:13 ` Linus Torvalds
2009-01-13  7:42   ` Ping Yin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=496B64BA.7000408@drmicha.warpmail.net \
    --to=git@drmicha.warpmail.net \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=git@vger.kernel.org \
    --cc=pkufranky@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).