git.99rst.org
/
git.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
| inline |
side by side
(parent:
78bc466
)
grep: Add the option '--line-number'
author
Joe Ratterman
<redacted>
Mon, 28 Mar 2011 18:11:55 +0000
(13:11 -0500)
committer
Junio C Hamano
<redacted>
Mon, 28 Mar 2011 21:02:12 +0000
(14:02 -0700)
This is a synonym for the existing '-n' option, matching GNU grep.
Signed-off-by: Joe Ratterman <redacted>
Signed-off-by: Junio C Hamano <redacted>
Documentation/git-grep.txt
patch
|
blob
|
history
builtin/grep.c
patch
|
blob
|
history
diff --git
a/Documentation/git-grep.txt
b/Documentation/git-grep.txt
index dab0a78fa890d0c0cd193d89b7f4ac9ed19fb001..791d4d4871b6a285878f8c43b3b0a76c7f63f57c 100644
(file)
--- a/
Documentation/git-grep.txt
+++ b/
Documentation/git-grep.txt
@@
-93,6
+93,7
@@
OPTIONS
as a regex).
-n::
+--line-number::
Prefix the line number to matching lines.
-l::
diff --git
a/builtin/grep.c
b/builtin/grep.c
index 34f9ae03044f8f4c1bf36c41791020fe5b125b2c..bb0f93208fc6c3e418f9db5bcaec4b79c57e2bec 100644
(file)
--- a/
builtin/grep.c
+++ b/
builtin/grep.c
@@
-864,7
+864,7
@@
int cmd_grep(int argc, const char **argv, const char *prefix)
OPT_BOOLEAN('F', "fixed-strings", &opt.fixed,
"interpret patterns as fixed strings"),
OPT_GROUP(""),
- OPT_BOOLEAN('n',
NULL
, &opt.linenum, "show line numbers"),
+ OPT_BOOLEAN('n',
"line-number"
, &opt.linenum, "show line numbers"),
OPT_NEGBIT('h', NULL, &opt.pathname, "don't show filenames", 1),
OPT_BIT('H', NULL, &opt.pathname, "show filenames", 1),
OPT_NEGBIT(0, "full-name", &opt.relative,
git clone https://git.99rst.org/PROJECT