summaryrefslogtreecommitdiff
path: root/Documentation/git-grep.txt
diff options
context:
space:
mode:
authorTaylor Blau <me@ttaylorr.com>2018-06-22 15:49:45 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-06-22 19:59:02 (GMT)
commita449f27ffa08de1b01ab5e4fe7daac38f25c9515 (patch)
tree66995a16e9a10eac1b8ddbca019a8c2228846352 /Documentation/git-grep.txt
parent89252cd069d4acf1c6c407f00c7a1cc2c6ad3953 (diff)
downloadgit-a449f27ffa08de1b01ab5e4fe7daac38f25c9515.zip
git-a449f27ffa08de1b01ab5e4fe7daac38f25c9515.tar.gz
git-a449f27ffa08de1b01ab5e4fe7daac38f25c9515.tar.bz2
builtin/grep.c: add '--column' option to 'git-grep(1)'
Teach 'git-grep(1)' a new option, '--column', to show the column number of the first match on a non-context line. This makes it possible to teach 'contrib/git-jump/git-jump' how to seek to the first matching position of a grep match in your editor, and allows similar additional scripting capabilities. For example: $ git grep -n --column foo | head -n3 .clang-format:51:14:# myFunction(foo, bar, baz); .clang-format:64:7:# int foo(); .clang-format:75:8:# void foo() Signed-off-by: Taylor Blau <me@ttaylorr.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'Documentation/git-grep.txt')
-rw-r--r--Documentation/git-grep.txt6
1 files changed, 5 insertions, 1 deletions
diff --git a/Documentation/git-grep.txt b/Documentation/git-grep.txt
index 312409a..31dc039 100644
--- a/Documentation/git-grep.txt
+++ b/Documentation/git-grep.txt
@@ -13,7 +13,7 @@ SYNOPSIS
[-v | --invert-match] [-h|-H] [--full-name]
[-E | --extended-regexp] [-G | --basic-regexp]
[-P | --perl-regexp]
- [-F | --fixed-strings] [-n | --line-number]
+ [-F | --fixed-strings] [-n | --line-number] [--column]
[-l | --files-with-matches] [-L | --files-without-match]
[(-O | --open-files-in-pager) [<pager>]]
[-z | --null]
@@ -169,6 +169,10 @@ providing this option will cause it to die.
--line-number::
Prefix the line number to matching lines.
+--column::
+ Prefix the 1-indexed byte-offset of the first match from the start of the
+ matching line.
+
-l::
--files-with-matches::
--name-only::