git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [PATCH v3 00/18] PCRE v1 improvements & PCRE v2 support
@ 2017-04-20 21:23 Ævar Arnfjörð Bjarmason
  2017-04-20 21:23 ` [PATCH v3 01/18] grep: amend submodule recursion test in preparation for rx engine testing Ævar Arnfjörð Bjarmason
                   ` (17 more replies)
  0 siblings, 18 replies; 22+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2017-04-20 21:23 UTC (permalink / raw)
  To: git
  Cc: Junio C Hamano, Jeff King, Jeffrey Walton, Michał Kiedrowicz,
	J Smith, Victor Leschuk, Nguyễn Thái Ngọc Duy,
	Fredrik Kuivinen, Zoltán Herczeg, Brandon Williams,
	Ævar Arnfjörð Bjarmason

Sorry about the high volume sending. I thought I wouldn't have time to
work on v3 for a while, but here it is a day later. I promise to hold
off on further sending for a bit.

This, unlike v2, addresses all the outstanding comments the series
had. Most importantly I added a patch at the end to remove the
concurrent support for v1 & v2 of the library as Jeff & Junio
suggested.

See the v2 coverletter in <20170419224053.8920-1-avarab@gmail.com> for
changes since v1, changes since v2 noted below:

Ævar Arnfjörð Bjarmason (18):
  grep: amend submodule recursion test in preparation for rx engine
    testing
  grep: add tests for grep pattern types being passed to submodules
  grep: submodule-related case statements should die if new fields are
    added

I thought there was a bug in v2 still where submodule grepping
wouldn't properly pass along e.g. `-c grep.patternType=pcre2`, this
turned out to not be the case since we pass -c options to subprocesses
via the GIT_CONFIG_PARAMETERS env var, which I didn't know about.

But in preparing to fix that I wrote these tests which improve on some
blind spots in the tests Brandon initially added for the submodule
grep. It's part of this series because it would conflict with
subsequent patches if sent stand-alone, but is otherwise unrelated.

  grep: remove redundant regflags assignment under PCRE
  Makefile & configure: reword outdated comment about PCRE

No changes.

  grep: add a test for backreferences in PCRE patterns

s/PCRE/LIBPCRE/ for the prereq check. That's changed later, but this
patch didn't work properly stand-alone, error introduced in earlier
v1-era rebasing.

  log: add exhaustive tests for pattern style options & config
  log: add -P as a synonym for --perl-regexp

No changes.

  grep & rev-list doc: stop promising libpcre for --perl-regexp

I've reworded these docs to make even weaker promises about what's a
"Perl-compatible regular expression". As noted in the commit message
the motivation is that maybe in the future we'd like to provide -P via
some entirely different library, e.g. Intel's hyperscan. This leaves
that door open without breaking existing promises in the
documentation.

  grep: make grep.patternType=[pcre|pcre1] a synonym for "perl"

Now with tests for recursive submodule grepping.

  test-lib: rename the LIBPCRE prerequisite to PCRE

Now with s/LIBPCRE/PCRE/ back for the s/PCRE/LIBPCRE/ change noted earlier.

  grep: change the internal PCRE macro names to be PCRE1
  grep: change the internal PCRE code & header names to be PCRE1
  perf: add a performance comparison test of grep -E and -P
  grep: add support for the PCRE v1 JIT API

No changes.

  grep: add support for PCRE v2

Fix one s/LIBPCREDIR/LIBPCRE2DIR/ in a ./configure notice which I
missed & tests & minor changes for recursive submodule grepping.

  grep: remove support concurrent use of both PCRE v1 & v2

NEW: Removes grep.patternType=[pcre|pcre1|pcre2] & makes trying to
compile git with both v1 & v2 an error, but either one will work, with
v1 being the default still.

After writing this up & seeing what the change is I also agree that
it's a good idea to apply this. It makes the user-facing docs simpler,
but also the various tests which previously had to worry about
[pcre|pcre1|pcre2] which now just test "perl".

  Makefile & configure: make PCRE v2 the default PCRE implementation

NEW: This changes the default PCRE implementation to v2, and makes
USE_LIBPCRE mean USE_LIBPCRE2, but USE_LIBPCRE1 is still available.

I originally wrote this as something to keep for some future
submission, but come to think of it I can't see why it shouldn't be
applied.

The v2 PCRE is stable & end-user compatible, all this change does is
change the default, someone building a new git is likely to also have
packaged PCRE v2 sometime in the last 2 years since it was released,
and if not they can choose to use the legacy v2 library by making the
trivial s/USE_LIBPCRE/USE_LIBPCRE1/ change, or package up PCRE v2.

 Documentation/git-grep.txt         |   7 +-
 Documentation/rev-list-options.txt |   9 +-
 Makefile                           |  39 +++++--
 builtin/grep.c                     |   4 +
 configure.ac                       |  81 +++++++++++---
 grep.c                             | 214 ++++++++++++++++++++++++++++++------
 grep.h                             |  32 +++++-
 revision.c                         |   2 +-
 t/README                           |   4 +-
 t/perf/p7820-grep-engines.sh       |  25 +++++
 t/t4202-log.sh                     |  86 ++++++++++++++-
 t/t7810-grep.sh                    |  41 ++++---
 t/t7812-grep-icase-non-ascii.sh    |   4 +-
 t/t7813-grep-icase-iso.sh          |  11 +-
 t/t7814-grep-recurse-submodules.sh | 215 +++++++++++++++++++++++--------------
 t/test-lib.sh                      |   3 +-
 16 files changed, 608 insertions(+), 169 deletions(-)
 create mode 100755 t/perf/p7820-grep-engines.sh

-- 
2.11.0


^ permalink raw reply	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2017-04-20 22:27 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-20 21:23 [PATCH v3 00/18] PCRE v1 improvements & PCRE v2 support Ævar Arnfjörð Bjarmason
2017-04-20 21:23 ` [PATCH v3 01/18] grep: amend submodule recursion test in preparation for rx engine testing Ævar Arnfjörð Bjarmason
2017-04-20 22:22   ` Brandon Williams
2017-04-20 21:23 ` [PATCH v3 02/18] grep: add tests for grep pattern types being passed to submodules Ævar Arnfjörð Bjarmason
2017-04-20 21:23 ` [PATCH v3 03/18] grep: submodule-related case statements should die if new fields are added Ævar Arnfjörð Bjarmason
2017-04-20 22:20   ` Brandon Williams
2017-04-20 22:27     ` Jeff King
2017-04-20 21:23 ` [PATCH v3 04/18] grep: remove redundant regflags assignment under PCRE Ævar Arnfjörð Bjarmason
2017-04-20 21:23 ` [PATCH v3 05/18] Makefile & configure: reword outdated comment about PCRE Ævar Arnfjörð Bjarmason
2017-04-20 21:23 ` [PATCH v3 06/18] grep: add a test for backreferences in PCRE patterns Ævar Arnfjörð Bjarmason
2017-04-20 21:23 ` [PATCH v3 07/18] log: add exhaustive tests for pattern style options & config Ævar Arnfjörð Bjarmason
2017-04-20 21:23 ` [PATCH v3 08/18] log: add -P as a synonym for --perl-regexp Ævar Arnfjörð Bjarmason
2017-04-20 21:23 ` [PATCH v3 09/18] grep & rev-list doc: stop promising libpcre " Ævar Arnfjörð Bjarmason
2017-04-20 21:23 ` [PATCH v3 10/18] grep: make grep.patternType=[pcre|pcre1] a synonym for "perl" Ævar Arnfjörð Bjarmason
2017-04-20 21:23 ` [PATCH v3 11/18] test-lib: rename the LIBPCRE prerequisite to PCRE Ævar Arnfjörð Bjarmason
2017-04-20 21:23 ` [PATCH v3 12/18] grep: change the internal PCRE macro names to be PCRE1 Ævar Arnfjörð Bjarmason
2017-04-20 21:23 ` [PATCH v3 13/18] grep: change the internal PCRE code & header " Ævar Arnfjörð Bjarmason
2017-04-20 21:23 ` [PATCH v3 14/18] perf: add a performance comparison test of grep -E and -P Ævar Arnfjörð Bjarmason
2017-04-20 21:23 ` [PATCH v3 15/18] grep: add support for the PCRE v1 JIT API Ævar Arnfjörð Bjarmason
2017-04-20 21:23 ` [PATCH v3 16/18] grep: add support for PCRE v2 Ævar Arnfjörð Bjarmason
2017-04-20 21:23 ` [PATCH v3 17/18] grep: remove support concurrent use of both PCRE v1 & v2 Ævar Arnfjörð Bjarmason
2017-04-20 21:23 ` [PATCH v3 18/18] Makefile & configure: make PCRE v2 the default PCRE implementation Ævar Arnfjörð Bjarmason

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).