git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Johannes Sixt <j.sixt@viscovery.net>
Cc: Git Mailing List <git@vger.kernel.org>
Subject: Re: diff-tree -r and new directories
Date: Wed, 09 Apr 2008 23:52:54 -0700	[thread overview]
Message-ID: <7v1w5eyzeh.fsf@gitster.siamese.dyndns.org> (raw)
In-Reply-To: <47FDB3DB.8020705@viscovery.net> (Johannes Sixt's message of "Thu, 10 Apr 2008 08:29:47 +0200")

Johannes Sixt <j.sixt@viscovery.net> writes:

> In one of my scriptlets I have this:
>
>    git diff-tree -r --name-only --diff-filter=AM -z "$rev" HEAD --
>
> and I had assumed that only files would ever be listed because of the -r
> switch. But this is not true: If there is a new directory, it lists only
> the directory's name instead of the files. Is this the intent? Is it worth
> changing?

Hmm. you would need a better reproduction recipe than that.

    $ git init
    Initialized empty Git repository in .git/
    $ >file
    $ git add file
    $ git commit -a -m initial
    Created initial commit 2f9da65: initial
     0 files changed, 0 insertions(+), 0 deletions(-)
     create mode 100644 file
    $ mkdir new
    $ >new/file
    $ git add new/file
    $ git commit -a -m second
    Created commit a1fa8fb: second
     0 files changed, 0 insertions(+), 0 deletions(-)
     create mode 100644 new/file
    $ git diff-tree -r --name-only --diff-filter=AM -z HEAD^ HEAD |
      tr '\0' '\n'
    new/file
    $ git diff-tree --name-only --diff-filter=AM -z HEAD^ HEAD |
      tr '\0' '\n'
    new

Perhaps you somehow did not have "-r" even though you thought you had?

  reply	other threads:[~2008-04-10  6:54 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-10  6:29 diff-tree -r and new directories Johannes Sixt
2008-04-10  6:52 ` Junio C Hamano [this message]
2008-04-10  7:24   ` Johannes Sixt

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=7v1w5eyzeh.fsf@gitster.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=j.sixt@viscovery.net \
    /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).