Skip to content

Commit e40e01a

Browse files
Michael Lyonsgitster
authored andcommitted
doc: git-blame: convert to new doc format
- Use _<placeholder>_ instead of <placeholder> in the description - Use _underscores_ around math associated with <placeholders> - Use `backticks` for keywords and more complex option descriptions. The new rendering engine will apply synopsis rules to these spans. Signed-off-by: Michael Lyons <git@michael.lyo.nz> Acked-by: Jean-Noël AVILA <jn.avila@free.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent 2bfc69e commit e40e01a

1 file changed

Lines changed: 37 additions & 35 deletions

File tree

Documentation/git-blame.adoc

Lines changed: 37 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ git-blame - Show what revision and author last modified each line of a file
77

88
SYNOPSIS
99
--------
10-
[verse]
11-
'git blame' [-c] [-b] [-l] [--root] [-t] [-f] [-n] [-s] [-e] [-p] [-w] [--incremental]
12-
[-L <range>] [-S <revs-file>] [-M] [-C] [-C] [-C] [--since=<date>]
13-
[--ignore-rev <rev>] [--ignore-revs-file <file>]
14-
[--color-lines] [--color-by-age] [--progress] [--abbrev=<n>]
15-
[ --contents <file> ] [<rev> | --reverse <rev>..<rev>] [--] <file>
10+
[synopsis]
11+
git blame [-c] [-b] [-l] [--root] [-t] [-f] [-n] [-s] [-e] [-p] [-w] [--incremental]
12+
[-L <range>] [-S <revs-file>] [-M] [-C] [-C] [-C] [--since=<date>]
13+
[--ignore-rev <rev>] [--ignore-revs-file <file>]
14+
[--color-lines] [--color-by-age] [--progress] [--abbrev=<n>]
15+
[ --contents <file> ] [<rev> | --reverse <rev>..<rev>] [--] <file>
1616

1717
DESCRIPTION
1818
-----------
@@ -30,7 +30,7 @@ lines that were copied and pasted from another file, etc., see the
3030
`-C` and `-M` options.
3131

3232
The report does not tell you anything about lines which have been deleted or
33-
replaced; you need to use a tool such as 'git diff' or the "pickaxe"
33+
replaced; you need to use a tool such as `git diff` or the "pickaxe"
3434
interface briefly mentioned in the following paragraph.
3535

3636
Apart from supporting file annotation, Git also supports searching the
@@ -50,47 +50,47 @@ OPTIONS
5050
-------
5151
include::blame-options.adoc[]
5252

53-
-c::
53+
`-c`::
5454
Use the same output mode as linkgit:git-annotate[1] (Default: off).
5555

56-
--score-debug::
56+
`--score-debug`::
5757
Include debugging information related to the movement of
5858
lines between files (see `-C`) and lines moved within a
5959
file (see `-M`). The first number listed is the score.
6060
This is the number of alphanumeric characters detected
6161
as having been moved between or within files. This must be above
62-
a certain threshold for 'git blame' to consider those lines
62+
a certain threshold for `git blame` to consider those lines
6363
of code to have been moved.
6464

65-
-f::
66-
--show-name::
65+
`-f`::
66+
`--show-name`::
6767
Show the filename in the original commit. By default
6868
the filename is shown if there is any line that came from a
6969
file with a different name, due to rename detection.
7070

71-
-n::
72-
--show-number::
71+
`-n`::
72+
`--show-number`::
7373
Show the line number in the original commit (Default: off).
7474

75-
-s::
75+
`-s`::
7676
Suppress the author name and timestamp from the output.
7777

78-
-e::
79-
--show-email::
78+
`-e`::
79+
`--show-email`::
8080
Show the author email instead of the author name (Default: off).
8181
This can also be controlled via the `blame.showEmail` config
8282
option.
8383

84-
-w::
84+
`-w`::
8585
Ignore whitespace when comparing the parent's version and
8686
the child's to find where the lines came from.
8787

8888
include::diff-algorithm-option.adoc[]
8989

90-
--abbrev=<n>::
91-
Instead of using the default 7+1 hexadecimal digits as the
92-
abbreviated object name, use <m>+1 digits, where <m> is at
93-
least <n> but ensures the commit object names are unique.
90+
`--abbrev=<n>`::
91+
Instead of using the default _7+1_ hexadecimal digits as the
92+
abbreviated object name, use _<m>+1_ digits, where _<m>_ is at
93+
least _<n>_ but ensures the commit object names are unique.
9494
Note that 1 column
9595
is used for a caret to mark the boundary commit.
9696

@@ -124,21 +124,21 @@ header at the minimum has the first line which has:
124124
This header line is followed by the following information
125125
at least once for each commit:
126126

127-
- the author name ("author"), email ("author-mail"), time
128-
("author-time"), and time zone ("author-tz"); similarly
127+
- the author name (`author`), email (`author-mail`), time
128+
(`author-time`), and time zone (`author-tz`); similarly
129129
for committer.
130130
- the filename in the commit that the line is attributed to.
131-
- the first line of the commit log message ("summary").
131+
- the first line of the commit log message (`summary`).
132132
133133
The contents of the actual line are output after the above
134-
header, prefixed by a TAB. This is to allow adding more
134+
header, prefixed by a _TAB_. This is to allow adding more
135135
header elements later.
136136

137137
The porcelain format generally suppresses commit information that has
138138
already been seen. For example, two lines that are blamed to the same
139139
commit will both be shown, but the details for that commit will be shown
140140
only once. Information which is specific to individual lines will not be
141-
grouped together, like revs to be marked 'ignored' or 'unblamable'. This
141+
grouped together, like revs to be marked `ignored` or `unblamable`. This
142142
is more efficient, but may require more state be kept by the reader. The
143143
`--line-porcelain` option can be used to output full commit information
144144
for each line, allowing simpler (but less efficient) usage like:
@@ -152,7 +152,7 @@ for each line, allowing simpler (but less efficient) usage like:
152152
SPECIFYING RANGES
153153
-----------------
154154
155-
Unlike 'git blame' and 'git annotate' in older versions of git, the extent
155+
Unlike `git blame` and `git annotate` in older versions of git, the extent
156156
of the annotation can be limited to both line ranges and revision
157157
ranges. The `-L` option, which limits annotation to a range of lines, may be
158158
specified multiple times.
@@ -173,7 +173,7 @@ which limits the annotation to the body of the `hello` subroutine.
173173
174174
When you are not interested in changes older than version
175175
v2.6.18, or changes older than 3 weeks, you can use revision
176-
range specifiers similar to 'git rev-list':
176+
range specifiers similar to `git rev-list`:
177177
178178
git blame v2.6.18.. -- foo
179179
git blame --since=3.weeks -- foo
@@ -212,8 +212,9 @@ does not contain the actual lines from the file that is being
212212
annotated.
213213

214214
. Each blame entry always starts with a line of:
215-
216-
<40-byte-hex-sha1> <sourceline> <resultline> <num-lines>
215+
+
216+
[synopsis]
217+
<40-byte-hex-sha1> <sourceline> <resultline> <num-lines>
217218
+
218219
Line numbers count from 1.
219220

@@ -224,16 +225,17 @@ Line numbers count from 1.
224225

225226
. Unlike the Porcelain format, the filename information is always
226227
given and terminates the entry:
227-
228-
"filename" <whitespace-quoted-filename-goes-here>
228+
+
229+
[synopsis]
230+
filename <whitespace-quoted-filename-goes-here>
229231
+
230232
and thus it is really quite easy to parse for some line- and word-oriented
231233
parser (which should be quite natural for most scripting languages).
232234
+
233235
[NOTE]
234236
For people who do parsing: to make it more robust, just ignore any
235-
lines between the first and last one ("<sha1>" and "filename" lines)
236-
where you do not recognize the tag words (or care about that particular
237+
lines between the first and last one (_<40-byte-hex-sha1>_ and `filename`
238+
lines) where you do not recognize the tag words (or care about that particular
237239
one) at the beginning of the "extended information" lines. That way, if
238240
there is ever added information (like the commit encoding or extended
239241
commit commentary), a blame viewer will not care.

0 commit comments

Comments
 (0)