Skip to content

Commit 3f202b5

Browse files
committed
Merge branch 'ml/doc-blame-markup'
Doc mark-up update. * ml/doc-blame-markup: doc: git-blame: convert to new doc format doc: blame-options: convert to new doc format
2 parents ffae4da + e40e01a commit 3f202b5

2 files changed

Lines changed: 97 additions & 95 deletions

File tree

Documentation/blame-options.adoc

Lines changed: 60 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -1,105 +1,105 @@
1-
-b::
1+
`-b`::
22
Show blank SHA-1 for boundary commits. This can also
33
be controlled via the `blame.blankBoundary` config option.
44

5-
--root::
5+
`--root`::
66
Do not treat root commits as boundaries. This can also be
77
controlled via the `blame.showRoot` config option.
88

9-
--show-stats::
9+
`--show-stats`::
1010
Include additional statistics at the end of blame output.
1111

12-
-L <start>,<end>::
13-
-L :<funcname>::
14-
Annotate only the line range given by '<start>,<end>',
15-
or by the function name regex '<funcname>'.
12+
`-L <start>,<end>`::
13+
`-L :<funcname>`::
14+
Annotate only the line range given by `<start>,<end>`,
15+
or by the function name regex _<funcname>_.
1616
May be specified multiple times. Overlapping ranges are allowed.
1717
+
18-
'<start>' and '<end>' are optional. `-L <start>` or `-L <start>,` spans from
19-
'<start>' to end of file. `-L ,<end>` spans from start of file to '<end>'.
18+
_<start>_ and _<end>_ are optional. `-L <start>` or `-L <start>,` spans from
19+
_<start>_ to end of file. `-L ,<end>` spans from start of file to _<end>_.
2020
+
2121
include::line-range-format.adoc[]
2222

23-
-l::
23+
`-l`::
2424
Show long rev (Default: off).
2525

26-
-t::
26+
`-t`::
2727
Show raw timestamp (Default: off).
2828

29-
-S <revs-file>::
30-
Use revisions from revs-file instead of calling linkgit:git-rev-list[1].
29+
`-S <revs-file>`::
30+
Use revisions from _<revs-file>_ instead of calling
31+
linkgit:git-rev-list[1].
3132

32-
--reverse <rev>..<rev>::
33+
`--reverse <start>..<end>`::
3334
Walk history forward instead of backward. Instead of showing
3435
the revision in which a line appeared, this shows the last
3536
revision in which a line has existed. This requires a range of
36-
revision like START..END where the path to blame exists in
37-
START. `git blame --reverse START` is taken as `git blame
38-
--reverse START..HEAD` for convenience.
37+
revision like `<start>..<end>` where the path to blame exists in
38+
_<start>_. `git blame --reverse <start>` is taken as `git blame
39+
--reverse <start>..HEAD` for convenience.
3940

40-
--first-parent::
41+
`--first-parent`::
4142
Follow only the first parent commit upon seeing a merge
4243
commit. This option can be used to determine when a line
4344
was introduced to a particular integration branch, rather
4445
than when it was introduced to the history overall.
4546

46-
-p::
47-
--porcelain::
47+
`-p`::
48+
`--porcelain`::
4849
Show in a format designed for machine consumption.
4950

50-
--line-porcelain::
51+
`--line-porcelain`::
5152
Show the porcelain format, but output commit information for
5253
each line, not just the first time a commit is referenced.
53-
Implies --porcelain.
54+
Implies `--porcelain`.
5455

55-
--incremental::
56+
`--incremental`::
5657
Show the result incrementally in a format designed for
5758
machine consumption.
5859

59-
--encoding=<encoding>::
60-
Specifies the encoding used to output author names
60+
`--encoding=<encoding>`::
61+
Specify the encoding used to output author names
6162
and commit summaries. Setting it to `none` makes blame
6263
output unconverted data. For more information see the
6364
discussion about encoding in the linkgit:git-log[1]
6465
manual page.
6566

66-
--contents <file>::
67-
Annotate using the contents from the named file, starting from <rev>
68-
if it is specified, and HEAD otherwise. You may specify '-' to make
67+
`--contents <file>`::
68+
Annotate using the contents from _<file>_, starting from _<rev>_
69+
if it is specified, and `HEAD` otherwise. You may specify `-` to make
6970
the command read from the standard input for the file contents.
7071

71-
--date <format>::
72-
Specifies the format used to output dates. If --date is not
73-
provided, the value of the blame.date config variable is
74-
used. If the blame.date config variable is also not set, the
72+
`--date <format>`::
73+
Specify the format used to output dates. If `--date` is not
74+
provided, the value of the `blame.date` config variable is
75+
used. If the `blame.date` config variable is also not set, the
7576
iso format is used. For supported values, see the discussion
76-
of the --date option at linkgit:git-log[1].
77+
of the `--date` option at linkgit:git-log[1].
7778

78-
--progress::
79-
--no-progress::
80-
Progress status is reported on the standard error stream
81-
by default when it is attached to a terminal. This flag
82-
enables progress reporting even if not attached to a
83-
terminal. Can't use `--progress` together with `--porcelain`
84-
or `--incremental`.
79+
`--progress`::
80+
`--no-progress`::
81+
Enable progress reporting on the standard error stream even if
82+
not attached to a terminal. By default, progress status is
83+
reported only when it is attached. You can't use `--progress`
84+
together with `--porcelain` or `--incremental`.
8585

86-
-M[<num>]::
86+
`-M[<num>]`::
8787
Detect moved or copied lines within a file. When a commit
8888
moves or copies a block of lines (e.g. the original file
89-
has A and then B, and the commit changes it to B and then
90-
A), the traditional 'blame' algorithm notices only half of
89+
has _A_ and then _B_, and the commit changes it to _B_ and then
90+
_A_), the traditional `blame` algorithm notices only half of
9191
the movement and typically blames the lines that were moved
92-
up (i.e. B) to the parent and assigns blame to the lines that
93-
were moved down (i.e. A) to the child commit. With this
92+
up (i.e. _B_) to the parent and assigns blame to the lines that
93+
were moved down (i.e. _A_) to the child commit. With this
9494
option, both groups of lines are blamed on the parent by
9595
running extra passes of inspection.
9696
+
97-
<num> is optional but it is the lower bound on the number of
97+
_<num>_ is optional, but it is the lower bound on the number of
9898
alphanumeric characters that Git must detect as moving/copying
9999
within a file for it to associate those lines with the parent
100100
commit. The default value is 20.
101101

102-
-C[<num>]::
102+
`-C[<num>]`::
103103
In addition to `-M`, detect lines moved or copied from other
104104
files that were modified in the same commit. This is
105105
useful when you reorganize your program and move code
@@ -109,14 +109,14 @@ commit. The default value is 20.
109109
option is given three times, the command additionally
110110
looks for copies from other files in any commit.
111111
+
112-
<num> is optional but it is the lower bound on the number of
112+
_<num>_ is optional, but it is the lower bound on the number of
113113
alphanumeric characters that Git must detect as moving/copying
114114
between files for it to associate those lines with the parent
115115
commit. And the default value is 40. If there are more than one
116-
`-C` options given, the <num> argument of the last `-C` will
116+
`-C` options given, the _<num>_ argument of the last `-C` will
117117
take effect.
118118

119-
--ignore-rev <rev>::
119+
`--ignore-rev <rev>`::
120120
Ignore changes made by the revision when assigning blame, as if the
121121
change never happened. Lines that were changed or added by an ignored
122122
commit will be blamed on the previous commit that changed that line or
@@ -126,26 +126,26 @@ take effect.
126126
another commit will be marked with a `?` in the blame output. If the
127127
`blame.markUnblamableLines` config option is set, then those lines touched
128128
by an ignored commit that we could not attribute to another revision are
129-
marked with a '*'. In the porcelain modes, we print 'ignored' and
130-
'unblamable' on a newline respectively.
129+
marked with a `*`. In the porcelain modes, we print `ignored` and
130+
`unblamable` on a newline respectively.
131131

132-
--ignore-revs-file <file>::
133-
Ignore revisions listed in `file`, which must be in the same format as an
132+
`--ignore-revs-file <file>`::
133+
Ignore revisions listed in _<file>_, which must be in the same format as an
134134
`fsck.skipList`. This option may be repeated, and these files will be
135135
processed after any files specified with the `blame.ignoreRevsFile` config
136136
option. An empty file name, `""`, will clear the list of revs from
137137
previously processed files.
138138

139-
--color-lines::
139+
`--color-lines`::
140140
Color line annotations in the default format differently if they come from
141141
the same commit as the preceding line. This makes it easier to distinguish
142142
code blocks introduced by different commits. The color defaults to cyan and
143143
can be adjusted using the `color.blame.repeatedLines` config option.
144144

145-
--color-by-age::
146-
Color line annotations depending on the age of the line in the default format.
147-
The `color.blame.highlightRecent` config option controls what color is used for
148-
each range of age.
145+
`--color-by-age`::
146+
Color line annotations depending on the age of the line in
147+
the default format. The `color.blame.highlightRecent` config
148+
option controls what color is used for each range of age.
149149

150-
-h::
150+
`-h`::
151151
Show help message.

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)