From: Nguyen Thai Ngoc Duy Date: Tue, 14 Sep 2010 22:46:26 GMT Subject: Re: [PATCH 8/8] tree_entry_interesting(): support negative pathspec Message-ID: In-Reply-To: <7vd3sg8fjn.fsf@alter.siamese.dyndns.org> 2010/9/15 Junio C Hamano : >> 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