From: Jeff King <peff@peff.net>
To: Wincent Colaiuta <win@wincent.com>
Cc: Junio C Hamano <gitster@pobox.com>, git <git@vger.kernel.org>
Subject: Re: "git add -i" with path gives "Argument list too long"
Date: Wed, 6 Jan 2010 07:19:27 -0500 [thread overview]
Message-ID: <20100106121927.GC7221@coredump.intra.peff.net> (raw)
In-Reply-To: <AAABEE5B-0419-4344-86E2-7EB550CCFC01@wincent.com>
On Tue, Jan 05, 2010 at 01:34:32PM +0100, Wincent Colaiuta wrote:
> >but note that the pathspecs given to ls-files and the path limiters
> >given to diff are not quite the same. So "git add -i '*.c'" will
> >currently find "subdir/foo.c", but would not with the above patch. Is
> >that what you meant when you said "recurse into directories"?
>
> In my relative ignorance of the finer details here, I meant that I
> would want "diff-index" to give us the exact same set of blobs as we
> get from "ls-files", so as to fix the error without modifying the
> user visible behavior.
>
> As I said, I personally wouldn't be impacted by the change in
> behavior that your patch produces, but maybe others might.
I also don't care about the globbing feature, though I suppose some
people do. However, I'm not sure add's behavior is all that sensible
now. Interactive add respects the globs, but regular add does not.
Worse, it seems that it notes that the pathspec is a wildcard and does
not even flag an error for failing to find any files. For example:
$ git init
$ echo content >foo.c
$ mkdir subdir && echo content >subdir/bar.c
$ git add .
$ echo change >foo.c && echo change >subdir/bar.c
$ git diff --name-only
foo.c
subdir/bar.c
$ git add foobar ;# should barf, and does
fatal: pathspec 'foobar' did not match any files
$ git add '*.c' ;# does not barf, but does not respect wildcard
$ git diff --name-only
foo.c
subdir/bar.c
$ yes | git add -p '*.c' ;# respects glob
$ git diff --name-only ;# empty
So it's an consistency that should probably be fixed. And of course it
is tempting to fix it by disabling the globs for the interactive case,
which would not involve writing any new code. ;) But I don't think it is
a good idea to punish people by taking away their feature in the name of
consistency.
-Peff
next prev parent reply other threads:[~2010-01-06 12:22 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-01-04 18:43 "git add -i" with path gives "Argument list too long" Wincent Colaiuta
2010-01-05 4:14 ` Jeff King
2010-01-05 5:31 ` Junio C Hamano
2010-01-05 12:34 ` Wincent Colaiuta
2010-01-06 12:19 ` Jeff King [this message]
-- strict thread matches above, loose matches on Subject: below --
2010-03-21 20:52 Wincent Colaiuta
2010-03-22 0:39 ` Jeff King
2010-03-22 1:23 ` Junio C Hamano
2010-03-22 1:41 ` Jeff King
2010-03-22 1:55 ` Junio C Hamano
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=20100106121927.GC7221@coredump.intra.peff.net \
--to=peff@peff.net \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=win@wincent.com \
/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).