From: Jeff King Date: Mon, 26 Nov 2007 04:14:38 GMT Subject: Re: [PATCH] builtin-add: fix command line building to call interactive Message-ID: <20071126041437.GA6471@sigill.intra.peff.net> In-Reply-To: <7vprxyksxf.fsf@gitster.siamese.dyndns.org> On Sun, Nov 25, 2007 at 11:48:28AM -0800, Junio C Hamano wrote: > > git-add -i *.h > > > > (Note that's "*.h" and not "\*.h"). In the Git repository, without > > validation, this just works. With strict validation, it would complain... > > I'd mostly agree, but we need to realize that this is a two edged sword. > Pathspecs can be leading-directories or fileglobs. For fileglobs, you > are right. The user can let the shell do the globbing. Not validating, > however, also means that > > git add -p Documentatoin > > would report "there is nothing to patch" without being helpful, pointing > out that the name of the directory is misspelled. I think the problem there is not validation, but that the previous proposal was validating the wrong thing. IOW, the user doesn't want a complaint "this file is not tracked by git" (which catches untracked things with *.h) but rather "this file does not even exist" (which catches typos like Documentatoin). So it is not really a git pathspec being provided (from the user's point of view), but rather something else (a pathspec _or_ a working tree file). -Peff