Re: [BUG] 'add -u' doesn't work from untracked subdir
flat view
From: Matthieu Moy <hidden>
Date: 2016-06-15 22:47:22
Clemens Buchacher [off-list ref] writes:
On Sat, Sep 05, 2009 at 12:02:35AM -0700, Junio C Hamano wrote:quoted
I personally find "add -u" that defaults to the current directory more natural than always going to the root; same preference for "grep". Besides, "add -u subdir" must add subdir relative to the cwd, without going to the root. Why should "add -u" sans argument behave drastically differently?Sorry for stating the obvious here, but the following commands affect the entire repository, even though they limit themselves to the current directory, if passed a '.'. git commit git log git diff git checkout git reset
You have to add "git add -e", "git add -i" and "git add -p" here. I completely agree that "git add -u" should have been a full-tree oriented command, just like other "git add" variants and other Git commands, from the beginning. Now, I'm unconfortable with both a behavior change and a config option. Someone used to the cwd-limited behavior typing "git add -u" on a machine configured to git the full-tree behavior could be really annoyed (not even mentionning scripts). I think it has already been proposed to introduce "git add -a" doing what "git add -u" do, but for the full tree. The "-a" option here being analogous to the one of "git commit": roughly, "git add -a; git commit" would be equivalent to "git commit -a". This would allow a long deprecation period for "git add -u". I find the proposal sensible, but IIRC it has already been rejected. -- Matthieu Moy http://www-verimag.imag.fr/~moy/