diff options
author | Junio C Hamano <gitster@pobox.com> | 2018-07-18 12:20:31 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2018-07-18 12:20:31 -0700 |
commit | d036d667b7f297f8305ffaaec212a95da7022ebe (patch) | |
tree | 40518ad23cc91e47c395bcfc760671a77e072c2c /Documentation | |
parent | Merge branch 'vs/typofixes' (diff) | |
parent | contrib/git-jump/git-jump: jump to exact location (diff) | |
download | tgif-d036d667b7f297f8305ffaaec212a95da7022ebe.tar.xz |
Merge branch 'tb/grep-column'
"git grep" learned the "--column" option that gives not just the
line number but the column number of the hit.
* tb/grep-column:
contrib/git-jump/git-jump: jump to exact location
grep.c: add configuration variables to show matched option
builtin/grep.c: add '--column' option to 'git-grep(1)'
grep.c: display column number of first match
grep.[ch]: extend grep_opt to allow showing matched column
grep.c: expose {,inverted} match column in match_line()
Documentation/config.txt: camel-case lineNumber for consistency
Diffstat (limited to 'Documentation')
-rw-r--r-- | Documentation/config.txt | 7 | ||||
-rw-r--r-- | Documentation/git-grep.txt | 9 |
2 files changed, 14 insertions, 2 deletions
diff --git a/Documentation/config.txt b/Documentation/config.txt index 536291cb6c..8f7527b213 100644 --- a/Documentation/config.txt +++ b/Documentation/config.txt @@ -1182,8 +1182,10 @@ color.grep.<slot>:: filename prefix (when not using `-h`) `function`;; function name lines (when using `-p`) -`linenumber`;; +`lineNumber`;; line number prefix (when using `-n`) +`column`;; + column number prefix (when using `--column`) `match`;; matching text (same as setting `matchContext` and `matchSelected`) `matchContext`;; @@ -1798,6 +1800,9 @@ gitweb.snapshot:: grep.lineNumber:: If set to true, enable `-n` option by default. +grep.column:: + If set to true, enable the `--column` option by default. + grep.patternType:: Set the default matching behavior. Using a value of 'basic', 'extended', 'fixed', or 'perl' will enable the `--basic-regexp`, `--extended-regexp`, diff --git a/Documentation/git-grep.txt b/Documentation/git-grep.txt index 312409a607..0de3493b80 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] @@ -44,6 +44,9 @@ CONFIGURATION grep.lineNumber:: If set to true, enable `-n` option by default. +grep.column:: + If set to true, enable the `--column` option by default. + grep.patternType:: Set the default matching behavior. Using a value of 'basic', 'extended', 'fixed', or 'perl' will enable the `--basic-regexp`, `--extended-regexp`, @@ -169,6 +172,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:: |