Skip to content

doc: convert git log man page to new synopsis format #1933

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
2 changes: 1 addition & 1 deletion Documentation/asciidoc.conf.in
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ ifdef::doctype-book[]
endif::doctype-book[]

[literal-inlinemacro]
{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])))}
{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])))}

endif::backend-docbook[]

Expand Down
4 changes: 2 additions & 2 deletions Documentation/asciidoctor-extensions.rb.in
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ module Git
elsif type == :monospaced
node.text.gsub(/(\.\.\.?)([^\]$\.])/, '<literal>\1</literal>\2')
.gsub(/^\.\.\.?$/, '<literal>\0</literal>')
.gsub(%r{([\[\s|()>.]|^|\]|&gt;)(\.?([-a-zA-Z0-9:+=~@/_^\$\\\*]+\.{0,2})+|,)}, '\1<literal>\2</literal>')
.gsub(%r{([\[\s|()>.]|^|\]|&gt;)(\.?([-a-zA-Z0-9:+=~@/_^\$\\\*%]+\.{0,2})+|,)}, '\1<literal>\2</literal>')
.gsub(/(&lt;[-a-zA-Z0-9.]+&gt;)/, '<emphasis>\1</emphasis>')
else
open, close, supports_phrase = QUOTE_TAGS[type]
Expand Down Expand Up @@ -102,7 +102,7 @@ module Git
if node.type == :monospaced
node.text.gsub(/(\.\.\.?)([^\]$.])/, '<code>\1</code>\2')
.gsub(/^\.\.\.?$/, '<code>\0</code>')
.gsub(%r{([\[\s|()>.]|^|\]|&gt;)(\.?([-a-zA-Z0-9:+=~@,/_^\$\\\*]+\.{0,2})+)}, '\1<code>\2</code>')
.gsub(%r{([\[\s|()>.]|^|\]|&gt;)(\.?([-a-zA-Z0-9:+=~@,/_^\$\\\*%]+\.{0,2})+)}, '\1<code>\2</code>')
.gsub(/(&lt;[-a-zA-Z0-9.]+&gt;)/, '<em>\1</em>')

else
Expand Down
45 changes: 25 additions & 20 deletions Documentation/config/log.adoc
Original file line number Diff line number Diff line change
@@ -1,64 +1,69 @@
log.abbrevCommit::
`log.abbrevCommit`::
If true, makes linkgit:git-log[1], linkgit:git-show[1], and
linkgit:git-whatchanged[1] assume `--abbrev-commit`. You may
override this option with `--no-abbrev-commit`.

log.date::
Set the default date-time mode for the 'log' command.
Setting a value for log.date is similar to using 'git log''s
`log.date`::
Set the default date-time mode for the `log` command.
Setting a value for log.date is similar to using `git log`'s
`--date` option. See linkgit:git-log[1] for details.
+
If the format is set to "auto:foo" and the pager is in use, format
"foo" will be used for the date format. Otherwise, "default" will
be used.
log.decorate::
`log.decorate`::
Print out the ref names of any commits that are shown by the log
command. If 'short' is specified, the ref name prefixes 'refs/heads/',
'refs/tags/' and 'refs/remotes/' will not be printed. If 'full' is
specified, the full ref name (including prefix) will be printed.
If 'auto' is specified, then if the output is going to a terminal,
the ref names are shown as if 'short' were given, otherwise no ref
names are shown. This is the same as the `--decorate` option
of the `git log`.
command. Possible values are:
+
----
`short`;; the ref name prefixes `refs/heads/`, `refs/tags/` and
`refs/remotes/` are not printed.
`full`;; the full ref name (including prefix) are printed.
`auto`;; if the output is going to a terminal,
the ref names are shown as if `short` were given, otherwise no ref
names are shown.
----
+
This is the same as the `--decorate` option of the `git log`.
log.initialDecorationSet::
`log.initialDecorationSet`::
By default, `git log` only shows decorations for certain known ref
namespaces. If 'all' is specified, then show all refs as
decorations.

log.excludeDecoration::
`log.excludeDecoration`::
Exclude the specified patterns from the log decorations. This is
similar to the `--decorate-refs-exclude` command-line option, but
the config option can be overridden by the `--decorate-refs`
option.

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

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

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

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

log.showSignature::
`log.showSignature`::
If true, makes linkgit:git-log[1], linkgit:git-show[1], and
linkgit:git-whatchanged[1] assume `--show-signature`.

log.mailmap::
`log.mailmap`::
If true, makes linkgit:git-log[1], linkgit:git-show[1], and
linkgit:git-whatchanged[1] assume `--use-mailmap`, otherwise
assume `--no-use-mailmap`. True by default.
40 changes: 23 additions & 17 deletions Documentation/diff-options.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -37,81 +37,87 @@ endif::git-diff[]
endif::git-format-patch[]

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

-c::
`-c`::
Produce combined diff output for merge commits.
Shortcut for `--diff-merges=combined -p`.

--cc::
`--cc`::
Produce dense combined diff output for merge commits.
Shortcut for `--diff-merges=dense-combined -p`.

--dd::
`--dd`::
Produce diff with respect to first parent for both merge and
regular commits.
Shortcut for `--diff-merges=first-parent -p`.

--remerge-diff::
`--remerge-diff`::
Produce remerge-diff output for merge commits.
Shortcut for `--diff-merges=remerge -p`.

--no-diff-merges::
`--no-diff-merges`::
Synonym for `--diff-merges=off`.

--diff-merges=<format>::
`--diff-merges=<format>`::
Specify diff format to be used for merge commits. Default is
{diff-merges-default} unless `--first-parent` is in use, in
which case `first-parent` is the default.
+
The following formats are supported:
+
--
off, none::
`off`::
`none`::
Disable output of diffs for merge commits. Useful to override
implied value.

on, m::
`on`::
`m`::
Make diff output for merge commits to be shown in the default
format. The default format can be changed using
`log.diffMerges` configuration variable, whose default value
is `separate`.

first-parent, 1::
`first-parent`::
`1`::
Show full diff with respect to first parent. This is the same
format as `--patch` produces for non-merge commits.

separate::
`separate`::
Show full diff with respect to each of parents.
Separate log entry and diff is generated for each parent.

combined, c::
`combined`::
`c`::
Show differences from each of the parents to the merge
result simultaneously instead of showing pairwise diff between
a parent and the result one at a time. Furthermore, it lists
only files which were modified from all parents.

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

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

--combined-all-paths::

`--combined-all-paths`::
Cause combined diffs (used for merge commits) to
list the name of the file from all parents. It thus only has
effect when `--diff-merges=[dense-]combined` is in use, and
Expand Down
83 changes: 44 additions & 39 deletions Documentation/git-log.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ git-log - Show commit logs

SYNOPSIS
--------
[verse]
'git log' [<options>] [<revision-range>] [[--] <path>...]
[synopsis]
git log [<options>] [<revision-range>] [[--] <path>...]

DESCRIPTION
-----------
Expand All @@ -27,27 +27,32 @@ each commit introduces are shown.
OPTIONS
-------

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

--no-decorate::
--decorate[=short|full|auto|no]::
Print out the ref names of any commits that are shown. If 'short' is
specified, the ref name prefixes 'refs/heads/', 'refs/tags/' and
'refs/remotes/' will not be printed. If 'full' is specified, the
full ref name (including prefix) will be printed. If 'auto' is
specified, then if the output is going to a terminal, the ref names
are shown as if 'short' were given, otherwise no ref names are
shown. The option `--decorate` is short-hand for `--decorate=short`.
Default to configuration value of `log.decorate` if configured,
otherwise, `auto`.

--decorate-refs=<pattern>::
--decorate-refs-exclude=<pattern>::
`--no-decorate`::
`--decorate[=(short|full|auto|no)]`::
Print out the ref names of any commits that are shown. Possible values
are:
+
----
`short`;; the ref name prefixes `refs/heads/`, `refs/tags/` and
`refs/remotes/` are not printed.
`full`;; the full ref name (including prefix) is printed.
`auto`:: if the output is going to a terminal, the ref names
are shown as if `short` were given, otherwise no ref names are
shown.
----
+
The option `--decorate` is short-hand for `--decorate=short`. Default to
configuration value of `log.decorate` if configured, otherwise, `auto`.

`--decorate-refs=<pattern>`::
`--decorate-refs-exclude=<pattern>`::
For each candidate reference, do not use it for decoration if it
matches any patterns given to `--decorate-refs-exclude` or if it
doesn't match any of the patterns given to `--decorate-refs`. The
matches any of _<pattern>_ given to `--decorate-refs-exclude` or if it
doesn't match any of _<pattern>_ given to `--decorate-refs`. The
`log.excludeDecoration` config option allows excluding refs from
the decorations, but an explicit `--decorate-refs` pattern will
override a match in `log.excludeDecoration`.
Expand All @@ -56,51 +61,51 @@ If none of these options or config settings are given, then references are
used as decoration if they match `HEAD`, `refs/heads/`, `refs/remotes/`,
`refs/stash/`, or `refs/tags/`.

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

--source::
`--source`::
Print out the ref name given on the command line by which each
commit was reached.

--[no-]mailmap::
--[no-]use-mailmap::
`--[no-]mailmap`::
`--[no-]use-mailmap`::
Use mailmap file to map author and committer names and email
addresses to canonical real names and email addresses. See
linkgit:git-shortlog[1].

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

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

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

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

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

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

Show the changes during the last two weeks to the file 'gitk'.
Show the changes during the last two weeks to the file `gitk`.
The `--` is necessary to avoid confusion with the *branch* named
'gitk'
`gitk`

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

Show the commits that are in the "test" branch but not yet
in the "release" branch, along with the list of paths
Show the commits that are in the "`test`" branch but not yet
in the "`release`" branch, along with the list of paths
each commit modifies.

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

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

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

format.pretty::
`format.pretty`::
Default for the `--format` option. (See 'Pretty Formats' above.)
Defaults to `medium`.

i18n.logOutputEncoding::
`i18n.logOutputEncoding`::
Encoding to use when displaying logs. (See 'Discussion' above.)
Defaults to the value of `i18n.commitEncoding` if set, and UTF-8
otherwise.
Expand Down
Loading
Loading