Thomas Rast <tr...@inf.ethz.ch> writes:

> The warning triggers in some cases where it shouldn't, relating to
> submodules:
>
>   $ git submodule add gito...@git.csa.inf.ethz.ch:domjudge.git domjudge
>   Adding existing repo at 'domjudge' to the index
>   warning: In Git 2.0, 'git add <pathspec>...' will also update
>   the index for paths removed from the working tree that match
>   the given pathspec. If you want to 'add' only changed
>   or newly created paths, say 'git add --no-all <pathspec>...' instead.

Good one.  So "add" used internally there needs to say --no-add?

> It also seems to hint that the problem is with giving a 'pathspec', but
> in fact in the case of a "proper" pathspec (that isn't an existing path)
> it does *not* trigger, even though it probably should:

We have seen users who explicitly say:

        git add dir

after removing dir/del and adding dir/ins got surprised that we do
not notice removal of dir/del without "add -A".  And it is fairly
straight-forward to check and warn for such a case.

> That's of course assuming that you want to unconditionally make -A the
> default.

I thought what the warning text says is what we decided to do
eventually.  Not "unconditionally", but "with <pathspec>", but not
"only with pathspec that exactly matches an existing path".  It
appears that we would better discuss and decide such details
further, so let's revert the "warn early" bits from master and kick
the topic back.

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to