Skip to content

Commit 3caf8f8

Browse files
committed
Merge branch 'ja/doc-git-log-markup' into jch
* ja/doc-git-log-markup: doc: git-log: convert log config to new doc format doc: git-log: convert diff options to new doc format doc: git-log: convert pretty formats to new doc format doc: git-log: convert pretty options to new doc format doc: git-log: convert rev list options to new doc format doc: git-log: convert line range format to new doc format doc: git-log: convert line range options to new doc format doc: git-log convert rev-list-description to new doc format doc: convert git-log to new documentation format
2 parents bfa8312 + 3a804fd commit 3caf8f8

11 files changed

+490
-470
lines changed

Documentation/asciidoc.conf.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ ifdef::doctype-book[]
4343
endif::doctype-book[]
4444

4545
[literal-inlinemacro]
46-
{eval:re.sub(r'(&lt;[-a-zA-Z0-9.]+&gt;)', r'<emphasis>\1</emphasis>', re.sub(r'([\[\s|()>]|^|\]|&gt;)(\.?([-a-zA-Z0-9:+=~@\\\*\/_^\$]+\.?)+|,)',r'\1<literal>\2</literal>', re.sub(r'(\.\.\.?)([^\]$.])', r'<literal>\1</literal>\2', macros.passthroughs[int(attrs['passtext'][1:-1])] if attrs['passtext'][1:-1].isnumeric() else attrs['passtext'][1:-1])))}
46+
{eval:re.sub(r'(&lt;[-a-zA-Z0-9.]+&gt;)', r'<emphasis>\1</emphasis>', re.sub(r'([\[\s|()>]|^|\]|&gt;)(\.?([-a-zA-Z0-9:+=~@\\\*\/_^\$%]+\.?)+|,)',r'\1<literal>\2</literal>', re.sub(r'(\.\.\.?)([^\]$.])', r'<literal>\1</literal>\2', macros.passthroughs[int(attrs['passtext'][1:-1])] if attrs['passtext'][1:-1].isnumeric() else attrs['passtext'][1:-1])))}
4747

4848
endif::backend-docbook[]
4949

Documentation/asciidoctor-extensions.rb.in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ module Git
7373
elsif type == :monospaced
7474
node.text.gsub(/(\.\.\.?)([^\]$\.])/, '<literal>\1</literal>\2')
7575
.gsub(/^\.\.\.?$/, '<literal>\0</literal>')
76-
.gsub(%r{([\[\s|()>.]|^|\]|&gt;)(\.?([-a-zA-Z0-9:+=~@/_^\$\\\*]+\.{0,2})+|,)}, '\1<literal>\2</literal>')
76+
.gsub(%r{([\[\s|()>.]|^|\]|&gt;)(\.?([-a-zA-Z0-9:+=~@/_^\$\\\*%]+\.{0,2})+|,)}, '\1<literal>\2</literal>')
7777
.gsub(/(&lt;[-a-zA-Z0-9.]+&gt;)/, '<emphasis>\1</emphasis>')
7878
else
7979
open, close, supports_phrase = QUOTE_TAGS[type]
@@ -102,7 +102,7 @@ module Git
102102
if node.type == :monospaced
103103
node.text.gsub(/(\.\.\.?)([^\]$.])/, '<code>\1</code>\2')
104104
.gsub(/^\.\.\.?$/, '<code>\0</code>')
105-
.gsub(%r{([\[\s|()>.]|^|\]|&gt;)(\.?([-a-zA-Z0-9:+=~@,/_^\$\\\*]+\.{0,2})+)}, '\1<code>\2</code>')
105+
.gsub(%r{([\[\s|()>.]|^|\]|&gt;)(\.?([-a-zA-Z0-9:+=~@,/_^\$\\\*%]+\.{0,2})+)}, '\1<code>\2</code>')
106106
.gsub(/(&lt;[-a-zA-Z0-9.]+&gt;)/, '<em>\1</em>')
107107

108108
else

Documentation/config/log.adoc

Lines changed: 25 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
log.abbrevCommit::
1+
`log.abbrevCommit`::
22
If true, makes
33
ifndef::with-breaking-changes[]
44
linkgit:git-log[1], linkgit:git-show[1], and
@@ -10,62 +10,67 @@ endif::with-breaking-changes[]
1010
assume `--abbrev-commit`. You may
1111
override this option with `--no-abbrev-commit`.
1212

13-
log.date::
14-
Set the default date-time mode for the 'log' command.
15-
Setting a value for log.date is similar to using 'git log''s
13+
`log.date`::
14+
Set the default date-time mode for the `log` command.
15+
Setting a value for log.date is similar to using `git log`'s
1616
`--date` option. See linkgit:git-log[1] for details.
1717
+
1818
If the format is set to "auto:foo" and the pager is in use, format
1919
"foo" will be used for the date format. Otherwise, "default" will
2020
be used.
2121
22-
log.decorate::
22+
`log.decorate`::
2323
Print out the ref names of any commits that are shown by the log
24-
command. If 'short' is specified, the ref name prefixes 'refs/heads/',
25-
'refs/tags/' and 'refs/remotes/' will not be printed. If 'full' is
26-
specified, the full ref name (including prefix) will be printed.
27-
If 'auto' is specified, then if the output is going to a terminal,
28-
the ref names are shown as if 'short' were given, otherwise no ref
29-
names are shown. This is the same as the `--decorate` option
30-
of the `git log`.
24+
command. Possible values are:
25+
+
26+
----
27+
`short`;; the ref name prefixes `refs/heads/`, `refs/tags/` and
28+
`refs/remotes/` are not printed.
29+
`full`;; the full ref name (including prefix) are printed.
30+
`auto`;; if the output is going to a terminal,
31+
the ref names are shown as if `short` were given, otherwise no ref
32+
names are shown.
33+
----
34+
+
35+
This is the same as the `--decorate` option of the `git log`.
3136
32-
log.initialDecorationSet::
37+
`log.initialDecorationSet`::
3338
By default, `git log` only shows decorations for certain known ref
3439
namespaces. If 'all' is specified, then show all refs as
3540
decorations.
3641

37-
log.excludeDecoration::
42+
`log.excludeDecoration`::
3843
Exclude the specified patterns from the log decorations. This is
3944
similar to the `--decorate-refs-exclude` command-line option, but
4045
the config option can be overridden by the `--decorate-refs`
4146
option.
4247

43-
log.diffMerges::
48+
`log.diffMerges`::
4449
Set diff format to be used when `--diff-merges=on` is
4550
specified, see `--diff-merges` in linkgit:git-log[1] for
4651
details. Defaults to `separate`.
4752

48-
log.follow::
53+
`log.follow`::
4954
If `true`, `git log` will act as if the `--follow` option was used when
5055
a single <path> is given. This has the same limitations as `--follow`,
5156
i.e. it cannot be used to follow multiple files and does not work well
5257
on non-linear history.
5358

54-
log.graphColors::
59+
`log.graphColors`::
5560
A list of colors, separated by commas, that can be used to draw
5661
history lines in `git log --graph`.
5762

58-
log.showRoot::
63+
`log.showRoot`::
5964
If true, the initial commit will be shown as a big creation event.
6065
This is equivalent to a diff against an empty tree.
6166
Tools like linkgit:git-log[1] or linkgit:git-whatchanged[1], which
6267
normally hide the root commit will now show it. True by default.
6368

64-
log.showSignature::
69+
`log.showSignature`::
6570
If true, makes linkgit:git-log[1], linkgit:git-show[1], and
6671
linkgit:git-whatchanged[1] assume `--show-signature`.
6772

68-
log.mailmap::
73+
`log.mailmap`::
6974
If true, makes linkgit:git-log[1], linkgit:git-show[1], and
7075
linkgit:git-whatchanged[1] assume `--use-mailmap`, otherwise
7176
assume `--no-use-mailmap`. True by default.

Documentation/diff-options.adoc

Lines changed: 23 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -37,81 +37,87 @@ endif::git-diff[]
3737
endif::git-format-patch[]
3838

3939
ifdef::git-log[]
40-
-m::
40+
`-m`::
4141
Show diffs for merge commits in the default format. This is
4242
similar to `--diff-merges=on`, except `-m` will
4343
produce no output unless `-p` is given as well.
4444

45-
-c::
45+
`-c`::
4646
Produce combined diff output for merge commits.
4747
Shortcut for `--diff-merges=combined -p`.
4848

49-
--cc::
49+
`--cc`::
5050
Produce dense combined diff output for merge commits.
5151
Shortcut for `--diff-merges=dense-combined -p`.
5252

53-
--dd::
53+
`--dd`::
5454
Produce diff with respect to first parent for both merge and
5555
regular commits.
5656
Shortcut for `--diff-merges=first-parent -p`.
5757

58-
--remerge-diff::
58+
`--remerge-diff`::
5959
Produce remerge-diff output for merge commits.
6060
Shortcut for `--diff-merges=remerge -p`.
6161

62-
--no-diff-merges::
62+
`--no-diff-merges`::
6363
Synonym for `--diff-merges=off`.
6464

65-
--diff-merges=<format>::
65+
`--diff-merges=<format>`::
6666
Specify diff format to be used for merge commits. Default is
6767
{diff-merges-default} unless `--first-parent` is in use, in
6868
which case `first-parent` is the default.
6969
+
7070
The following formats are supported:
7171
+
7272
--
73-
off, none::
73+
`off`::
74+
`none`::
7475
Disable output of diffs for merge commits. Useful to override
7576
implied value.
7677

77-
on, m::
78+
`on`::
79+
`m`::
7880
Make diff output for merge commits to be shown in the default
7981
format. The default format can be changed using
8082
`log.diffMerges` configuration variable, whose default value
8183
is `separate`.
8284

83-
first-parent, 1::
85+
`first-parent`::
86+
`1`::
8487
Show full diff with respect to first parent. This is the same
8588
format as `--patch` produces for non-merge commits.
8689

87-
separate::
90+
`separate`::
8891
Show full diff with respect to each of parents.
8992
Separate log entry and diff is generated for each parent.
9093

91-
combined, c::
94+
`combined`::
95+
`c`::
9296
Show differences from each of the parents to the merge
9397
result simultaneously instead of showing pairwise diff between
9498
a parent and the result one at a time. Furthermore, it lists
9599
only files which were modified from all parents.
96100

97-
dense-combined, cc::
101+
`dense-combined`::
102+
`cc`::
98103
Further compress output produced by `--diff-merges=combined`
99104
by omitting uninteresting hunks whose contents in the parents
100105
have only two variants and the merge result picks one of them
101106
without modification.
102107

103-
remerge, r::
104-
Remerge two-parent merge commits to create a temporary tree
108+
`remerge`::
109+
`r`:: Remerge two-parent merge commits to create a temporary tree
105110
object--potentially containing files with conflict markers
106111
and such. A diff is then shown between that temporary tree
107112
and the actual merge commit.
113+
--
108114
+
109115
The output emitted when this option is used is subject to change, and
110116
so is its interaction with other options (unless explicitly
111117
documented).
112-
--
113118

114-
--combined-all-paths::
119+
120+
`--combined-all-paths`::
115121
Cause combined diffs (used for merge commits) to
116122
list the name of the file from all parents. It thus only has
117123
effect when `--diff-merges=[dense-]combined` is in use, and

Documentation/git-log.adoc

Lines changed: 44 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ git-log - Show commit logs
88

99
SYNOPSIS
1010
--------
11-
[verse]
12-
'git log' [<options>] [<revision-range>] [[--] <path>...]
11+
[synopsis]
12+
git log [<options>] [<revision-range>] [[--] <path>...]
1313

1414
DESCRIPTION
1515
-----------
@@ -27,27 +27,32 @@ each commit introduces are shown.
2727
OPTIONS
2828
-------
2929

30-
--follow::
30+
`--follow`::
3131
Continue listing the history of a file beyond renames
3232
(works only for a single file).
3333

34-
--no-decorate::
35-
--decorate[=short|full|auto|no]::
36-
Print out the ref names of any commits that are shown. If 'short' is
37-
specified, the ref name prefixes 'refs/heads/', 'refs/tags/' and
38-
'refs/remotes/' will not be printed. If 'full' is specified, the
39-
full ref name (including prefix) will be printed. If 'auto' is
40-
specified, then if the output is going to a terminal, the ref names
41-
are shown as if 'short' were given, otherwise no ref names are
42-
shown. The option `--decorate` is short-hand for `--decorate=short`.
43-
Default to configuration value of `log.decorate` if configured,
44-
otherwise, `auto`.
45-
46-
--decorate-refs=<pattern>::
47-
--decorate-refs-exclude=<pattern>::
34+
`--no-decorate`::
35+
`--decorate[=(short|full|auto|no)]`::
36+
Print out the ref names of any commits that are shown. Possible values
37+
are:
38+
+
39+
----
40+
`short`;; the ref name prefixes `refs/heads/`, `refs/tags/` and
41+
`refs/remotes/` are not printed.
42+
`full`;; the full ref name (including prefix) is printed.
43+
`auto`:: if the output is going to a terminal, the ref names
44+
are shown as if `short` were given, otherwise no ref names are
45+
shown.
46+
----
47+
+
48+
The option `--decorate` is short-hand for `--decorate=short`. Default to
49+
configuration value of `log.decorate` if configured, otherwise, `auto`.
50+
51+
`--decorate-refs=<pattern>`::
52+
`--decorate-refs-exclude=<pattern>`::
4853
For each candidate reference, do not use it for decoration if it
49-
matches any patterns given to `--decorate-refs-exclude` or if it
50-
doesn't match any of the patterns given to `--decorate-refs`. The
54+
matches any of _<pattern>_ given to `--decorate-refs-exclude` or if it
55+
doesn't match any of _<pattern>_ given to `--decorate-refs`. The
5156
`log.excludeDecoration` config option allows excluding refs from
5257
the decorations, but an explicit `--decorate-refs` pattern will
5358
override a match in `log.excludeDecoration`.
@@ -56,51 +61,51 @@ If none of these options or config settings are given, then references are
5661
used as decoration if they match `HEAD`, `refs/heads/`, `refs/remotes/`,
5762
`refs/stash/`, or `refs/tags/`.
5863

59-
--clear-decorations::
64+
`--clear-decorations`::
6065
When specified, this option clears all previous `--decorate-refs`
6166
or `--decorate-refs-exclude` options and relaxes the default
6267
decoration filter to include all references. This option is
6368
assumed if the config value `log.initialDecorationSet` is set to
6469
`all`.
6570

66-
--source::
71+
`--source`::
6772
Print out the ref name given on the command line by which each
6873
commit was reached.
6974

70-
--[no-]mailmap::
71-
--[no-]use-mailmap::
75+
`--[no-]mailmap`::
76+
`--[no-]use-mailmap`::
7277
Use mailmap file to map author and committer names and email
7378
addresses to canonical real names and email addresses. See
7479
linkgit:git-shortlog[1].
7580

76-
--full-diff::
81+
`--full-diff`::
7782
Without this flag, `git log -p <path>...` shows commits that
7883
touch the specified paths, and diffs about the same specified
7984
paths. With this, the full diff is shown for commits that touch
80-
the specified paths; this means that "<path>..." limits only
85+
the specified paths; this means that "`<path>...`" limits only
8186
commits, and doesn't limit diff for those commits.
8287
+
8388
Note that this affects all diff-based output types, e.g. those
8489
produced by `--stat`, etc.
8590

86-
--log-size::
87-
Include a line ``log size <number>'' in the output for each commit,
88-
where <number> is the length of that commit's message in bytes.
91+
`--log-size`::
92+
Include a line `log size <number>` in the output for each commit,
93+
where _<number>_ is the length of that commit's message in bytes.
8994
Intended to speed up tools that read log messages from `git log`
9095
output by allowing them to allocate space in advance.
9196

9297
include::line-range-options.adoc[]
9398

94-
<revision-range>::
99+
_<revision-range>_::
95100
Show only commits in the specified revision range. When no
96-
<revision-range> is specified, it defaults to `HEAD` (i.e. the
101+
_<revision-range>_ is specified, it defaults to `HEAD` (i.e. the
97102
whole history leading to the current commit). `origin..HEAD`
98103
specifies all the commits reachable from the current commit
99104
(i.e. `HEAD`), but not from `origin`. For a complete list of
100-
ways to spell <revision-range>, see the 'Specifying Ranges'
105+
ways to spell _<revision-range>_, see the 'Specifying Ranges'
101106
section of linkgit:gitrevisions[7].
102107

103-
[--] <path>...::
108+
`[--] <path>...`::
104109
Show only commits that are enough to explain how the files
105110
that match the specified paths came to be. See 'History
106111
Simplification' below for details and other simplification
@@ -145,14 +150,14 @@ EXAMPLES
145150

146151
`git log --since="2 weeks ago" -- gitk`::
147152

148-
Show the changes during the last two weeks to the file 'gitk'.
153+
Show the changes during the last two weeks to the file `gitk`.
149154
The `--` is necessary to avoid confusion with the *branch* named
150-
'gitk'
155+
`gitk`
151156

152157
`git log --name-status release..test`::
153158

154-
Show the commits that are in the "test" branch but not yet
155-
in the "release" branch, along with the list of paths
159+
Show the commits that are in the "`test`" branch but not yet
160+
in the "`release`" branch, along with the list of paths
156161
each commit modifies.
157162

158163
`git log --follow builtin/rev-list.c`::
@@ -164,7 +169,7 @@ EXAMPLES
164169
`git log --branches --not --remotes=origin`::
165170

166171
Shows all commits that are in any of local branches but not in
167-
any of remote-tracking branches for 'origin' (what you have that
172+
any of remote-tracking branches for `origin` (what you have that
168173
origin doesn't).
169174

170175
`git log master --not --remotes=*/master`::
@@ -200,11 +205,11 @@ CONFIGURATION
200205
See linkgit:git-config[1] for core variables and linkgit:git-diff[1]
201206
for settings related to diff generation.
202207

203-
format.pretty::
208+
`format.pretty`::
204209
Default for the `--format` option. (See 'Pretty Formats' above.)
205210
Defaults to `medium`.
206211

207-
i18n.logOutputEncoding::
212+
`i18n.logOutputEncoding`::
208213
Encoding to use when displaying logs. (See 'Discussion' above.)
209214
Defaults to the value of `i18n.commitEncoding` if set, and UTF-8
210215
otherwise.

0 commit comments

Comments
 (0)