From: Nguyen Thai Ngoc Duy Date: Wed, 08 Dec 2010 09:56:32 GMT Subject: Re: diff for deleted file only, when changed to directory Message-ID: In-Reply-To: 2010/12/8 Bert Wesarg : > 2010/12/8 Jonathan Nieder : >> 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] [[..]] [--] [...] >> >> but the 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. >> > > Thanks for the pointers. > > I don't expect that we can change to match only files and not directories. Try diff --cached -- '[f]' From top of my memory, directory matching does not work with wildcards. By putting wildcards to your patterns, dir should never be matched again. I haven't tested it though. -- Duy