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

Re: Do "git add" as a builtin

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:42:26

Linus Torvalds [off-list ref] writes:
... I dropped the strange "--error-unmatch" test, because it
was really ugly and I didn't see the point.
By "not seeing the point", do you mean you do not agree with
what bba319b5 and 45e48120 tried to do to help users?

        $ git add no-such-path-in-the-tree
        $ git add 'this-pattern-matches-nobody*'

More realistically:

	$ git add Documentaiton		;# misspelled


[References]

(bba319b5)
When you say "git commit Documentaiton" to make partial commit
for the files only in that directory, we did not detect that as
a misspelled pathname and attempted to commit index without
change.  If nothing matched, there is no harm done, but if the
index gets modified otherwise by having another valid pathspec
or after an explicit update-index, a user will not notice
without paying attention to the "git status" preview.

This introduces --error-unmatch option to ls-files, and uses it
to detect this common user error.

(45e48120)
This is in the same spirit as an earlier patch for git-commit.
It does an extra ls-files to avoid complaining when a fully
tracked directory name is given on the command line (otherwise
--others restriction would say the pathspec does not match).
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help