Skip to content

Fix inconsistent regexp usage #235

Open
@dscho

Description

@dscho

If you supply --perl-regexp to git log it only applies to --grep. The documentation says "Consider the limiting patterns to be Perl-compatible regular expressions". Which might lead you to think that e.g. -G uses it too. It doesn't, only grep.c does PCRE, but -G is handled by diffcore-pickaxe.c.

Looking at git grep -l regexec -- '*.c' this whole thing is a mess. Ideally you should be able to say you want to use PCRE for everything, except maybe things that end up in your .gitconfig or e.g. the diff driver. But we could really use a more generic regexp interface.

In general Git's regexp use is a huge mess, e.g. there's --regexp-ignore-case but no way to supply various other regexp options like REG_NEWLINE or PCRE options consistently.

Copy-munged from: https://public-inbox.org/git/CACBZZX5wdnA-96e11edE7xRnAHo19RFTrZmqFQj-0ogLOJTncQ@mail.gmail.com/

Metadata

Metadata

Assignees

No one assigned

    Labels

    leftoverbitsFrom the Git mailing list: https://lore.kernel.org/git/?q=%23leftoverbits

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions