From: Junio C Hamano Date: Wed, 19 Nov 2014 21:43:52 GMT Subject: Re: [RFD/PATCH] add: ignore only ignored files Message-ID: In-Reply-To: <20141119191502.GC9908@peff.net> Jeff King writes: > Typically I keep a very neat .gitignore file and just use "git add .", > which _does_ ignore those files. The real problem here is that git > cannot tell the difference between "the user explicitly asked for > foo.aux, so we should complain" and "oops, foo.aux got caught in a shell > expansion". Yup. I also find myself doing "git cmd -- \*.ext" to let Git, not my shell, handle the patterns. > I almost wonder if skipping ignored files should _always_ be a warning, > not a hard error. I guess that has unpleasant side effects for scripts > which call "git add XXX" and check the exit code, who may be > unpleasantly surprised that they missed out on some content. > > Perhaps we could do a hybrid: add the files that were not ignored, but > then still exit non-zero. Careful scripts need to check the exit status > of "git add" anyway, and sloppy humans with over-broad wildcards > typically do not care about the exit status. ;-)