Nguyễn Thái Ngọc Duy, Wed, Jul 23, 2008 16:55:49 +0200: > > +static int no_external_grep; > + If you have used direct logic instead of negative, your patch would have been simplier and the code would be easier to understand. I.e.: +static int external_grep = 1; > @@ -386,7 +388,7 @@ static int grep_cache(struct grep_opt *opt, const char **paths, int cached) > * we grep through the checked-out files. It tends to > * be a lot more optimized > */ > - if (!cached) { > + if (!cached && !no_external_grep) { + if (!cached && external_grep) { > @@ -544,6 +546,10 @@ int cmd_grep(int argc, const char **argv, const char *prefix) > cached = 1; > continue; > } > + if (!strcmp("--no-external-grep", arg)) { > + no_external_grep = 1; > + continue; > + } + if (!strcmp("--no-external-grep", arg)) { + external_grep = 0; + continue; + } BTW, how about a config option for this? And maybe --external-grep={yes|no} -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html