Re: [PATCH 8/8] tree_entry_interesting(): support negative pathspec
- From
Nguyen Thai Ngoc Duy <pclouds@gmail.com>
- Date
- Sep 14, 2010, 22:46 UTC
- Message-ID
- <AANLkTinkGpWGXTEpDqm4zPRky06C9X9xUoo2roKH2kG=@mail.gmail.com>
- In-Reply-To
- <7vd3sg8fjn.fsf@alter.siamese.dyndns.org>
2010/9/15 Junio C Hamano <gitster@pobox.com>:
Show 16 quoted lines
>> diff --git a/tree-walk.c b/tree-walk.c
>> index a2f4a00..fd19681 100644
>> --- a/tree-walk.c
>> +++ b/tree-walk.c
>> @@ -532,7 +532,7 @@ int tree_entry_interesting(const struct name_entry *entry, const char *base, int
>>
>> pathlen = tree_entry_len(entry->path, entry->sha1);
>>
>> - for (i = 0; i < ps->nr; i++) {
>> + for (i = ps->nr-1; i >= 0; i--) {
>
> No explanation in the commit log message why. Besides, spell binary "-"
> operator with a SP each on both ends, please.
>
> Also the code seems to use a new term subpathspec without defining nor
> explaining. Not good.No, not good. It also has bugs as Elijah pointed out. I'm going to submit these last two patches as a separate series that will make negative match work on (hopefully) all commands.
Thanks for your comments.
-- Duy