Re: [PATCH 3/6] log --grep: use the same helper to set -E/-F options as "git grep"

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Oct 03, 2012 at 06:33:36PM -0700, Junio C Hamano wrote:

> diff --git a/revision.c b/revision.c
> index a09e60b..7f5e53b 100644
> --- a/revision.c
> +++ b/revision.c
> @@ -1604,12 +1604,12 @@ static int handle_revision_opt(struct rev_info *revs, int argc, const char **arg
>  	} else if (!strcmp(arg, "--grep-debug")) {
>  		revs->grep_filter.debug = 1;
>  	} else if (!strcmp(arg, "--extended-regexp") || !strcmp(arg, "-E")) {
> -		revs->grep_filter.regflags |= REG_EXTENDED;
> +		grep_set_pattern_type_option(GREP_PATTERN_TYPE_ERE, &revs->grep_filter);
>  	} else if (!strcmp(arg, "--regexp-ignore-case") || !strcmp(arg, "-i")) {
>  		revs->grep_filter.regflags |= REG_ICASE;
>  		DIFF_OPT_SET(&revs->diffopt, PICKAXE_IGNORE_CASE);
>  	} else if (!strcmp(arg, "--fixed-strings") || !strcmp(arg, "-F")) {
> -		revs->grep_filter.fixed = 1;
> +		grep_set_pattern_type_option(GREP_PATTERN_TYPE_FIXED, &revs->grep_filter);

Very nice. After seeing the discussion on regexp types in your G+ feed,
I took a 5-minute look at this code last night and noticed the same
oddity. At which point I gave up looking at it for the evening, thinking
to come back to it later. And here my procrastination is rewarded. :)

-Peff
--
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


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]