Re: "git add -u" broken in git 1.7.4?
- From
Jeff King <peff@peff.net>
- Date
- Feb 6, 2011, 05:13 UTC
- Message-ID
- <20110206051333.GA3458@sigill.intra.peff.net>
- In-Reply-To
- <4D4DEDC4.4080708@hartwork.org>
On Sun, Feb 06, 2011 at 01:39:32AM +0100, Sebastian Pipping wrote:
Show 11 quoted lines
> I just ran into case where > > git add -u > > repetedly did not update the index. In contrast, picking stuff using > > git add -p > > works just fine. > > Could it be "git add -u" is broken in git 1.7.4?
It could be. However, I can think of one such case where you might see that behavior. "git add -u" operates from the current subdirectory, whereas "git add -p" operates from the top of the project tree (yes, this inconsistency confusing, but it's not as serious as "git add -u doesn't work").
You can demonstrate it with:
mkdir repo && cd repo && git init mkdir subdir && echo content >file git add . && git commit -m base echo more >>file
mkdir subdir && cd subdir git add -u git status ;# still not staged for commit
git add -p ;# finds it
Might you have been in a subdirectory of the project when you saw this behavior?
-Peff