From: Junio C Hamano Date: Thu, 22 Nov 2007 19:29:46 GMT Subject: Re: [PATCH 2/4] Teach git-add--interactive to accept a file path to patch Message-ID: <7vsl2y3wph.fsf@gitster.siamese.dyndns.org> In-Reply-To: Wincent Colaiuta writes: > 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.