git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andreas Schwab <schwab@linux-m68k.org>
To: Luiz Ramos <luizzramos@yahoo.com.br>
Cc: git@vger.kernel.org
Subject: Re: About git-diff
Date: Wed, 10 Aug 2011 19:01:49 +0200	[thread overview]
Message-ID: <m2hb5pb3pe.fsf@igel.home> (raw)
In-Reply-To: <1312941177.17928.YahooMailClassic@web121810.mail.ne1.yahoo.com> (Luiz Ramos's message of "Tue, 9 Aug 2011 18:52:57 -0700 (PDT)")

Luiz Ramos <luizzramos@yahoo.com.br> writes:

> If I run:
>
> $ git diff b2 ./
>
> that is, the "non-cached" version, it will show the same results. This is
> confusing IMHO, because the git-diff manual suggests that invocation
> should render the difference between the named tree contents and the
> working directory. In the working directory, only to recall, file_1 and
> file_2 are both present and with good versions. In my understanding, the
> command should report that file_1 is in excess in the working directory,
> relative to b2, and report nothing about file_2, as it is in the same
> version as the sample in the tree b2.

Since file_2 is not tracked in the current branch, its existence in the
directory is ignored.

> This doesn't seem to be the same thing git-diff-index manual states,
> however. The manual gets more deep into the details, and it's not so easy
> to understand it unless one knows a lot of the inner commands, which does
> not apply to me. In my basic reading, it seems that behind the scenes,
> git-diff-index is what is run in this case, and the fact that file_2 is
> not in the tree associated to b1 is a relevant thing in this case. So, the
> index seem to matter, and if I try to do it, a previous "git update-index"
> should be done.

It's not the index, but the current tree that matters:

           show me the differences between HEAD and the currently checked out
           tree - index contents _and_ files that aren't up-to-date

Note that it talks about "files that aren't up-to-date".  Thus untracked
files are not considered.

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

  reply	other threads:[~2011-08-10 17:02 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-10  1:52 About git-diff Luiz Ramos
2011-08-10 17:01 ` Andreas Schwab [this message]
2011-08-11  0:53   ` Luiz Ramos
2011-08-11  4:49     ` Junio C Hamano
2011-08-11 11:17       ` Luiz Ramos

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=m2hb5pb3pe.fsf@igel.home \
    --to=schwab@linux-m68k.org \
    --cc=git@vger.kernel.org \
    --cc=luizzramos@yahoo.com.br \
    /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).