From: Nguyen Thai Ngoc Duy Date: Tue, 04 Aug 2009 13:14:08 GMT Subject: Re: [PATCH 2/5] grep: skip files outside sparse checkout area Message-ID: In-Reply-To: <7vljm4st0w.fsf@alter.siamese.dyndns.org> 2009/7/31 Junio C Hamano : >> @@ -522,8 +524,11 @@ static int grep_cache(struct grep_opt *opt, const char **paths, int cached, >>                               continue; >>                       hit |= grep_sha1(opt, ce->sha1, ce->name, 0); >>               } >> -             else >> +             else { >> +                     if (ce->ce_flags & CE_VALID) >> +                             continue; >>                       hit |= grep_file(opt, ce->name); >> +             } >>               if (ce_stage(ce)) { >>                       do { >>                               nr++; > > I do not think the new code in this hunk will be reached as the other arm > of the "else" greps in the index when CE_VALID is set. > > Has this series been tested or self-reviewed yet? Yes and no. It had been tested and self-reviewed back when it was part of original series. There the new code was CE_NO_CHECKOUT check, not CE_VALID. I grepped through and replaced with CE_VALID to form a new draft in order to get comments about this direction, this time it was not well tested because my focus was in the last patch. -- Duy