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, 01:09 UTC
Message-ID
<7vk4e6c5rh.fsf@alter.siamese.dyndns.org>
In-Reply-To
<1304546421-25439-5-git-send-email-michal.kiedrowicz@gmail.com>
Michał Kiedrowicz <michal.kiedrowicz@gmail.com> writes:
Show 10 quoted lines
> diff --git a/Makefile b/Makefile
> index 3a1fe20..98841dc 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -24,6 +24,12 @@ all::
>  # Define NO_OPENSSL environment variable if you do not have OpenSSL.
>  # This also implies BLK_SHA1.
>  #
> +# Define NO_LIBPCRE if you do not have libpcre installed.  git-grep cannot use
> +# Perl-compatible regexes.
At least at first, I'd rather want to keep this an optional feature, i.e.
+# Define WITH_LIBPCRE if you have and want to use libpcre.
Show 6 quoted lines
> @@ -33,6 +39,8 @@ struct grep_pat {
>  	size_t patternlen;
>  	enum grep_header_field field;
>  	regex_t regexp;
> +	pcre *pcre_regexp;
> +	pcre_extra *extra;

I don't think pcre will forever stay the _only_ thing that wants to hook an extra information to this structure. That is why I included "pcre_" in the field name in my earlier "how about doing it this way" suggestion.

Previous: Michał KiedrowiczNext: Bert Wesarg
Message 6 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.