Re: diff for deleted file only, when changed to directory
- From
Jonathan Nieder <jrnieder@gmail.com>
- Date
- Dec 8, 2010, 08:21 UTC
- Message-ID
- <20101208082103.GA4927@burratino>
- In-Reply-To
- <AANLkTimXOKC_9TJU1foNkTqPHouFPouzZw3XU_9Za=na@mail.gmail.com>
Bert Wesarg wrote:
> git > diff --cached -- foo shows me the diff for both the file foo and file > foo/bar.
[...]
> But for the case > file->directory, I would like to see only the deleted diff, not > recursing into the directory.
If I understand correctly, this is a documentation bug and feature request.
The documentation bug: the "git diff" documentation says something like
git diff [--options] [<tree>[..<tree>]] [--] [<path>...]
but the <path>s after "--" are actually patterns (path specifiers). See [1] ([RFD] git glossary: define pathspec, 2010-11-29).
The feature request: there is no way to specify an "exact match" or "negative match" when specifying paths. At least "negative match" has been suggested before.
[1] http://thread.gmane.org/gmane.comp.version-control.git/162379