Re: [PATCH] Add path-limiting to git-add--interactive
- From
Wincent Colaiuta <win@wincent.com>
- Date
- Nov 22, 2007, 11:14 UTC
- Message-ID
- <C11275B3-4E3A-4A3F-B782-BACE43953704@wincent.com>
- In-Reply-To
- <7vpry27id0.fsf@gitster.siamese.dyndns.org>
El 22/11/2007, a las 10:13, Junio C Hamano escribió:
Show 18 quoted lines
> Wincent Colaiuta <win@wincent.com> writes:
>
>> @@ -56,9 +56,14 @@ sub list_modified {
>> my ($only) = @_;
>> my (%data, @return);
>> my ($add, $del, $adddel, $file);
>> + my @tracked = grep {
>> + defined run_cmd_pipe(qw(git ls-files
>> + --exclude-standard --), $_)
>> + } @ARGV;
>> + return if $#tracked == -1 && $#ARGV != -1;
>
> Eek. why?
>
> Did you mean to say:
>
> my @tracked = run_cmd_pipe(gw(git ls-files --exclude-standard --)
> @ARGV);Bah, indeed that will work. I mistakenly (stupidly?) thought I had to check each path in @ARGV one at a time; didn't realize that I could pass in all at once and that it would do the right thing.... I've incorporated the suggested change.
> It would also make sense to use --error-unmatch and perhaps --with- > tree=HEAD > like git-commit.sh does.
My reading of the run_cmd_pipe function indicates that those options won't have any effect at all because run_cmd_pipe doesn't check the exit status of the command.
Cheers, Wincent