On Tue, 2 Dec 2014 14:42:27 +0100 Guilherme <guibuf...@gmail.com> wrote:
> In my .git/info/exclude i have the patterns: > > !COM/config/Project.gny > (...) other ignores > /COM/config > (...) more ignores > > When i do > > git add -- COM/config/Project.gny > > I get no warnings or abort about the ignored path (as i expect) but > > git add -- COM/config/Project.gny COM/otherfile.c > > It outputs: > The following paths are ignored by one of your .gitignore files: > COM/config > Use -f if you really want to add them. > fatal: no files added > > I don't understand the difference in the behaviour. Is this intended? To me, this appears to be a bug. One possible reason for observable irregularity in behaviour is that the Git code may contain a shortcut dealing with the case of a single file. Dealing with several pathspecs at once supposedly requires first sorting them to remove duplicates, accounting for "generality" cases like git add somedir somedir/somefile (where some pathspecs are essentially no-ops) and so on, hence I may well beleive there is some sort of a shortcut which jumps right to the actuall adding of the file is there's just a single pathspec passed. Quite possible the "full" code path contains a bug. Of course, my guess is quite wild and may be completely wrong, but I'm still inclined to deem what you reported as being a bug. In any case, to be useful, your bug report shold be rather more complete: * What precise version of Git are you using (run `git --version`). * What OS it runs on? And bugs should be reported on the main Git list which is <git at vger.kernel.org>. It's okay to not be subscribed to that list to post but make sure your mail program does not produce HTML-formatted messages -- they will be rejected.  contains more pointers on this. 1. https://gist.github.com/tfnico/4441562 -- You received this message because you are subscribed to the Google Groups "Git for human beings" group. To unsubscribe from this group and stop receiving emails from it, send an email to git-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.