Re: [PATCH 2/4] Teach git-add--interactive to accept a file path to patch
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Nov 22, 2007, 19:29 UTC
- Message-ID
- <7vsl2y3wph.fsf@gitster.siamese.dyndns.org>
- In-Reply-To
- <FDAFAD8C-8FF5-4DD7-AC5E-BA39790281A4@wincent.com>
Wincent Colaiuta <win@wincent.com> writes:
Show 12 quoted lines
> El 22/11/2007, a las 12:29, Junio C Hamano escribió: > >> By the way, the arguments on the command line to git commands >> after "--" are generally pathspecs, iow, patterns to specify >> groups of files. Please do not introduce unnecessary >> inconsistencies to the UI by requiring them to be exact pathname >> only in this particular mode of the command and nowhere else. > > Well, I it wasn't my intention to introduce any such requirement. The > path parameters get passed in and eventually handed over unmodified to: > > git diff-files -p --
What I was referring to was this in your original:
>> + my @tracked = grep {
>> + defined run_cmd_pipe(qw(git ls-files
>> + --exclude-standard --), $_)
>> + } @ARGV;It picks elements from @ARGV that ls-files says "Ok" back, not the expanded result from ls-files, and @tracked elements are used later as filenames. Which means you are expecting @ARGV to contain only concrete filenames, not pathspec.
> Or if we add some kind of "--patch" switch, instead do: > > git add -i --patch foo
You do not need both "-i" and "--patch", do you? Plain git-add does not take --patch anyway so it can pass --patch to the underlying interactive one.