git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: John Cheng <johnlicheng@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: Misleading documentation for git-diff-files (diff-filter)
Date: Wed, 03 Jan 2018 15:53:15 -0800	[thread overview]
Message-ID: <xmqqvagifqj8.fsf@gitster.mtv.corp.google.com> (raw)
In-Reply-To: <CAJzZBAT--X8GXg_knege_pZ8A=_Qk9nyMCLaoRMvjhUFGQYsZA@mail.gmail.com> (John Cheng's message of "Wed, 3 Jan 2018 08:07:03 -0800")

John Cheng <johnlicheng@gmail.com> writes:

> I wanted to know if git diff-files shows files that are not in the
> index but are in the working tree.

At least in the original design of Git, that would fundamentally be
impossible, as Git _only_ cares about paths that are in the index,
so a new file won't be in the picture until it is added.  Because a
change is shown as "A"dded by the diff family of commands only when
the old side lacks a path that appears in the new side, there is no
way "diff-files" that compares the index and the working tree would
see a path that is missing from the old (i.e. the index) side.

  reply	other threads:[~2018-01-03 23:53 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-03 16:07 Misleading documentation for git-diff-files (diff-filter) John Cheng
2018-01-03 23:53 ` Junio C Hamano [this message]
2018-01-04 15:53   ` John Cheng
2018-01-04 16:49     ` Jeff King
2018-01-04 19:09       ` Junio C Hamano
2018-01-04 19:11         ` John Cheng

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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to=xmqqvagifqj8.fsf@gitster.mtv.corp.google.com \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=johnlicheng@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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).