git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Junio C Hamano <gitster@pobox.com>
Date
Apr 20, 2015, 18:44 UTC
Message-ID
<xmqqtwwaljwb.fsf@gitster.dls.corp.google.com>
In-Reply-To
<CA+55aFzdSgvYo11PHamkOVASz61RUq26+s0na0Zh2RRwsEkrMg@mail.gmail.com>
Linus Torvalds <torvalds@linux-foundation.org> writes:
Show 10 quoted lines
> 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.

Previous: Linus TorvaldsNext: Michael J Gruber
Message 9 of 12 in “Why does "git log -G<regex>" works with "regexp-ignore-case" but not with other regexp-related options?”
  1. Tim FriskeApr 17, 2015
  2. Michael J GruberApr 17, 2015
  3. Junio C HamanoApr 17, 2015
  4. Junio C HamanoApr 17, 2015
  5. Junio C HamanoApr 17, 2015
  6. Michael J GruberApr 20, 2015
  7. Junio C HamanoApr 20, 2015
  8. Linus TorvaldsApr 20, 2015
  9. Junio C HamanoApr 20, 2015
  10. Michael J GruberApr 21, 2015
  11. Junio C HamanoApr 21, 2015
  12. Michael J GruberApr 22, 2015

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.