From: Chris Packham <judge.packham@gmail.com>
To: Jeff King <peff@peff.net>
Cc: "SZEDER Gábor" <szeder@ira.uka.de>, git@vger.kernel.org
Subject: Re: git add -u nonexistent-file
Date: Tue, 9 Feb 2010 09:43:19 -0500 [thread overview]
Message-ID: <a038bef51002090643g23b35bb6xaa765ff13b80f5bb@mail.gmail.com> (raw)
In-Reply-To: <20100209003958.GA4065@coredump.intra.peff.net>
On Mon, Feb 8, 2010 at 7:39 PM, Jeff King <peff@peff.net> wrote:
> On Mon, Feb 08, 2010 at 02:12:41PM -0500, Chris Packham wrote:
>
>> > $ 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
> #
Yep my bad. I tried the non-existent case but not the "normal" case.
Re reading the man page it makes sense it just happens that the
<filepattern> part scrolls off the top when I get to the -u part.
> 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.
I think so. By not having this error it led me to think "OK it just
throws away the pathspec". Gabor rightly thought that it does use it
so shouldn't it be giving an error.
If I get brave enough I could attempt a patch but I wouldn't let that
dissuade anyone that actually knows what they're doing from jumping in
with a patch.
next prev parent reply other threads:[~2010-02-09 14:43 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-02-08 18:29 git add -u nonexistent-file SZEDER Gábor
2010-02-08 19:12 ` Chris Packham
2010-02-09 0:39 ` Jeff King
2010-02-09 14:43 ` Chris Packham [this message]
2010-02-09 21:31 ` [PATCH] test for add with non-existent pathspec Chris Packham
2010-02-09 21:58 ` git add -u nonexistent-file Junio C Hamano
2010-02-09 22:17 ` Chris Packham
2010-02-09 22:30 ` Chris Packham
2010-02-09 22:30 ` [PATCH 1/3] test for add with non-existent pathspec Chris Packham
2010-02-09 22:30 ` [PATCH 2/3] git add -u: give an error if pathspec unmatched Chris Packham
2010-02-09 22:30 ` [PATCH 3/3] t2200-add-update.sh: change expected fail to success Chris Packham
2010-02-09 23:18 ` git add -u nonexistent-file Junio C Hamano
2010-02-10 5:57 ` Jeff King
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=a038bef51002090643g23b35bb6xaa765ff13b80f5bb@mail.gmail.com \
--to=judge.packham@gmail.com \
--cc=git@vger.kernel.org \
--cc=peff@peff.net \
--cc=szeder@ira.uka.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).