Merge branch 'ma/asciidoctor-more-fixes'

Doc formatting updates.

* ma/asciidoctor-more-fixes:
  gitweb.conf.txt: switch pluses to backticks to help Asciidoctor
  git-merge-index.txt: wrap shell listing in "----"
  git-receive-pack.txt: wrap shell [script] listing in "----"
  git-ls-remote.txt: wrap shell listing in "----"
  Documentation: wrap config listings in "----"
  git-merge-base.txt: render indentations correctly under Asciidoctor
  Documentation: wrap blocks with "--"
This commit is contained in:
Junio C Hamano 2019-10-06 12:25:16 +09:00
commit 314fcd32d7
11 changed files with 211 additions and 172 deletions

View File

@ -178,47 +178,49 @@ to either specify only the realpath version, or both versions.
Example Example
~~~~~~~ ~~~~~~~
# Core variables ----
[core] # Core variables
; Don't trust file modes [core]
filemode = false ; Don't trust file modes
filemode = false
# Our diff algorithm # Our diff algorithm
[diff] [diff]
external = /usr/local/bin/diff-wrapper external = /usr/local/bin/diff-wrapper
renames = true renames = true
[branch "devel"] [branch "devel"]
remote = origin remote = origin
merge = refs/heads/devel merge = refs/heads/devel
# Proxy settings # Proxy settings
[core] [core]
gitProxy="ssh" for "kernel.org" gitProxy="ssh" for "kernel.org"
gitProxy=default-proxy ; for the rest gitProxy=default-proxy ; for the rest
[include] [include]
path = /path/to/foo.inc ; include by absolute path path = /path/to/foo.inc ; include by absolute path
path = foo.inc ; find "foo.inc" relative to the current file path = foo.inc ; find "foo.inc" relative to the current file
path = ~/foo.inc ; find "foo.inc" in your `$HOME` directory path = ~/foo.inc ; find "foo.inc" in your `$HOME` directory
; include if $GIT_DIR is /path/to/foo/.git ; include if $GIT_DIR is /path/to/foo/.git
[includeIf "gitdir:/path/to/foo/.git"] [includeIf "gitdir:/path/to/foo/.git"]
path = /path/to/foo.inc path = /path/to/foo.inc
; include for all repositories inside /path/to/group ; include for all repositories inside /path/to/group
[includeIf "gitdir:/path/to/group/"] [includeIf "gitdir:/path/to/group/"]
path = /path/to/foo.inc path = /path/to/foo.inc
; include for all repositories inside $HOME/to/group ; include for all repositories inside $HOME/to/group
[includeIf "gitdir:~/to/group/"] [includeIf "gitdir:~/to/group/"]
path = /path/to/foo.inc path = /path/to/foo.inc
; relative paths are always relative to the including ; relative paths are always relative to the including
; file (if the condition is true); their location is not ; file (if the condition is true); their location is not
; affected by the condition ; affected by the condition
[includeIf "gitdir:/path/to/group/"] [includeIf "gitdir:/path/to/group/"]
path = foo.inc path = foo.inc
----
; include only if we are in a worktree where foo-branch is ; include only if we are in a worktree where foo-branch is
; currently checked out ; currently checked out

View File

@ -282,18 +282,20 @@ FROM UPSTREAM REBASE" section in linkgit:git-rebase[1].)
--untracked-files[=<mode>]:: --untracked-files[=<mode>]::
Show untracked files. Show untracked files.
+ +
--
The mode parameter is optional (defaults to 'all'), and is used to The mode parameter is optional (defaults to 'all'), and is used to
specify the handling of untracked files; when -u is not used, the specify the handling of untracked files; when -u is not used, the
default is 'normal', i.e. show untracked files and directories. default is 'normal', i.e. show untracked files and directories.
+
The possible options are: The possible options are:
+
- 'no' - Show no untracked files - 'no' - Show no untracked files
- 'normal' - Shows untracked files and directories - 'normal' - Shows untracked files and directories
- 'all' - Also shows individual files in untracked directories. - 'all' - Also shows individual files in untracked directories.
+
The default can be changed using the status.showUntrackedFiles The default can be changed using the status.showUntrackedFiles
configuration variable documented in linkgit:git-config[1]. configuration variable documented in linkgit:git-config[1].
--
-v:: -v::
--verbose:: --verbose::

View File

@ -339,33 +339,35 @@ EXAMPLES
Given a .git/config like this: Given a .git/config like this:
# ------------
# This is the config file, and #
# a '#' or ';' character indicates # This is the config file, and
# a comment # a '#' or ';' character indicates
# # a comment
#
; core variables ; core variables
[core] [core]
; Don't trust file modes ; Don't trust file modes
filemode = false filemode = false
; Our diff algorithm ; Our diff algorithm
[diff] [diff]
external = /usr/local/bin/diff-wrapper external = /usr/local/bin/diff-wrapper
renames = true renames = true
; Proxy settings ; Proxy settings
[core] [core]
gitproxy=proxy-command for kernel.org gitproxy=proxy-command for kernel.org
gitproxy=default-proxy ; for all the rest gitproxy=default-proxy ; for all the rest
; HTTP ; HTTP
[http] [http]
sslVerify sslVerify
[http "https://weak.example.com"] [http "https://weak.example.com"]
sslVerify = false sslVerify = false
cookieFile = /tmp/cookie.txt cookieFile = /tmp/cookie.txt
------------
you can set the filemode to true with you can set the filemode to true with

View File

@ -92,21 +92,23 @@ OPTIONS
EXAMPLES EXAMPLES
-------- --------
$ git ls-remote --tags ./. ----
d6602ec5194c87b0fc87103ca4d67251c76f233a refs/tags/v0.99 $ git ls-remote --tags ./.
f25a265a342aed6041ab0cc484224d9ca54b6f41 refs/tags/v0.99.1 d6602ec5194c87b0fc87103ca4d67251c76f233a refs/tags/v0.99
7ceca275d047c90c0c7d5afb13ab97efdf51bd6e refs/tags/v0.99.3 f25a265a342aed6041ab0cc484224d9ca54b6f41 refs/tags/v0.99.1
c5db5456ae3b0873fc659c19fafdde22313cc441 refs/tags/v0.99.2 7ceca275d047c90c0c7d5afb13ab97efdf51bd6e refs/tags/v0.99.3
0918385dbd9656cab0d1d81ba7453d49bbc16250 refs/tags/junio-gpg-pub c5db5456ae3b0873fc659c19fafdde22313cc441 refs/tags/v0.99.2
$ git ls-remote http://www.kernel.org/pub/scm/git/git.git master pu rc 0918385dbd9656cab0d1d81ba7453d49bbc16250 refs/tags/junio-gpg-pub
5fe978a5381f1fbad26a80e682ddd2a401966740 refs/heads/master $ git ls-remote http://www.kernel.org/pub/scm/git/git.git master pu rc
c781a84b5204fb294c9ccc79f8b3baceeb32c061 refs/heads/pu 5fe978a5381f1fbad26a80e682ddd2a401966740 refs/heads/master
$ git remote add korg http://www.kernel.org/pub/scm/git/git.git c781a84b5204fb294c9ccc79f8b3baceeb32c061 refs/heads/pu
$ git ls-remote --tags korg v\* $ git remote add korg http://www.kernel.org/pub/scm/git/git.git
d6602ec5194c87b0fc87103ca4d67251c76f233a refs/tags/v0.99 $ git ls-remote --tags korg v\*
f25a265a342aed6041ab0cc484224d9ca54b6f41 refs/tags/v0.99.1 d6602ec5194c87b0fc87103ca4d67251c76f233a refs/tags/v0.99
c5db5456ae3b0873fc659c19fafdde22313cc441 refs/tags/v0.99.2 f25a265a342aed6041ab0cc484224d9ca54b6f41 refs/tags/v0.99.1
7ceca275d047c90c0c7d5afb13ab97efdf51bd6e refs/tags/v0.99.3 c5db5456ae3b0873fc659c19fafdde22313cc441 refs/tags/v0.99.2
7ceca275d047c90c0c7d5afb13ab97efdf51bd6e refs/tags/v0.99.3
----
SEE ALSO SEE ALSO
-------- --------

View File

@ -80,9 +80,11 @@ which is reachable from both 'A' and 'B' through the parent relationship.
For example, with this topology: For example, with this topology:
o---o---o---B ....
/ o---o---o---B
---o---1---o---o---o---A /
---o---1---o---o---o---A
....
the merge base between 'A' and 'B' is '1'. the merge base between 'A' and 'B' is '1'.
@ -90,21 +92,25 @@ Given three commits 'A', 'B' and 'C', `git merge-base A B C` will compute the
merge base between 'A' and a hypothetical commit 'M', which is a merge merge base between 'A' and a hypothetical commit 'M', which is a merge
between 'B' and 'C'. For example, with this topology: between 'B' and 'C'. For example, with this topology:
o---o---o---o---C ....
/ o---o---o---o---C
/ o---o---o---B /
/ / / o---o---o---B
---2---1---o---o---o---A / /
---2---1---o---o---o---A
....
the result of `git merge-base A B C` is '1'. This is because the the result of `git merge-base A B C` is '1'. This is because the
equivalent topology with a merge commit 'M' between 'B' and 'C' is: equivalent topology with a merge commit 'M' between 'B' and 'C' is:
o---o---o---o---o ....
/ \ o---o---o---o---o
/ o---o---o---o---M / \
/ / / o---o---o---o---M
---2---1---o---o---o---A / /
---2---1---o---o---o---A
....
and the result of `git merge-base A M` is '1'. Commit '2' is also a and the result of `git merge-base A M` is '1'. Commit '2' is also a
common ancestor between 'A' and 'M', but '1' is a better common ancestor, common ancestor between 'A' and 'M', but '1' is a better common ancestor,
@ -116,11 +122,13 @@ the best common ancestor of all commits.
When the history involves criss-cross merges, there can be more than one When the history involves criss-cross merges, there can be more than one
'best' common ancestor for two commits. For example, with this topology: 'best' common ancestor for two commits. For example, with this topology:
---1---o---A ....
\ / ---1---o---A
X \ /
/ \ X
---2---o---o---B / \
---2---o---o---B
....
both '1' and '2' are merge-bases of A and B. Neither one is better than both '1' and '2' are merge-bases of A and B. Neither one is better than
the other (both are 'best' merge bases). When the `--all` option is not given, the other (both are 'best' merge bases). When the `--all` option is not given,
@ -131,18 +139,22 @@ and B is (or at least used to be) to compute the merge base between
A and B, and check if it is the same as A, in which case, A is an A and B, and check if it is the same as A, in which case, A is an
ancestor of B. You will see this idiom used often in older scripts. ancestor of B. You will see this idiom used often in older scripts.
A=$(git rev-parse --verify A) ....
if test "$A" = "$(git merge-base A B)" A=$(git rev-parse --verify A)
then if test "$A" = "$(git merge-base A B)"
... A is an ancestor of B ... then
fi ... A is an ancestor of B ...
fi
....
In modern git, you can say this in a more direct way: In modern git, you can say this in a more direct way:
if git merge-base --is-ancestor A B ....
then if git merge-base --is-ancestor A B
... A is an ancestor of B ... then
fi ... A is an ancestor of B ...
fi
....
instead. instead.
@ -154,13 +166,15 @@ topic origin/master`, the history of remote-tracking branch
`origin/master` may have been rewound and rebuilt, leading to a `origin/master` may have been rewound and rebuilt, leading to a
history of this shape: history of this shape:
o---B2 ....
/ o---B2
---o---o---B1--o---o---o---B (origin/master) /
\ ---o---o---B1--o---o---o---B (origin/master)
B0 \
\ B0
D0---D1---D (topic) \
D0---D1---D (topic)
....
where `origin/master` used to point at commits B0, B1, B2 and now it where `origin/master` used to point at commits B0, B1, B2 and now it
points at B, and your `topic` branch was started on top of it back points at B, and your `topic` branch was started on top of it back
@ -193,13 +207,15 @@ will find B0, and
will replay D0, D1 and D on top of B to create a new history of this will replay D0, D1 and D on top of B to create a new history of this
shape: shape:
o---B2 ....
/ o---B2
---o---o---B1--o---o---o---B (origin/master) /
\ \ ---o---o---B1--o---o---o---B (origin/master)
B0 D0'--D1'--D' (topic - updated) \ \
\ B0 D0'--D1'--D' (topic - updated)
D0---D1---D (topic - old) \
D0---D1---D (topic - old)
....
A caveat is that older reflog entries in your repository may be A caveat is that older reflog entries in your repository may be
expired by `git gc`. If B0 no longer appears in the reflog of the expired by `git gc`. If B0 no longer appears in the reflog of the

View File

@ -54,20 +54,24 @@ original is first. But the argument order to the 3-way merge program
Examples: Examples:
torvalds@ppc970:~/merge-test> git merge-index cat MM ----
This is MM from the original tree. # original torvalds@ppc970:~/merge-test> git merge-index cat MM
This is modified MM in the branch A. # merge1 This is MM from the original tree. # original
This is modified MM in the branch B. # merge2 This is modified MM in the branch A. # merge1
This is modified MM in the branch B. # current contents This is modified MM in the branch B. # merge2
This is modified MM in the branch B. # current contents
----
or or
torvalds@ppc970:~/merge-test> git merge-index cat AA MM ----
cat: : No such file or directory torvalds@ppc970:~/merge-test> git merge-index cat AA MM
This is added AA in the branch A. cat: : No such file or directory
This is added AA in the branch B. This is added AA in the branch A.
This is added AA in the branch B. This is added AA in the branch B.
fatal: merge program failed This is added AA in the branch B.
fatal: merge program failed
----
where the latter example shows how 'git merge-index' will stop trying to where the latter example shows how 'git merge-index' will stop trying to
merge once anything has returned an error (i.e., `cat` returned an error merge once anything has returned an error (i.e., `cat` returned an error

View File

@ -165,29 +165,31 @@ ref listing the commits pushed to the repository, and logs the push
certificates of signed pushes with good signatures to a logger certificates of signed pushes with good signatures to a logger
service: service:
#!/bin/sh ----
# mail out commit update information. #!/bin/sh
while read oval nval ref # mail out commit update information.
do while read oval nval ref
if expr "$oval" : '0*$' >/dev/null do
then if expr "$oval" : '0*$' >/dev/null
echo "Created a new ref, with the following commits:"
git rev-list --pretty "$nval"
else
echo "New commits:"
git rev-list --pretty "$nval" "^$oval"
fi |
mail -s "Changes to ref $ref" commit-list@mydomain
done
# log signed push certificate, if any
if test -n "${GIT_PUSH_CERT-}" && test ${GIT_PUSH_CERT_STATUS} = G
then then
( echo "Created a new ref, with the following commits:"
echo expected nonce is ${GIT_PUSH_NONCE} git rev-list --pretty "$nval"
git cat-file blob ${GIT_PUSH_CERT} else
) | mail -s "push certificate from $GIT_PUSH_CERT_SIGNER" push-log@mydomain echo "New commits:"
fi git rev-list --pretty "$nval" "^$oval"
exit 0 fi |
mail -s "Changes to ref $ref" commit-list@mydomain
done
# log signed push certificate, if any
if test -n "${GIT_PUSH_CERT-}" && test ${GIT_PUSH_CERT_STATUS} = G
then
(
echo expected nonce is ${GIT_PUSH_NONCE}
git cat-file blob ${GIT_PUSH_CERT}
) | mail -s "push certificate from $GIT_PUSH_CERT_SIGNER" push-log@mydomain
fi
exit 0
----
The exit code from this hook invocation is ignored, however a The exit code from this hook invocation is ignored, however a
non-zero exit code will generate an error message. non-zero exit code will generate an error message.
@ -212,8 +214,10 @@ anyway.
This hook can be used, for example, to run `git update-server-info` This hook can be used, for example, to run `git update-server-info`
if the repository is packed and is served via a dumb transport. if the repository is packed and is served via a dumb transport.
#!/bin/sh ----
exec git update-server-info #!/bin/sh
exec git update-server-info
----
QUARANTINE ENVIRONMENT QUARANTINE ENVIRONMENT

View File

@ -486,11 +486,13 @@ Use gmail as the smtp server
To use 'git send-email' to send your patches through the GMail SMTP server, To use 'git send-email' to send your patches through the GMail SMTP server,
edit ~/.gitconfig to specify your account settings: edit ~/.gitconfig to specify your account settings:
[sendemail] ----
smtpEncryption = tls [sendemail]
smtpServer = smtp.gmail.com smtpEncryption = tls
smtpUser = yourname@gmail.com smtpServer = smtp.gmail.com
smtpServerPort = 587 smtpUser = yourname@gmail.com
smtpServerPort = 587
----
If you have multifactor authentication setup on your gmail account, you will If you have multifactor authentication setup on your gmail account, you will
need to generate an app-specific password for use with 'git send-email'. Visit need to generate an app-specific password for use with 'git send-email'. Visit

View File

@ -59,16 +59,17 @@ This is optional and defaults to the original version 'v1' format.
--untracked-files[=<mode>]:: --untracked-files[=<mode>]::
Show untracked files. Show untracked files.
+ +
--
The mode parameter is used to specify the handling of untracked files. The mode parameter is used to specify the handling of untracked files.
It is optional: it defaults to 'all', and if specified, it must be It is optional: it defaults to 'all', and if specified, it must be
stuck to the option (e.g. `-uno`, but not `-u no`). stuck to the option (e.g. `-uno`, but not `-u no`).
+
The possible options are: The possible options are:
+
- 'no' - Show no untracked files. - 'no' - Show no untracked files.
- 'normal' - Shows untracked files and directories. - 'normal' - Shows untracked files and directories.
- 'all' - Also shows individual files in untracked directories. - 'all' - Also shows individual files in untracked directories.
+
When `-u` option is not used, untracked files and directories are When `-u` option is not used, untracked files and directories are
shown (i.e. the same as specifying `normal`), to help you avoid shown (i.e. the same as specifying `normal`), to help you avoid
forgetting to add newly created files. Because it takes extra work forgetting to add newly created files. Because it takes extra work
@ -78,9 +79,10 @@ Consider enabling untracked cache and split index if supported (see
`git update-index --untracked-cache` and `git update-index `git update-index --untracked-cache` and `git update-index
--split-index`), Otherwise you can use `no` to have `git status` --split-index`), Otherwise you can use `no` to have `git status`
return more quickly without showing untracked files. return more quickly without showing untracked files.
+
The default can be changed using the status.showUntrackedFiles The default can be changed using the status.showUntrackedFiles
configuration variable documented in linkgit:git-config[1]. configuration variable documented in linkgit:git-config[1].
--
--ignore-submodules[=<when>]:: --ignore-submodules[=<when>]::
Ignore changes to submodules when looking for changes. <when> can be Ignore changes to submodules when looking for changes. <when> can be
@ -100,11 +102,12 @@ configuration variable documented in linkgit:git-config[1].
--ignored[=<mode>]:: --ignored[=<mode>]::
Show ignored files as well. Show ignored files as well.
+ +
--
The mode parameter is used to specify the handling of ignored files. The mode parameter is used to specify the handling of ignored files.
It is optional: it defaults to 'traditional'. It is optional: it defaults to 'traditional'.
+
The possible options are: The possible options are:
+
- 'traditional' - Shows ignored files and directories, unless - 'traditional' - Shows ignored files and directories, unless
--untracked-files=all is specified, in which case --untracked-files=all is specified, in which case
individual files in ignored directories are individual files in ignored directories are
@ -112,12 +115,13 @@ The possible options are:
- 'no' - Show no ignored files. - 'no' - Show no ignored files.
- 'matching' - Shows ignored files and directories matching an - 'matching' - Shows ignored files and directories matching an
ignore pattern. ignore pattern.
+
When 'matching' mode is specified, paths that explicitly match an When 'matching' mode is specified, paths that explicitly match an
ignored pattern are shown. If a directory matches an ignore pattern, ignored pattern are shown. If a directory matches an ignore pattern,
then it is shown, but not paths contained in the ignored directory. If then it is shown, but not paths contained in the ignored directory. If
a directory does not match an ignore pattern, but all contents are a directory does not match an ignore pattern, but all contents are
ignored, then the directory is not shown, but all contents are shown. ignored, then the directory is not shown, but all contents are shown.
--
-z:: -z::
Terminate entries with NUL, instead of LF. This implies Terminate entries with NUL, instead of LF. This implies

View File

@ -105,14 +105,15 @@ EXAMPLES
Consider the following .gitmodules file: Consider the following .gitmodules file:
[submodule "libfoo"] ----
path = include/foo [submodule "libfoo"]
url = git://foo.com/git/lib.git path = include/foo
url = git://foo.com/git/lib.git
[submodule "libbar"]
path = include/bar
url = git://bar.com/git/lib.git
[submodule "libbar"]
path = include/bar
url = git://bar.com/git/lib.git
----
This defines two submodules, `libfoo` and `libbar`. These are expected to This defines two submodules, `libfoo` and `libbar`. These are expected to
be checked out in the paths `include/foo` and `include/bar`, and for both be checked out in the paths `include/foo` and `include/bar`, and for both

View File

@ -786,9 +786,9 @@ forks::
subdirectories of project root (basename) to be forks of existing subdirectories of project root (basename) to be forks of existing
projects. For each project +$projname.git+, projects in the projects. For each project +$projname.git+, projects in the
+$projname/+ directory and its subdirectories will not be +$projname/+ directory and its subdirectories will not be
shown in the main projects list. Instead, a \'\+' mark is shown shown in the main projects list. Instead, a \'+' mark is shown
next to +$projname+, which links to a "forks" view that lists all next to `$projname`, which links to a "forks" view that lists all
the forks (all projects in +$projname/+ subdirectory). Additionally the forks (all projects in `$projname/` subdirectory). Additionally
a "forks" view for a project is linked from project summary page. a "forks" view for a project is linked from project summary page.
+ +
If the project list is taken from a file (+$projects_list+ points to a If the project list is taken from a file (+$projects_list+ points to a