doc: log, gitk: move '-L' description to 'line-range-options.txt'

The description of the '-L' option for `git log` and `gitk` is almost the same, but is repeated in both 'git-log.txt' and 'gitk.txt' (the difference being that 'git-log.txt' lists the option with a space after '-L', while 'gitk.txt' lists it as stuck and notes that `gitk` only understands the stuck form). Reduce duplication by creating a new file, 'line-range-options.txt', and include it in both files. To simplify the presentation, only list the stuck form for both commands, and remove the note about `gitk` only understanding the stuck form. Signed-off-by: Philippe Blain <levraiphilippeblain@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Philippe Blain committed Nov 1, 2020 at 17:28 UTC f9c8d8cbbea9cc55d26058a1de767731600ded44
3 files changed +17 -33
Documentation/git-log.txt
+1 -14
@@ -77,20 +77,7 @@ produced by `--stat`, etc.
77 Intended to speed up tools that read log messages from `git log`
78 output by allowing them to allocate space in advance.
79
80 --L <start>,<end>:<file>::
81 --L :<funcname>:<file>::
82 - Trace the evolution of the line range given by "<start>,<end>"
83 - (or the function name regex <funcname>) within the <file>. You may
84 - not give any pathspec limiters. This is currently limited to
85 - a walk starting from a single revision, i.e., you may only
86 - give zero or one positive revision arguments, and
87 - <start> and <end> (or <funcname>) must exist in the starting revision.
88 - You can specify this option more than once. Implies `--patch`.
89 - Patch output can be suppressed using `--no-patch`, but other diff formats
90 - (namely `--raw`, `--numstat`, `--shortstat`, `--dirstat`, `--summary`,
91 - `--name-only`, `--name-status`, `--check`) are not currently implemented.
92 -+
93 -include::line-range-format.txt[]
80 +include::line-range-options.txt[]
81
82 <revision range>::
83 Show only commits in the specified revision range. When no
Documentation/gitk.txt
+1 -19
@@ -98,25 +98,7 @@ linkgit:git-rev-list[1] for a complete list.
98 (See "History simplification" in linkgit:git-log[1] for a more
99 detailed explanation.)
100
101 --L<start>,<end>:<file>::
102 --L:<funcname>:<file>::
103 -
104 - Trace the evolution of the line range given by "<start>,<end>"
105 - (or the function name regex <funcname>) within the <file>. You may
106 - not give any pathspec limiters. This is currently limited to
107 - a walk starting from a single revision, i.e., you may only
108 - give zero or one positive revision arguments, and
109 - <start> and <end> (or <funcname>) must exist in the starting revision.
110 - You can specify this option more than once. Implies `--patch`.
111 - Patch output can be suppressed using `--no-patch`, but other diff formats
112 - (namely `--raw`, `--numstat`, `--shortstat`, `--dirstat`, `--summary`,
113 - `--name-only`, `--name-status`, `--check`) are not currently implemented.
114 -+
115 -*Note:* gitk (unlike linkgit:git-log[1]) currently only understands
116 -this option if you specify it "glued together" with its argument. Do
117 -*not* put a space after `-L`.
118 -+
119 -include::line-range-format.txt[]
101 +include::line-range-options.txt[]
102
103 <revision range>::
104
Documentation/line-range-options.txt new
+15
@@ -0,0 +1,15 @@
1 +-L<start>,<end>:<file>::
2 +-L:<funcname>:<file>::
3 +
4 + Trace the evolution of the line range given by "<start>,<end>"
5 + (or the function name regex <funcname>) within the <file>. You may
6 + not give any pathspec limiters. This is currently limited to
7 + a walk starting from a single revision, i.e., you may only
8 + give zero or one positive revision arguments, and
9 + <start> and <end> (or <funcname>) must exist in the starting revision.
10 + You can specify this option more than once. Implies `--patch`.
11 + Patch output can be suppressed using `--no-patch`, but other diff formats
12 + (namely `--raw`, `--numstat`, `--shortstat`, `--dirstat`, `--summary`,
13 + `--name-only`, `--name-status`, `--check`) are not currently implemented.
14 ++
15 +include::line-range-format.txt[]