Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Fix inconsistent regexp usage #235

Open
dscho opened this issue May 29, 2019 · 0 comments
Open

Fix inconsistent regexp usage #235

dscho opened this issue May 29, 2019 · 0 comments
Labels
leftoverbits From the Git mailing list: https://lore.kernel.org/git/?q=%23leftoverbits

Comments

@dscho
Copy link
Member

dscho commented May 29, 2019

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/

@dscho dscho added the leftoverbits From the Git mailing list: https://lore.kernel.org/git/?q=%23leftoverbits label May 29, 2019
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
leftoverbits From the Git mailing list: https://lore.kernel.org/git/?q=%23leftoverbits
Projects
None yet
Development

No branches or pull requests

1 participant