Re: git add -u nonexistent-file
- From
Jeff King <peff@peff.net>
- Date
- Feb 9, 2010, 00:39 UTC
- Message-ID
- <20100209003958.GA4065@coredump.intra.peff.net>
- In-Reply-To
- <a038bef51002081112s2d552835m4b34973f797ab4f8@mail.gmail.com>
On Mon, Feb 08, 2010 at 02:12:41PM -0500, Chris Packham wrote:
Show 7 quoted lines
> > $ git add -u nonexistent-file > > $ echo $? > > 0 > [...] > It looks like in the case you've highlighted git is ignoring the extra > non-option parameters on the command line. I'll let other people argue > whether this is by design or omission.
It's not ignoring the extra parameters. They limit the scope of the operation. So:
$ git init $ touch file && mkdir subdir && touch subdir/file $ git add . && git commit -m one $ echo changes >file && echo changes >subdir/file $ git add -u subdir $ git status # On branch master # Changes to be committed: # modified: subdir/file # # Changed but not updated: # modified: file #
That being said, you noticed that the regular add case notes unused pathspecs on the command line:
$ git add bogus fatal: pathspec 'bogus' did not match any files
We could probably do the same here.
-Peff