public inbox for git@vger.kernel.org 
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox•com>
To: Linus Torvalds <torvalds@linux-foundation•org>
Cc: Michael J Gruber <git@drmicha•warpmail.net>,
	Tim Friske <me@tifr•de>, git <git@vger•kernel.org>
Subject: Re: Why does "git log -G<regex>" works with "regexp-ignore-case" but not with other regexp-related options?
Date: Mon, 20 Apr 2015 11:44:20 -0700	[thread overview]
Message-ID: <xmqqtwwaljwb.fsf@gitster.dls.corp.google.com> (raw)
In-Reply-To: <CA+55aFzdSgvYo11PHamkOVASz61RUq26+s0na0Zh2RRwsEkrMg@mail.gmail.com> (Linus Torvalds's message of "Mon, 20 Apr 2015 11:33:31 -0700")

Linus Torvalds <torvalds@linux-foundation•org> 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.

  reply	other threads:[~2015-04-20 18:44 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-17 10:00 Why does "git log -G<regex>" works with "regexp-ignore-case" but not with other regexp-related options? Tim Friske
2015-04-17 14:26 ` Michael J Gruber
2015-04-17 16:18   ` Junio C Hamano
2015-04-17 17:09   ` Junio C Hamano
2015-04-17 17:45   ` Junio C Hamano
2015-04-20  8:49     ` Michael J Gruber
2015-04-20 17:41       ` Junio C Hamano
2015-04-20 18:33         ` Linus Torvalds
2015-04-20 18:44           ` Junio C Hamano [this message]
2015-04-21  8:41             ` Michael J Gruber
2015-04-21 16:59               ` Junio C Hamano
2015-04-22  9:08                 ` Michael J Gruber

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqqtwwaljwb.fsf@gitster.dls.corp.google.com \
    --to=gitster@pobox$(echo .)com \
    --cc=git@drmicha$(echo .)warpmail.net \
    --cc=git@vger$(echo .)kernel.org \
    --cc=me@tifr$(echo .)de \
    --cc=torvalds@linux-foundation$(echo .)org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox