Skip to content

Commit 29860f3

Browse files
committed
Merge branch 'ja/doc-reset-mv-rm-markup-updates'
Doc mark-up updates. * ja/doc-reset-mv-rm-markup-updates: doc: add markup for characters in Guidelines doc: fix asciidoctor synopsis processing of triple-dots doc: convert git-mv to new documentation format doc: move synopsis git-mv commands in the synopsis section doc: convert git-rm to new documentation format doc: fix synopsis analysis logic doc: convert git-reset to new documentation format
2 parents bb74c0a + 5a5565e commit 29860f3

File tree

7 files changed

+109
-104
lines changed

7 files changed

+109
-104
lines changed

Documentation/CodingGuidelines

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -861,6 +861,9 @@ Markup:
861861
_<git-dir>_
862862
_<key-id>_
863863

864+
Characters are also surrounded by underscores:
865+
_LF_, _CR_, _CR_/_LF_, _NUL_, _EOF_
866+
864867
Git's Asciidoc processor has been tailored to treat backticked text
865868
as complex synopsis. When literal and placeholders are mixed, you can
866869
use the backtick notation which will take care of correctly typesetting

Documentation/asciidoc.conf.in

Lines changed: 4 additions & 4 deletions
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

@@ -75,18 +75,18 @@ git-relative-html-prefix=
7575
<a href="{git-relative-html-prefix}{target}.html">{target}{0?({0})}</a>
7676

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

8080
endif::backend-xhtml11[]
8181

8282
ifdef::backend-docbook[]
8383
ifdef::doctype-manpage[]
8484
[paradef-default]
85-
synopsis-style=template="verseparagraph",filter="sed 's!&#8230;\\(\\]\\|$\\)!<phrase>\\0</phrase>!g;s!\\([\\[ |()]\\|^\\|\\]\\|&gt;\\)\\([-=a-zA-Z0-9:+@,\\/_^\\$.]\\+\\|&#8230;\\)!\\1<literal>\\2</literal>!g;s!&lt;[-a-zA-Z0-9.]\\+&gt;!<emphasis>\\0</emphasis>!g'"
85+
synopsis-style=template="verseparagraph",filter="sed 's!&#8230;\\(\\]\\|$\\)!<phrase>\\0</phrase>!g;s!\\([\\[ |()]\\|^\\|\\]\\|&gt;\\)\\([-=a-zA-Z0-9:+@,\\/_^\\$.\\\\\\*]\\+\\|&#8230;\\)!\\1<literal>\\2</literal>!g;s!&lt;[-a-zA-Z0-9.]\\+&gt;!<emphasis>\\0</emphasis>!g'"
8686
endif::doctype-manpage[]
8787
endif::backend-docbook[]
8888

8989
ifdef::backend-xhtml11[]
9090
[paradef-default]
91-
synopsis-style=template="verseparagraph",filter="sed 's!&#8230;\\(\\]\\|$\\)!<span>\\0</span>!g;s!\\([\\[ |()]\\|^\\|\\]\\|&gt;\\)\\([-=a-zA-Z0-9:+@,\\/_^\\$.]\\+\\|&#8230;\\)!\\1<code>\\2</code>!g;s!&lt;[-a-zA-Z0-9.]\\+&gt;!<em>\\0</em>!g'"
91+
synopsis-style=template="verseparagraph",filter="sed 's!&#8230;\\(\\]\\|$\\)!<span>\\0</span>!g;s!\\([\\[ |()]\\|^\\|\\]\\|&gt;\\)\\([-=a-zA-Z0-9:+@,\\/_^\\$.\\\\\\*]\\+\\|&#8230;\\)!\\1<code>\\2</code>!g;s!&lt;[-a-zA-Z0-9.]\\+&gt;!<em>\\0</em>!g'"
9292
endif::backend-xhtml11[]

Documentation/asciidoctor-extensions.rb.in

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ module Git
4949

5050
def process parent, reader, attrs
5151
outlines = reader.lines.map do |l|
52-
l.gsub(/(\.\.\.?)([^\]$.])/, '`\1`\2')
53-
.gsub(%r{([\[\] |()>]|^)([-a-zA-Z0-9:+=~@,/_^\$]+)}, '\1{empty}`\2`{empty}')
52+
l.gsub(/(\.\.\.?)([^\]$\. ])/, '{empty}`\1`{empty}\2')
53+
.gsub(%r{([\[\] |()>]|^)([-a-zA-Z0-9:+=~@,/_^\$\\\*]+)}, '\1{empty}`\2`{empty}')
5454
.gsub(/(<[-a-zA-Z0-9.]+>)/, '__\\1__')
5555
.gsub(']', ']{empty}')
5656
end
@@ -71,8 +71,9 @@ module Git
7171
# unhandled math; pass source to alt and required mathphrase element; dblatex will process alt as LaTeX math
7272
%(<inlineequation><alt><![CDATA[#{equation = node.text}]]></alt><mathphrase><![CDATA[#{equation}]]></mathphrase></inlineequation>)
7373
elsif type == :monospaced
74-
node.text.gsub(/(\.\.\.?)([^\]$.])/, '<literal>\1</literal>\2')
75-
.gsub(%r{([\[\s|()>.]|^|\]|&gt;)(\.?([-a-zA-Z0-9:+=~@,/_^\$]+\.{0,2})+)}, '\1<literal>\2</literal>')
74+
node.text.gsub(/(\.\.\.?)([^\]$\.])/, '<literal>\1</literal>\2')
75+
.gsub(/^\.\.\.?$/, '<literal>\0</literal>')
76+
.gsub(%r{([\[\s|()>.]|^|\]|&gt;)(\.?([-a-zA-Z0-9:+=~@/_^\$\\\*]+\.{0,2})+|,)}, '\1<literal>\2</literal>')
7677
.gsub(/(&lt;[-a-zA-Z0-9.]+&gt;)/, '<emphasis>\1</emphasis>')
7778
else
7879
open, close, supports_phrase = QUOTE_TAGS[type]
@@ -100,7 +101,8 @@ module Git
100101
def convert_inline_quoted node
101102
if node.type == :monospaced
102103
node.text.gsub(/(\.\.\.?)([^\]$.])/, '<code>\1</code>\2')
103-
.gsub(%r{([\[\s|()>.]|^|\]|&gt;)(\.?([-a-zA-Z0-9:+=~@,/_^\$]+\.{0,2})+)}, '\1<code>\2</code>')
104+
.gsub(/^\.\.\.?$/, '<code>\0</code>')
105+
.gsub(%r{([\[\s|()>.]|^|\]|&gt;)(\.?([-a-zA-Z0-9:+=~@,/_^\$\\\*]+\.{0,2})+)}, '\1<code>\2</code>')
104106
.gsub(/(&lt;[-a-zA-Z0-9.]+&gt;)/, '<em>\1</em>')
105107

106108
else

Documentation/git-mv.adoc

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -8,49 +8,48 @@ git-mv - Move or rename a file, a directory, or a symlink
88

99
SYNOPSIS
1010
--------
11-
[verse]
12-
'git mv' [<options>] <source>... <destination>
11+
12+
[synopsis]
13+
git mv [-v] [-f] [-n] [-k] <source> <destination>
14+
git mv [-v] [-f] [-n] [-k] <source>... <destination-directory>
1315

1416
DESCRIPTION
1517
-----------
1618
Move or rename a file, directory, or symlink.
1719

18-
git mv [-v] [-f] [-n] [-k] <source> <destination>
19-
git mv [-v] [-f] [-n] [-k] <source> ... <destination-directory>
20-
21-
In the first form, it renames <source>, which must exist and be either
22-
a file, symlink or directory, to <destination>.
23-
In the second form, the last argument has to be an existing
20+
In the first form, it renames _<source>_, which must exist and be either
21+
a file, symlink or directory, to _<destination>_.
22+
In the second form, _<destination-directory>_ has to be an existing
2423
directory; the given sources will be moved into this directory.
2524

2625
The index is updated after successful completion, but the change must still be
2726
committed.
2827

2928
OPTIONS
3029
-------
31-
-f::
32-
--force::
30+
`-f`::
31+
`--force`::
3332
Force renaming or moving of a file even if the <destination> exists.
34-
-k::
33+
`-k`::
3534
Skip move or rename actions which would lead to an error
3635
condition. An error happens when a source is neither existing nor
3736
controlled by Git, or when it would overwrite an existing
3837
file unless `-f` is given.
39-
-n::
40-
--dry-run::
38+
`-n`::
39+
`--dry-run`::
4140
Do nothing; only show what would happen
4241

43-
-v::
44-
--verbose::
42+
`-v`::
43+
`--verbose`::
4544
Report the names of files as they are moved.
4645

4746
SUBMODULES
4847
----------
4948
Moving a submodule using a gitfile (which means they were cloned
5049
with a Git version 1.7.8 or newer) will update the gitfile and
5150
core.worktree setting to make the submodule work in the new location.
52-
It also will attempt to update the submodule.<name>.path setting in
53-
the linkgit:gitmodules[5] file and stage that file (unless -n is used).
51+
It also will attempt to update the `submodule.<name>.path` setting in
52+
the linkgit:gitmodules[5] file and stage that file (unless `-n` is used).
5453

5554
BUGS
5655
----

Documentation/git-reset.adoc

Lines changed: 49 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -7,23 +7,23 @@ git-reset - Reset current HEAD to the specified state
77

88
SYNOPSIS
99
--------
10-
[verse]
11-
'git reset' [-q] [<tree-ish>] [--] <pathspec>...
12-
'git reset' [-q] [--pathspec-from-file=<file> [--pathspec-file-nul]] [<tree-ish>]
13-
'git reset' (--patch | -p) [<tree-ish>] [--] [<pathspec>...]
14-
'git reset' [--soft | --mixed [-N] | --hard | --merge | --keep] [-q] [<commit>]
10+
[synopsis]
11+
git reset [-q] [<tree-ish>] [--] <pathspec>...
12+
git reset [-q] [--pathspec-from-file=<file> [--pathspec-file-nul]] [<tree-ish>]
13+
git reset (--patch | -p) [<tree-ish>] [--] [<pathspec>...]
14+
git reset [--soft | --mixed [-N] | --hard | --merge | --keep] [-q] [<commit>]
1515

1616
DESCRIPTION
1717
-----------
18-
In the first three forms, copy entries from `<tree-ish>` to the index.
19-
In the last form, set the current branch head (`HEAD`) to `<commit>`,
18+
In the first three forms, copy entries from _<tree-ish>_ to the index.
19+
In the last form, set the current branch head (`HEAD`) to _<commit>_,
2020
optionally modifying index and working tree to match.
21-
The `<tree-ish>`/`<commit>` defaults to `HEAD` in all forms.
21+
The _<tree-ish>_/_<commit>_ defaults to `HEAD` in all forms.
2222

23-
'git reset' [-q] [<tree-ish>] [--] <pathspec>...::
24-
'git reset' [-q] [--pathspec-from-file=<file> [--pathspec-file-nul]] [<tree-ish>]::
23+
`git reset [-q] [<tree-ish>] [--] <pathspec>...`::
24+
`git reset [-q] [--pathspec-from-file=<file> [--pathspec-file-nul]] [<tree-ish>]`::
2525
These forms reset the index entries for all paths that match the
26-
`<pathspec>` to their state at `<tree-ish>`. (It does not affect
26+
_<pathspec>_ to their state at _<tree-ish>_. (It does not affect
2727
the working tree or the current branch.)
2828
+
2929
This means that `git reset <pathspec>` is the opposite of `git add
@@ -37,64 +37,64 @@ and specifying a commit with `--source`, you
3737
can copy the contents of a path out of a commit to the index and to the
3838
working tree in one go.
3939

40-
'git reset' (--patch | -p) [<tree-ish>] [--] [<pathspec>...]::
40+
`git reset (--patch | -p) [<tree-ish>] [--] [<pathspec>...]`::
4141
Interactively select hunks in the difference between the index
42-
and `<tree-ish>` (defaults to `HEAD`). The chosen hunks are applied
42+
and _<tree-ish>_ (defaults to `HEAD`). The chosen hunks are applied
4343
in reverse to the index.
4444
+
4545
This means that `git reset -p` is the opposite of `git add -p`, i.e.
46-
you can use it to selectively reset hunks. See the ``Interactive Mode''
46+
you can use it to selectively reset hunks. See the "Interactive Mode"
4747
section of linkgit:git-add[1] to learn how to operate the `--patch` mode.
4848

49-
'git reset' [<mode>] [<commit>]::
50-
This form resets the current branch head to `<commit>` and
51-
possibly updates the index (resetting it to the tree of `<commit>`) and
52-
the working tree depending on `<mode>`. Before the operation, `ORIG_HEAD`
53-
is set to the tip of the current branch. If `<mode>` is omitted,
54-
defaults to `--mixed`. The `<mode>` must be one of the following:
49+
`git reset [<mode>] [<commit>]`::
50+
This form resets the current branch head to _<commit>_ and
51+
possibly updates the index (resetting it to the tree of _<commit>_) and
52+
the working tree depending on _<mode>_. Before the operation, `ORIG_HEAD`
53+
is set to the tip of the current branch. If _<mode>_ is omitted,
54+
defaults to `--mixed`. The _<mode>_ must be one of the following:
5555
+
5656
--
57-
--soft::
57+
`--soft`::
5858
Does not touch the index file or the working tree at all (but
59-
resets the head to `<commit>`, just like all modes do). This leaves
59+
resets the head to _<commit>_, just like all modes do). This leaves
6060
all your changed files "Changes to be committed", as `git status`
6161
would put it.
6262

63-
--mixed::
63+
`--mixed`::
6464
Resets the index but not the working tree (i.e., the changed files
6565
are preserved but not marked for commit) and reports what has not
6666
been updated. This is the default action.
6767
+
6868
If `-N` is specified, removed paths are marked as intent-to-add (see
6969
linkgit:git-add[1]).
7070

71-
--hard::
71+
`--hard`::
7272
Resets the index and working tree. Any changes to tracked files in the
73-
working tree since `<commit>` are discarded. Any untracked files or
73+
working tree since _<commit>_ are discarded. Any untracked files or
7474
directories in the way of writing any tracked files are simply deleted.
7575

76-
--merge::
76+
`--merge`::
7777
Resets the index and updates the files in the working tree that are
78-
different between `<commit>` and `HEAD`, but keeps those which are
78+
different between _<commit>_ and `HEAD`, but keeps those which are
7979
different between the index and working tree (i.e. which have changes
8080
which have not been added).
81-
If a file that is different between `<commit>` and the index has
81+
If a file that is different between _<commit>_ and the index has
8282
unstaged changes, reset is aborted.
8383
+
8484
In other words, `--merge` does something like a `git read-tree -u -m <commit>`,
8585
but carries forward unmerged index entries.
8686

87-
--keep::
87+
`--keep`::
8888
Resets index entries and updates files in the working tree that are
89-
different between `<commit>` and `HEAD`.
90-
If a file that is different between `<commit>` and `HEAD` has local
89+
different between _<commit>_ and `HEAD`.
90+
If a file that is different between _<commit>_ and `HEAD` has local
9191
changes, reset is aborted.
9292

93-
--[no-]recurse-submodules::
94-
When the working tree is updated, using --recurse-submodules will
93+
`--[no-]recurse-submodules`::
94+
When the working tree is updated, using `--recurse-submodules` will
9595
also recursively reset the working tree of all active submodules
9696
according to the commit recorded in the superproject, also setting
97-
the submodules' HEAD to be detached at that commit.
97+
the submodules' `HEAD` to be detached at that commit.
9898
--
9999

100100
See "Reset, restore and revert" in linkgit:git[1] for the differences
@@ -104,31 +104,31 @@ between the three commands.
104104
OPTIONS
105105
-------
106106

107-
-q::
108-
--quiet::
107+
`-q`::
108+
`--quiet`::
109109
Be quiet, only report errors.
110110

111-
--refresh::
112-
--no-refresh::
111+
`--refresh`::
112+
`--no-refresh`::
113113
Refresh the index after a mixed reset. Enabled by default.
114114

115-
--pathspec-from-file=<file>::
116-
Pathspec is passed in `<file>` instead of commandline args. If
117-
`<file>` is exactly `-` then standard input is used. Pathspec
118-
elements are separated by LF or CR/LF. Pathspec elements can be
115+
`--pathspec-from-file=<file>`::
116+
Pathspec is passed in _<file>_ instead of commandline args. If
117+
_<file>_ is exactly `-` then standard input is used. Pathspec
118+
elements are separated by _LF_ or _CR_/_LF_. Pathspec elements can be
119119
quoted as explained for the configuration variable `core.quotePath`
120120
(see linkgit:git-config[1]). See also `--pathspec-file-nul` and
121121
global `--literal-pathspecs`.
122122

123-
--pathspec-file-nul::
123+
`--pathspec-file-nul`::
124124
Only meaningful with `--pathspec-from-file`. Pathspec elements are
125-
separated with NUL character and all other characters are taken
125+
separated with _NUL_ character and all other characters are taken
126126
literally (including newlines and quotes).
127127

128-
\--::
128+
`--`::
129129
Do not interpret any more arguments as options.
130130

131-
<pathspec>...::
131+
`<pathspec>...`::
132132
Limits the paths affected by the operation.
133133
+
134134
For more details, see the 'pathspec' entry in linkgit:gitglossary[7].
@@ -348,7 +348,7 @@ $ git commit ... <8>
348348
------------
349349
+
350350
<1> First, reset the history back one commit so that we remove the original
351-
commit, but leave the working tree with all the changes. The -N ensures
351+
commit, but leave the working tree with all the changes. The `-N` ensures
352352
that any new files added with `HEAD` are still marked so that `git add -p`
353353
will find them.
354354
<2> Next, we interactively select diff hunks to add using the `git add -p`
@@ -458,7 +458,7 @@ working index HEAD target working index HEAD
458458
--keep B C C
459459
....
460460

461-
`reset --merge` is meant to be used when resetting out of a conflicted
461+
`git reset --merge` is meant to be used when resetting out of a conflicted
462462
merge. Any mergy operation guarantees that the working tree file that is
463463
involved in the merge does not have a local change with respect to the index
464464
before it starts, and that it writes the result out to the working tree. So if
@@ -467,7 +467,7 @@ between the index and the working tree, then it means that we are not
467467
resetting out from a state that a mergy operation left after failing
468468
with a conflict. That is why we disallow `--merge` option in this case.
469469

470-
`reset --keep` is meant to be used when removing some of the last
470+
`git reset --keep` is meant to be used when removing some of the last
471471
commits in the current branch while keeping changes in the working
472472
tree. If there could be conflicts between the changes in the commit we
473473
want to remove and the changes in the working tree we want to keep,

0 commit comments

Comments
 (0)