Joe Ratterman  committed 7d6cb10

grep: Add the option '--line-number'

This is a synonym for the existing '-n' option, matching GNU grep.

Signed-off-by: Joe Ratterman <>
Signed-off-by: Junio C Hamano <>

  • Participants
  • Parent commits 78bc466

Comments (0)

Files changed (2)

File Documentation/git-grep.txt

 	as a regex).
 	Prefix the line number to matching lines.

File builtin/grep.c

 		OPT_BOOLEAN('F', "fixed-strings", &opt.fixed,
 			"interpret patterns as fixed strings"),
-		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,