Re: [PATCH 4/6] log --grep: accept --basic-regexp and --perl-regexp

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

 



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

> When we added the "--perl-regexp" option (or "-P") to "git grep", we
> should have done the same for the commands in the "git log" family,
> but somehow we forgot to do so.  This corrects it.
> 
> Also introduce the "--basic-regexp" option for completeness, so that
> the "last one wins" principle can be used to defeat an earlier -E
> option, e.g. "git log -E --basic-regexp --grep='<bre>'".  Note that
> it cannot have the short "-G" option as the option is to grep in the
> patch text in the context of "log" family.

Good, I think the addition of --basic-regexp is a nice touch.

> +	} else if (!strcmp(arg, "--perl-regexp") || !strcmp(arg, "-P")) {
> +		grep_set_pattern_type_option(GREP_PATTERN_TYPE_PCRE, &revs->grep_filter);

Do we want to yield short-and-sweet "-P" to perl-regexp? git-grep does
so to match GNU grep, but we are not matching anything here (except
ourselves in git-grep). I'd think most people who use it regularly would
just set grep.patternType.

I could go either way, though.

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