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

Re: [PATCH V2 4/5] git-grep: Learn PCRE

From
Junio C Hamano <gitster@pobox.com>
Date
May 5, 2011, 16:55 UTC
Message-ID
<7vei4d9jf1.fsf@alter.siamese.dyndns.org>
In-Reply-To
<BANLkTik6pcz696xJyoOju8a3ToResLF+3w@mail.gmail.com>
Bert Wesarg <bert.wesarg@googlemail.com> writes:
Show 5 quoted lines
> I would also suggest to share the space between regex_t and the
> (pcre*,pcre_extra*) tuple, like i did in my patch titled 'prepare for
> re-using the space...' from May 2. Sacrificing one bit to indicate
> that this is a pcre compiled pattern should not hurt, because there
> are bits left.
It might be an excessive over-engineering, though.

Unlike "struct object" that need to stay in-core and grow proportionally to the size of the history being traversed, grep_pat corresponds to one item from the pattern specified on the command line. If it makes the code harder to read because we end up constantly dereferencing union members (and no, "#define pcre_regexp u.pcre_regexp" is not a solution), the resulting 8-to-16 bytes saved per pattern may not be worth it.

Previous: Bert WesargNext: Johannes Sixt
Message 8 of 16 in “Add PCRE support to git-grep”
  1. 0/5 Add PCRE support to git-grepMichał Kiedrowicz, May 4, 2011
  2. 1/5 Documentation: Add --line-number to git-grep synopsisMichał Kiedrowicz, May 4, 2011
  3. 2/5 contrib/completion: --line-number to git grepMichał Kiedrowicz, May 4, 2011
  4. 3/5 grep: Put calls to fixmatch() and regmatch() into patmatch()Michał Kiedrowicz, May 4, 2011
  5. 4/5 git-grep: Learn PCREMichał Kiedrowicz, May 4, 2011
  6. Junio C HamanoMay 5, 2011
  7. Bert WesargMay 5, 2011
  8. Junio C HamanoMay 5, 2011
  9. Johannes SixtMay 5, 2011
  10. Michal KiedrowiczMay 5, 2011
  11. Johannes SixtMay 5, 2011
  12. Michal KiedrowiczMay 5, 2011
  13. Johannes SixtMay 5, 2011
  14. Michal KiedrowiczMay 5, 2011
  15. Alex RiesenMay 5, 2011
  16. 5/5 configure: Check for libpcreMichał Kiedrowicz, May 4, 2011

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.