1. 21 5月, 2017 5 次提交
    • Æ
      log: make --regexp-ignore-case work with --perl-regexp · 9e3cbc59
      Ævar Arnfjörð Bjarmason 提交于
      Make the --regexp-ignore-case option work with --perl-regexp. This
      never worked, and there was no test for this. Fix the bug and add a
      test.
      
      When PCRE support was added in commit 63e7e9d8 ("git-grep: Learn
      PCRE", 2011-05-09) compile_pcre_regexp() would only check
      opt->ignore_case, but when the --perl-regexp option was added in
      commit 727b6fc3 ("log --grep: accept --basic-regexp and
      --perl-regexp", 2012-10-03) the code didn't set the opt->ignore_case.
      
      Change the test suite to test for -i and --invert-regexp with
      basic/extended/perl patterns in addition to fixed, which was the only
      patternType that was tested for before in combination with those
      options.
      Signed-off-by: NÆvar Arnfjörð Bjarmason <avarab@gmail.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      9e3cbc59
    • Æ
      log: add exhaustive tests for pattern style options & config · 9df46763
      Ævar Arnfjörð Bjarmason 提交于
      Add exhaustive tests for how the different grep.patternType options &
      the corresponding command-line options affect git-log.
      
      Before this change it was possible to patch revision.c so that the
      --basic-regexp option was synonymous with --extended-regexp, and
      --perl-regexp wasn't recognized at all, and still have 100% of the
      test suite pass.
      
      This was because the first test being modified here, added in commit
      34a4ae55 ("log --grep: use the same helper to set -E/-F options as
      "git grep"", 2012-10-03), didn't actually check whether we'd enabled
      extended regular expressions as distinct from re-toggling non-fixed
      string support.
      
      Fix that by changing the pattern to a pattern that'll only match if
      --extended-regexp option is provided, but won't match under the
      default --basic-regexp option.
      
      Other potential regressions were possible since there were no tests
      for the rest of the combinations of grep.patternType configuration
      toggles & corresponding git-log command-line options. Add exhaustive
      tests for those.
      
      The patterns being passed to fixed/basic/extended/PCRE are carefully
      crafted to return the wrong thing if the grep engine were to pick any
      other matching method than the one it's told to use.
      Signed-off-by: NÆvar Arnfjörð Bjarmason <avarab@gmail.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      9df46763
    • Æ
      test-lib: rename the LIBPCRE prerequisite to PCRE · 3eb585c1
      Ævar Arnfjörð Bjarmason 提交于
      Rename the LIBPCRE prerequisite to PCRE. This is for preparation for
      libpcre2 support, where having just "LIBPCRE" would be confusing as it
      implies v1 of the library.
      
      None of these tests are incompatible between versions 1 & 2 of
      libpcre, it's less confusing to give them a more general name to make
      it clear that they work on both library versions.
      Signed-off-by: NÆvar Arnfjörð Bjarmason <avarab@gmail.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      3eb585c1
    • Æ
      grep & rev-list doc: stop promising libpcre for --perl-regexp · d048cb13
      Ævar Arnfjörð Bjarmason 提交于
      Stop promising in our grep & rev-list options documentation that we're
      always going to be using libpcre when given the --perl-regexp option.
      
      Instead talk about using "Perl-compatible regular expressions" and
      using these types of patterns using "a compile-time dependency".
      
      Saying "libpcre" means that we're talking about libpcre.so, which is
      always going to be v1. This change is part of an ongoing saga to add
      support for libpcre2, which comes with PCRE v2.
      
      In the future we might use some completely unrelated library to
      provide perl-compatible regular expression support. By wording the
      documentation differently and not promising any specific version of
      PCRE or even PCRE at all we have more wiggle room to change the
      implementation.
      Signed-off-by: NÆvar Arnfjörð Bjarmason <avarab@gmail.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      d048cb13
    • Æ
      Makefile & configure: reword inaccurate comment about PCRE · 072473e6
      Ævar Arnfjörð Bjarmason 提交于
      Reword an outdated & inaccurate comment which suggests that only
      git-grep can use PCRE.
      
      This comment was added back when PCRE support was initially added in
      commit 63e7e9d8 ("git-grep: Learn PCRE", 2011-05-09), and was true
      at the time.
      
      It hasn't been telling the full truth since git-log learned to use
      PCRE with --grep in commit 727b6fc3 ("log --grep: accept
      --basic-regexp and --perl-regexp", 2012-10-03), and more importantly
      is likely to get more inaccurate over time as more use is made of PCRE
      in other areas.
      
      Reword it to be more future-proof, and to more clearly explain that
      this enables user-initiated runtime behavior.
      
      Copy/pasting this so much in configure.ac is lame, these Makefile-like
      flags aren't even used by autoconf, just the corresponding
      --with[out]-* options. But copy/pasting the comments that make sense
      for the Makefile to configure.ac where they make less sense is the
      pattern everything else follows in that file. I'm not going to war
      against that as part of this change, just following the existing
      pattern.
      Signed-off-by: NÆvar Arnfjörð Bjarmason <avarab@gmail.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      072473e6
  2. 09 5月, 2017 12 次提交
  3. 06 5月, 2017 3 次提交
  4. 05 5月, 2017 20 次提交