Skip to content

builtin/grep.c: teach '-o', '--only-matching'

Taylor Blau git 2 versions – New

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest2 patches 0 repliesNew
  2. v12 patches 8 repliesSuperseded

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2grep.c: extract show_line_header()grep.c+25 -190 replies
2/2builtin/grep.c: teach '-o', '--only-matching' to 'git-grep'Documentation/git-grep.txt builtin/grep.c grep.c +2 more+107 -40 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [PATCH v2 0/2] builtin/grep.c: teach '-o', '--only-matching'

Hi,

Attached is the second re-roll of my series to add GNU grep's '--only-matching' to git-grep.

The main thing that has changed since last time is our handling of -{A,B,C}<N>. Previously, as Peff points out in [1], we handle this in a buggy way different than GNU.

I agree that although 'git grep -C<N> -o ...' is an unusual invocation, it is useful to (1) maintain as much consistency as reasonably makes sense, and (2) to at least not be buggy.

I have also responded to Eric's suggestions in [2], and [3].

Thanks as always for your kind review :-).

Thanks,
Taylor

[1]: https://public-inbox.org/git/[email protected]
[2]: https://public-inbox.org/git/CAPig+cSRJWW4-7vj6wK8aOfNB20bqUCSOOySjdPci1r5Vb83Uw@mail.gmail.com
[3]: https://public-inbox.org/git/CAPig+cRbBZ+QTqGiW_wQ9E-gROA-Wtevp1vcRqmJ5YQJ8tYEVQ@mail.gmail.com

Taylor Blau (2):
grep.c: extract show_line_header() builtin/grep.c: teach '-o', '--only-matching' to 'git-grep'

 Documentation/git-grep.txt |  6 ++-
 builtin/grep.c             |  1 +
 grep.c                     | 78 +++++++++++++++++++++++++++-----------
 grep.h                     |  1 +
 t/t7810-grep.sh            | 69 +++++++++++++++++++++++++++++++++
 5 files changed, 132 insertions(+), 23 deletions(-)

--
2.17.0