Skip to content

Commit 026f2e3

Browse files
jnavilagitster
authored andcommitted
doc: convert git-log to new documentation format
- Switch the synopsis to a synopsis block which will automatically format placeholders in italics and keywords in monospace - Use _<placeholder>_ instead of <placeholder> in the description - Use `backticks` for keywords and more complex option descriptions. The new rendering engine will apply synopsis rules to these spans. We also transform inline descriptions of possible values of option --decorate into a list, which is more readable and extensible. Signed-off-by: Jean-Noël Avila <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 16bd9f2 commit 026f2e3

File tree

1 file changed

+46
-40
lines changed

1 file changed

+46
-40
lines changed

Documentation/git-log.adoc

Lines changed: 46 additions & 40 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,80 +27,86 @@ 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
51-
`log.excludeDecoration` config option allows excluding refs from
54+
matches any of the _<pattern>_ parameters given to
55+
`--decorate-refs-exclude` or if it doesn't match any of the
56+
_<pattern>_ parameters given to `--decorate-refs`.
57+
The `log.excludeDecoration` config option allows excluding refs from
5258
the decorations, but an explicit `--decorate-refs` pattern will
5359
override a match in `log.excludeDecoration`.
5460
+
5561
If none of these options or config settings are given, then references are
5662
used as decoration if they match `HEAD`, `refs/heads/`, `refs/remotes/`,
5763
`refs/stash/`, or `refs/tags/`.
5864

59-
--clear-decorations::
65+
`--clear-decorations`::
6066
When specified, this option clears all previous `--decorate-refs`
6167
or `--decorate-refs-exclude` options and relaxes the default
6268
decoration filter to include all references. This option is
6369
assumed if the config value `log.initialDecorationSet` is set to
6470
`all`.
6571

66-
--source::
72+
`--source`::
6773
Print out the ref name given on the command line by which each
6874
commit was reached.
6975

70-
--[no-]mailmap::
71-
--[no-]use-mailmap::
76+
`--[no-]mailmap`::
77+
`--[no-]use-mailmap`::
7278
Use mailmap file to map author and committer names and email
7379
addresses to canonical real names and email addresses. See
7480
linkgit:git-shortlog[1].
7581

76-
--full-diff::
82+
`--full-diff`::
7783
Without this flag, `git log -p <path>...` shows commits that
7884
touch the specified paths, and diffs about the same specified
7985
paths. With this, the full diff is shown for commits that touch
80-
the specified paths; this means that "<path>..." limits only
86+
the specified paths; this means that "`<path>...`" limits only
8187
commits, and doesn't limit diff for those commits.
8288
+
8389
Note that this affects all diff-based output types, e.g. those
8490
produced by `--stat`, etc.
8591

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.
92+
`--log-size`::
93+
Include a line `log size <number>` in the output for each commit,
94+
where _<number>_ is the length of that commit's message in bytes.
8995
Intended to speed up tools that read log messages from `git log`
9096
output by allowing them to allocate space in advance.
9197

9298
include::line-range-options.adoc[]
9399

94-
<revision-range>::
100+
_<revision-range>_::
95101
Show only commits in the specified revision range. When no
96-
<revision-range> is specified, it defaults to `HEAD` (i.e. the
102+
_<revision-range>_ is specified, it defaults to `HEAD` (i.e. the
97103
whole history leading to the current commit). `origin..HEAD`
98104
specifies all the commits reachable from the current commit
99105
(i.e. `HEAD`), but not from `origin`. For a complete list of
100-
ways to spell <revision-range>, see the 'Specifying Ranges'
106+
ways to spell _<revision-range>_, see the 'Specifying Ranges'
101107
section of linkgit:gitrevisions[7].
102108

103-
[--] <path>...::
109+
`[--] <path>...`::
104110
Show only commits that are enough to explain how the files
105111
that match the specified paths came to be. See 'History
106112
Simplification' below for details and other simplification
@@ -145,14 +151,14 @@ EXAMPLES
145151

146152
`git log --since="2 weeks ago" -- gitk`::
147153

148-
Show the changes during the last two weeks to the file 'gitk'.
154+
Show the changes during the last two weeks to the file `gitk`.
149155
The `--` is necessary to avoid confusion with the *branch* named
150-
'gitk'
156+
`gitk`
151157

152158
`git log --name-status release..test`::
153159

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

158164
`git log --follow builtin/rev-list.c`::
@@ -164,7 +170,7 @@ EXAMPLES
164170
`git log --branches --not --remotes=origin`::
165171

166172
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
173+
any of remote-tracking branches for `origin` (what you have that
168174
origin doesn't).
169175

170176
`git log master --not --remotes=*/master`::
@@ -200,11 +206,11 @@ CONFIGURATION
200206
See linkgit:git-config[1] for core variables and linkgit:git-diff[1]
201207
for settings related to diff generation.
202208

203-
format.pretty::
209+
`format.pretty`::
204210
Default for the `--format` option. (See 'Pretty Formats' above.)
205211
Defaults to `medium`.
206212

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

0 commit comments

Comments
 (0)