Re: Why does "git log -G<regex>" works with "regexp-ignore-case" but not with other regexp-related options?

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

 



Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx> writes:

> And to clarify: I don't suggest always building with libpcre. I
> literally suggest having something like
>
>      /* hacky mac-hack hack */
>     if (strncmp("(?i)", p->pattern, 4)) {
>         p->pattern += 4;
>         p->ignore_case = true;
>     }
>
> just in front of the "regcomp() call, and nothing more fancy than that.

Yeah, looking at the way grep.c:compile_regexp() is structured, we
are already prepared to allow

    $ git log --grep='(?i)torvalds' --grep='Linus'

that wants to find one piece of text case insensitively while
another case sensitively in the same text (i.e. the log message
part), so per-pattern customization may be a good way to do this.


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