Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: git/git
base: 7e27bd589d328b9daf154c2444d1a86ec3afedb0
Choose a base ref
...
head repository: git/git
compare: ae39ba431ab861548eb60b4bd2e1d8b8813db76f
Choose a head ref
  • 4 commits
  • 6 files changed
  • 2 contributors

Commits on Sep 23, 2021

  1. Merge branch 'jk/grep-haystack-is-read-only' into hm/paint-hits-in-lo…

    …g-grep
    
    * jk/grep-haystack-is-read-only:
      grep: store grep_source buffer as const
      grep: mark "haystack" buffers as const
      grep: stop modifying buffer in grep_source_1()
      grep: stop modifying buffer in show_line()
      grep: stop modifying buffer in strip_timestamp
    gitster committed Sep 23, 2021
    Copy the full SHA
    28ecef4 View commit details
    Browse the repository at this point in the history

Commits on Sep 29, 2021

  1. grep: refactor next_match() and match_one_pattern() for external use

    These changes are made in preparation of, the colorization support for the
    "git log" subcommands that, rely on regex functionality (i.e. "--author",
    "--committer" and "--grep"). These changes are necessary primarily because
    match_one_pattern() expects header lines to be prefixed, however, in
    pretty, the prefixes are stripped from the lines because the name-email
    pairs need to go through additional parsing, before they can be printed and
    because next_match() doesn't handle the case of
    "ctx == GREP_CONTEXT_HEAD" at all. So, teach next_match() how to handle the
    new case and move match_one_pattern()'s core logic to
    headerless_match_one_pattern() while preserving match_one_pattern()'s uses
    that depend on the additional processing.
    
    Signed-off-by: Hamza Mahfooz <someguy@effective-light.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    effective-light authored and gitster committed Sep 29, 2021
    Copy the full SHA
    3f566c4 View commit details
    Browse the repository at this point in the history

Commits on Oct 8, 2021

  1. pretty: colorize pattern matches in commit messages

    The "git log" command limits its output to the commits that contain strings
    matched by a pattern when the "--grep=<pattern>" option is used, but unlike
    output from "git grep -e <pattern>", the matches are not highlighted,
    making them harder to spot.
    
    Teach the pretty-printer code to highlight matches from the
    "--grep=<pattern>", "--author=<pattern>" and "--committer=<pattern>"
    options (to view the last one, you may have to ask for --pretty=fuller).
    
    Also, it must be noted that we are effectively greping the content twice
    (because it would be a hassle to rework the existing matching code to do
    a /g match and then pass it all down to the coloring code), however it only
    slows down "git log --author=^H" on this repository by around 1-2%
    (compared to v2.33.0), so it should be a small enough slow down to justify
    the addition of the feature.
    
    Signed-off-by: Hamza Mahfooz <someguy@effective-light.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    effective-light authored and gitster committed Oct 8, 2021
    Copy the full SHA
    6a5c337 View commit details
    Browse the repository at this point in the history

Commits on Oct 15, 2021

  1. grep/pcre2: fix an edge case concerning ascii patterns and UTF-8 data

    If we attempt to grep non-ascii log message text with an ascii pattern, we
    run into the following issue:
    
        $ git log --color --author='.var.*Bjar' -1 origin/master | grep ^Author
        grep: (standard input): binary file matches
    
    So, to fix this teach the grep code to use PCRE2_UTF, as long as the log
    output is encoded in UTF-8.
    
    Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
    Signed-off-by: Hamza Mahfooz <someguy@effective-light.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    effective-light authored and gitster committed Oct 15, 2021
    Copy the full SHA
    ae39ba4 View commit details
    Browse the repository at this point in the history