Thread (2 messages) flat view 2 messages, 2 authors, 2016-06-15

Re: [PATCH] builtin-add: fix command line building to call interactive

From: Jeff King <hidden>
Date: 2016-06-15 22:43:53

Possibly related (same subject, not in this thread)

On Sun, Nov 25, 2007 at 11:48:28AM -0800, Junio C Hamano wrote:
quoted
	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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help