Re: [PATCH 1.8.0] add: make "add -u" update full tree without pathspec
- From
- Joshua Juran <jjuran@gmail.com>
- Date
- Feb 9, 2011, 10:58 UTC
- Message-ID
- <9CBA512E-D62E-483C-BEBD-D9E41083756E@gmail.com>
- In-Reply-To
- <AANLkTimG6s5vSCnisJCt-EXkcJGXfY4Y3WtdB_netU08@mail.gmail.com>
On Feb 6, 2011, at 10:14 PM, Nguyen Thai Ngoc Duy wrote:
Show 20 quoted lines
> On Mon, Feb 7, 2011 at 12:58 PM, Junio C Hamano <gitster@pobox.com> > wrote: >> Nguyễn Thái Ngọc Duy <pclouds@gmail.com> writes: >> >>> When -u was introduced in dfdac5d (git-add -u: match the index with >>> working tree., 2007-04-20), "add -u" (without pathspec) added >>> everything. Shortly after, 2ed2c22 (git-add -u paths... now works >>> from >>> subdirectory, 2007-08-16) broke it while fixing something related. >> >> As long as the command takes pathspecs, it should never be tree-wide. >> Making it tree-wide when there is no pathspec is even worse. > > git log -p and diff family all can take pathspecs. All default to > tree-wide without pathspecs. This is what I'm doing all the time: > > git diff > # checking, ok, looks good > git add -u > # ack, need to come to root dir first
The only reason I'm not routinely bitten by this is that I'm generally always at the root of the tree. But I certainly *think* about it as an operation that's tree-wide, not local. If I meant to limit the scope, I'd specify a path.
Josh