Re: [RFC/PATCH] add: warn when -u or -A is used without filepattern
- From
Matthieu Moy <matthieu.moy@grenoble-inp.fr>
- Date
- Jan 22, 2013, 07:39 UTC
- Message-ID
- <vpq1uddoedj.fsf@grenoble-inp.fr>
- In-Reply-To
- <20130121222248.GA3586@elie.Belkin>
Jonathan Nieder <jrnieder@gmail.com> writes:
Show 7 quoted lines
> Would it be possible to make this conditional on cwd not being at the
> toplevel (the case where "git add -u :/" and "git add -u ." have
> different behavior)? E.g.,
>
> static const char *here[2] = { ".", NULL };
> if (prefix)
> warning(...);I thought about this too, after writting the patch. Actually, I still I it makes sense to warn even from the toplevel, since the point is to teach people to stop using pathless "git add -u" for a while, so I'd say it's easier to teach this in every condition. OTOH, the next step (forbidding pathless "git add -u") can still allow it from the toplevel to minimize the pain.
But I'm starting to be convinced ;-).
Any other thought on the question?
-- Matthieu Moy http://www-verimag.imag.fr/~moy/