git@vger.kernel.org list mirror (unofficial, one of many)
 help / color / Atom feed
* [PATCH 0/7] Fix more AsciiDoc/tor differences
@ 2019-09-07 14:12 Martin Ågren
  2019-09-07 14:12 ` [PATCH 1/7] Documentation: wrap blocks with "--" Martin Ågren
                   ` (7 more replies)
  0 siblings, 8 replies; 10+ messages in thread
From: Martin Ågren @ 2019-09-07 14:12 UTC (permalink / raw)
  To: git; +Cc: Jeff King

This series roughly halves the line count of `./doc-diff --from-asciidoc
--to-asciidoctor --cut-header-footer HEAD HEAD`. Together with my recent
(independent) mini-series [1], I claim that Asciidoctor 1.5.5 now
processes the manpages better than AsciiDoc 8.6.10 does.

Patch 6/7 actually changes the rendering with both engines, so that they
look nice and the same. The other patches are all no-ops with one engine
while fixing things with the other -- they all improve the situation
with Asciidoctor (which is what I care most about) except patch 1/7
which goes the other way (it reduces the doc-diff, which helps).

Patch 7/7 has an element of black magic to it. I wouldn't be too
surprised if I've managed to appease my particular versions of these
tools while not fixing -- or maybe even breaking? -- some other versions
[that people actually use]. That's where I think a quick test would be
the most valuable.

I've based this on maint on the assumption that these are bugfixes. (I
know I've been bad on basing similar work off of maint.) This causes a
conflict with master and pu in config.txt, which has learned about
"includeIf onbranch:foo-branch" in the meantime. Maybe I've made the
wrong call here -- Junio, if you'd rather have me submit this on master,
just let me know.

[1] https://public-inbox.org/git/cover.1567534373.git.martin.agren@gmail.com/

Martin Ågren (7):
  Documentation: wrap blocks with "--"
  git-merge-base.txt: render indentations correctly under Asciidoctor
  Documentation: wrap config listings in "----"
  git-ls-remote.txt: wrap shell listing in "----"
  git-receive-pack.txt: wrap shell [script] listing in "----"
  git-merge-index.txt: wrap shell listing in "----"
  gitweb.conf.txt: switch pluses to backticks to help Asciidoctor

 Documentation/config.txt           | 84 ++++++++++++-------------
 Documentation/git-commit.txt       |  8 ++-
 Documentation/git-config.txt       | 56 +++++++++--------
 Documentation/git-ls-remote.txt    | 32 +++++-----
 Documentation/git-merge-base.txt   | 98 +++++++++++++++++-------------
 Documentation/git-merge-index.txt  | 26 ++++----
 Documentation/git-receive-pack.txt | 52 ++++++++--------
 Documentation/git-send-email.txt   | 12 ++--
 Documentation/git-status.txt       | 18 +++---
 Documentation/gitmodules.txt       | 15 ++---
 Documentation/gitweb.conf.txt      |  6 +-
 11 files changed, 223 insertions(+), 184 deletions(-)

-- 
2.23.0


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH 1/7] Documentation: wrap blocks with "--"
  2019-09-07 14:12 [PATCH 0/7] Fix more AsciiDoc/tor differences Martin Ågren
@ 2019-09-07 14:12 ` Martin Ågren
  2019-09-07 14:12 ` [PATCH 2/7] git-merge-base.txt: render indentations correctly under Asciidoctor Martin Ågren
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 10+ messages in thread
From: Martin Ågren @ 2019-09-07 14:12 UTC (permalink / raw)
  To: git; +Cc: Jeff King

The documentation for each of these options contains a list. After the
list, AsciiDoc interprets the continuation as a continuation of the
*list*, not as a continution of the larger block. As a result, we get
too much indentation. Wrap the entire blocks in "--" to fix this. With
Asciidoctor, this commit is a no-op, and the two programs now render
these identically.

These two files share the same problem and indeed, they both document
`--untracked-files` in quite similar ways. I haven't checked to what
extent that is intentional or warranted, and to what extent they have
simply drifted apart. I consider such an investigation and possible
cleanup as out of scope for this commit and this patch series.

Signed-off-by: Martin Ågren <martin.agren@gmail.com>
---
 Documentation/git-commit.txt |  8 +++++---
 Documentation/git-status.txt | 18 +++++++++++-------
 2 files changed, 16 insertions(+), 10 deletions(-)

diff --git a/Documentation/git-commit.txt b/Documentation/git-commit.txt
index a85c2c2a4c..e43dad26f5 100644
--- a/Documentation/git-commit.txt
+++ b/Documentation/git-commit.txt
@@ -282,18 +282,20 @@ FROM UPSTREAM REBASE" section in linkgit:git-rebase[1].)
 --untracked-files[=<mode>]::
 	Show untracked files.
 +
+--
 The mode parameter is optional (defaults to 'all'), and is used to
 specify the handling of untracked files; when -u is not used, the
 default is 'normal', i.e. show untracked files and directories.
-+
+
 The possible options are:
-+
+
 	- 'no'     - Show no untracked files
 	- 'normal' - Shows untracked files and directories
 	- 'all'    - Also shows individual files in untracked directories.
-+
+
 The default can be changed using the status.showUntrackedFiles
 configuration variable documented in linkgit:git-config[1].
+--
 
 -v::
 --verbose::
diff --git a/Documentation/git-status.txt b/Documentation/git-status.txt
index d4e8f24f0c..7731b45f07 100644
--- a/Documentation/git-status.txt
+++ b/Documentation/git-status.txt
@@ -59,16 +59,17 @@ This is optional and defaults to the original version 'v1' format.
 --untracked-files[=<mode>]::
 	Show 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
 stuck to the option (e.g. `-uno`, but not `-u no`).
-+
+
 The possible options are:
-+
+
 	- 'no'     - Show no untracked files.
 	- 'normal' - Shows untracked files and directories.
 	- 'all'    - Also shows individual files in untracked directories.
-+
+
 When `-u` option is not used, untracked files and directories are
 shown (i.e. the same as specifying `normal`), to help you avoid
 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
 --split-index`), Otherwise you can use `no` to have `git status`
 return more quickly without showing untracked files.
-+
+
 The default can be changed using the status.showUntrackedFiles
 configuration variable documented in linkgit:git-config[1].
+--
 
 --ignore-submodules[=<when>]::
 	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>]::
 	Show ignored files as well.
 +
+--
 The mode parameter is used to specify the handling of ignored files.
 It is optional: it defaults to 'traditional'.
-+
+
 The possible options are:
-+
+
 	- 'traditional' - Shows ignored files and directories, unless
 			  --untracked-files=all is specified, in which case
 			  individual files in ignored directories are
@@ -112,12 +115,13 @@ The possible options are:
 	- 'no'	        - Show no ignored files.
 	- 'matching'    - Shows ignored files and directories matching an
 			  ignore pattern.
-+
+
 When 'matching' mode is specified, paths that explicitly match an
 ignored pattern are shown. If a directory matches an ignore pattern,
 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
 ignored, then the directory is not shown, but all contents are shown.
+--
 
 -z::
 	Terminate entries with NUL, instead of LF.  This implies
-- 
2.23.0


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH 2/7] git-merge-base.txt: render indentations correctly under Asciidoctor
  2019-09-07 14:12 [PATCH 0/7] Fix more AsciiDoc/tor differences Martin Ågren
  2019-09-07 14:12 ` [PATCH 1/7] Documentation: wrap blocks with "--" Martin Ågren
@ 2019-09-07 14:12 ` Martin Ågren
  2019-09-07 14:12 ` [PATCH 3/7] Documentation: wrap config listings in "----" Martin Ågren
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 10+ messages in thread
From: Martin Ågren @ 2019-09-07 14:12 UTC (permalink / raw)
  To: git; +Cc: Jeff King

There are several graphs in this document. For most of them, we use a
single leading tab to indent the whole graph, and then we use spaces
(possibly eight or more) to align things within the graph.

In the larger graph, we use a different strategy: We use 1-N tabs and
just a small number of spaces (<8). This is how we usually prefer to do
our indenting, but Asciidoctor ends up rendering this differently from
AsciiDoc. Same thing for the if-then-fi examples where the conditional
code is indented by two tabs, which renders differently under AsciiDoc
and Asciidoctor.

Similar to 379805051d ("Documentation: render revisions correctly under
Asciidoctor", 2018-05-06), use an explicit literal block to indicate
that we want to keep the leading whitespace in the tables. Change not
just the ones that render differently, but all of them for consistency.

Because this gives us some extra indentation, we can remove the one that
we have been carrying explicitly. That is, drop the first tab of
indentation on each line. With AsciiDoc, this results in identical
rendering before and after this commit, both for git-merge-base.1 and
git-merge-base.html.

A less intrusive change would be to replace tabs 2-N on each line with
eight spaces. But let's follow the example set by 379805051d, so that we
can use our preferred way of indenting.

Signed-off-by: Martin Ågren <martin.agren@gmail.com>
---
 Documentation/git-merge-base.txt | 98 +++++++++++++++++++-------------
 1 file changed, 57 insertions(+), 41 deletions(-)

diff --git a/Documentation/git-merge-base.txt b/Documentation/git-merge-base.txt
index 9f07f4f6ed..411dca308b 100644
--- a/Documentation/git-merge-base.txt
+++ b/Documentation/git-merge-base.txt
@@ -80,9 +80,11 @@ which is reachable from both 'A' and 'B' through the parent relationship.
 
 For example, with this topology:
 
-	         o---o---o---B
-	        /
-	---o---1---o---o---o---A
+....
+	 o---o---o---B
+	/
+---o---1---o---o---o---A
+....
 
 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
 between 'B' and 'C'.  For example, with this topology:
 
-	       o---o---o---o---C
-	      /
-	     /   o---o---o---B
-	    /   /
-	---2---1---o---o---o---A
+....
+       o---o---o---o---C
+      /
+     /   o---o---o---B
+    /   /
+---2---1---o---o---o---A
+....
 
 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:
 
 
-	       o---o---o---o---o
-	      /                 \
-	     /   o---o---o---o---M
-	    /   /
-	---2---1---o---o---o---A
+....
+       o---o---o---o---o
+      /                 \
+     /   o---o---o---o---M
+    /   /
+---2---1---o---o---o---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,
@@ -116,11 +122,13 @@ the best common ancestor of all commits.
 When the history involves criss-cross merges, there can be more than one
 'best' common ancestor for two commits.  For example, with this topology:
 
-	---1---o---A
-	    \ /
-	     X
-	    / \
-	---2---o---o---B
+....
+---1---o---A
+    \ /
+     X
+    / \
+---2---o---o---B
+....
 
 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,
@@ -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
 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)"
-	then
-		... A is an ancestor of B ...
-	fi
+....
+A=$(git rev-parse --verify A)
+if test "$A" = "$(git merge-base A B)"
+then
+	... A is an ancestor of B ...
+fi
+....
 
 In modern git, you can say this in a more direct way:
 
-	if git merge-base --is-ancestor A B
-	then
-		... A is an ancestor of B ...
-	fi
+....
+if git merge-base --is-ancestor A B
+then
+	... A is an ancestor of B ...
+fi
+....
 
 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
 history of this shape:
 
-	                 o---B2
-	                /
-	---o---o---B1--o---o---o---B (origin/master)
-	        \
-	         B0
-	          \
-	           D0---D1---D (topic)
+....
+		 o---B2
+		/
+---o---o---B1--o---o---o---B (origin/master)
+	\
+	 B0
+	  \
+	   D0---D1---D (topic)
+....
 
 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
@@ -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
 shape:
 
-			 o---B2
-			/
-	---o---o---B1--o---o---o---B (origin/master)
-		\                   \
-		 B0                  D0'--D1'--D' (topic - updated)
-		  \
-		   D0---D1---D (topic - old)
+....
+		 o---B2
+		/
+---o---o---B1--o---o---o---B (origin/master)
+	\                   \
+	 B0                  D0'--D1'--D' (topic - updated)
+	  \
+	   D0---D1---D (topic - old)
+....
 
 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
-- 
2.23.0


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH 3/7] Documentation: wrap config listings in "----"
  2019-09-07 14:12 [PATCH 0/7] Fix more AsciiDoc/tor differences Martin Ågren
  2019-09-07 14:12 ` [PATCH 1/7] Documentation: wrap blocks with "--" Martin Ågren
  2019-09-07 14:12 ` [PATCH 2/7] git-merge-base.txt: render indentations correctly under Asciidoctor Martin Ågren
@ 2019-09-07 14:12 ` Martin Ågren
  2019-09-07 14:12 ` [PATCH 4/7] git-ls-remote.txt: wrap shell listing " Martin Ågren
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 10+ messages in thread
From: Martin Ågren @ 2019-09-07 14:12 UTC (permalink / raw)
  To: git; +Cc: Jeff King

The indented lines in these example config-file listings are indented
differently by AsciiDoc and Asciidoctor.

Fix this by marking the example config-files as code listings by
wrapping them in "----". Because this gives us some extra indentation,
we can remove the one that we have been carrying explicitly. That is,
drop the first tab of indentation on each line.

With AsciiDoc, this results in identical rendering before and after this
commit. Asciidoctor now renders this the same as AsciiDoc does.

git-config.txt pretty consistently uses twelve dashes rather than the
minimum four to spell "----". Let's stick to the file-local convention
there.

Signed-off-by: Martin Ågren <martin.agren@gmail.com>
---
 Documentation/config.txt         | 84 ++++++++++++++++----------------
 Documentation/git-config.txt     | 56 +++++++++++----------
 Documentation/git-send-email.txt | 12 +++--
 Documentation/gitmodules.txt     | 15 +++---
 4 files changed, 87 insertions(+), 80 deletions(-)

diff --git a/Documentation/config.txt b/Documentation/config.txt
index 7e2a6f61f5..f7cd0ae584 100644
--- a/Documentation/config.txt
+++ b/Documentation/config.txt
@@ -164,47 +164,49 @@ to either specify only the realpath version, or both versions.
 Example
 ~~~~~~~
 
-	# Core variables
-	[core]
-		; Don't trust file modes
-		filemode = false
-
-	# Our diff algorithm
-	[diff]
-		external = /usr/local/bin/diff-wrapper
-		renames = true
-
-	[branch "devel"]
-		remote = origin
-		merge = refs/heads/devel
-
-	# Proxy settings
-	[core]
-		gitProxy="ssh" for "kernel.org"
-		gitProxy=default-proxy ; for the rest
-
-	[include]
-		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" in your `$HOME` directory
-
-	; include if $GIT_DIR is /path/to/foo/.git
-	[includeIf "gitdir:/path/to/foo/.git"]
-		path = /path/to/foo.inc
-
-	; include for all repositories inside /path/to/group
-	[includeIf "gitdir:/path/to/group/"]
-		path = /path/to/foo.inc
-
-	; include for all repositories inside $HOME/to/group
-	[includeIf "gitdir:~/to/group/"]
-		path = /path/to/foo.inc
-
-	; relative paths are always relative to the including
-	; file (if the condition is true); their location is not
-	; affected by the condition
-	[includeIf "gitdir:/path/to/group/"]
-		path = foo.inc
+----
+# Core variables
+[core]
+	; Don't trust file modes
+	filemode = false
+
+# Our diff algorithm
+[diff]
+	external = /usr/local/bin/diff-wrapper
+	renames = true
+
+[branch "devel"]
+	remote = origin
+	merge = refs/heads/devel
+
+# Proxy settings
+[core]
+	gitProxy="ssh" for "kernel.org"
+	gitProxy=default-proxy ; for the rest
+
+[include]
+	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" in your `$HOME` directory
+
+; include if $GIT_DIR is /path/to/foo/.git
+[includeIf "gitdir:/path/to/foo/.git"]
+	path = /path/to/foo.inc
+
+; include for all repositories inside /path/to/group
+[includeIf "gitdir:/path/to/group/"]
+	path = /path/to/foo.inc
+
+; include for all repositories inside $HOME/to/group
+[includeIf "gitdir:~/to/group/"]
+	path = /path/to/foo.inc
+
+; relative paths are always relative to the including
+; file (if the condition is true); their location is not
+; affected by the condition
+[includeIf "gitdir:/path/to/group/"]
+	path = foo.inc
+----
 
 Values
 ~~~~~~
diff --git a/Documentation/git-config.txt b/Documentation/git-config.txt
index ff9310f958..899e92a1c9 100644
--- a/Documentation/git-config.txt
+++ b/Documentation/git-config.txt
@@ -339,33 +339,35 @@ EXAMPLES
 
 Given a .git/config like this:
 
-	#
-	# This is the config file, and
-	# a '#' or ';' character indicates
-	# a comment
-	#
-
-	; core variables
-	[core]
-		; Don't trust file modes
-		filemode = false
-
-	; Our diff algorithm
-	[diff]
-		external = /usr/local/bin/diff-wrapper
-		renames = true
-
-	; Proxy settings
-	[core]
-		gitproxy=proxy-command for kernel.org
-		gitproxy=default-proxy ; for all the rest
-
-	; HTTP
-	[http]
-		sslVerify
-	[http "https://weak.example.com"]
-		sslVerify = false
-		cookieFile = /tmp/cookie.txt
+------------
+#
+# This is the config file, and
+# a '#' or ';' character indicates
+# a comment
+#
+
+; core variables
+[core]
+	; Don't trust file modes
+	filemode = false
+
+; Our diff algorithm
+[diff]
+	external = /usr/local/bin/diff-wrapper
+	renames = true
+
+; Proxy settings
+[core]
+	gitproxy=proxy-command for kernel.org
+	gitproxy=default-proxy ; for all the rest
+
+; HTTP
+[http]
+	sslVerify
+[http "https://weak.example.com"]
+	sslVerify = false
+	cookieFile = /tmp/cookie.txt
+------------
 
 you can set the filemode to true with
 
diff --git a/Documentation/git-send-email.txt b/Documentation/git-send-email.txt
index 504ae7fe76..b2909a3dc5 100644
--- a/Documentation/git-send-email.txt
+++ b/Documentation/git-send-email.txt
@@ -478,11 +478,13 @@ Use gmail as the smtp server
 To use 'git send-email' to send your patches through the GMail SMTP server,
 edit ~/.gitconfig to specify your account settings:
 
-	[sendemail]
-		smtpEncryption = tls
-		smtpServer = smtp.gmail.com
-		smtpUser = yourname@gmail.com
-		smtpServerPort = 587
+----
+[sendemail]
+	smtpEncryption = tls
+	smtpServer = smtp.gmail.com
+	smtpUser = yourname@gmail.com
+	smtpServerPort = 587
+----
 
 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
diff --git a/Documentation/gitmodules.txt b/Documentation/gitmodules.txt
index a66e95b70c..08c7b8a722 100644
--- a/Documentation/gitmodules.txt
+++ b/Documentation/gitmodules.txt
@@ -105,14 +105,15 @@ EXAMPLES
 
 Consider the following .gitmodules file:
 
-	[submodule "libfoo"]
-		path = include/foo
-		url = git://foo.com/git/lib.git
-
-	[submodule "libbar"]
-		path = include/bar
-		url = git://bar.com/git/lib.git
+----
+[submodule "libfoo"]
+	path = include/foo
+	url = git://foo.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
 be checked out in the paths `include/foo` and `include/bar`, and for both
-- 
2.23.0


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH 4/7] git-ls-remote.txt: wrap shell listing in "----"
  2019-09-07 14:12 [PATCH 0/7] Fix more AsciiDoc/tor differences Martin Ågren
                   ` (2 preceding siblings ...)
  2019-09-07 14:12 ` [PATCH 3/7] Documentation: wrap config listings in "----" Martin Ågren
@ 2019-09-07 14:12 ` " Martin Ågren
  2019-09-07 14:12 ` [PATCH 5/7] git-receive-pack.txt: wrap shell [script] " Martin Ågren
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 10+ messages in thread
From: Martin Ågren @ 2019-09-07 14:12 UTC (permalink / raw)
  To: git; +Cc: Jeff King

The second "column" in the output of `git ls-remote` is typeset
differently by AsciiDoc and Asciidoctor, similar to various examples
touched by the last few commits.

Fix this by marking the example shell session as a code listing by
wrapping it in "----".  Because this gives us some extra indentation, we
can remove the one that we have been carrying explicitly. That is, drop
the first tab of indentation on each line. With AsciiDoc, this results
in identical rendering before and after this commit. Asciidoctor now
renders this the same as AsciiDoc does.

Signed-off-by: Martin Ågren <martin.agren@gmail.com>
---
 Documentation/git-ls-remote.txt | 32 +++++++++++++++++---------------
 1 file changed, 17 insertions(+), 15 deletions(-)

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


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH 5/7] git-receive-pack.txt: wrap shell [script] listing in "----"
  2019-09-07 14:12 [PATCH 0/7] Fix more AsciiDoc/tor differences Martin Ågren
                   ` (3 preceding siblings ...)
  2019-09-07 14:12 ` [PATCH 4/7] git-ls-remote.txt: wrap shell listing " Martin Ågren
@ 2019-09-07 14:12 ` " Martin Ågren
  2019-09-07 14:12 ` [PATCH 6/7] git-merge-index.txt: wrap shell " Martin Ågren
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 10+ messages in thread
From: Martin Ågren @ 2019-09-07 14:12 UTC (permalink / raw)
  To: git; +Cc: Jeff King

The indented lines in the example shell script listing are indented
differently by AsciiDoc and Asciidoctor.

Fix this by marking the example shell script as a code listing by
wrapping it in "----".  Because this gives us some extra indentation, we
can remove the one that we have been carrying explicitly. That is, drop
the first tab of indentation on each line. For consistency, make the
same change to the short example shell session further down.

With AsciiDoc, this results in identical rendering before and after this
commit. Asciidoctor now renders this the same as AsciiDoc does.

Signed-off-by: Martin Ågren <martin.agren@gmail.com>
---
 Documentation/git-receive-pack.txt | 52 ++++++++++++++++--------------
 1 file changed, 28 insertions(+), 24 deletions(-)

diff --git a/Documentation/git-receive-pack.txt b/Documentation/git-receive-pack.txt
index dedf97efbb..25702ed730 100644
--- a/Documentation/git-receive-pack.txt
+++ b/Documentation/git-receive-pack.txt
@@ -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
 service:
 
-	#!/bin/sh
-	# mail out commit update information.
-	while read oval nval ref
-	do
-		if expr "$oval" : '0*$' >/dev/null
-		then
-			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
+----
+#!/bin/sh
+# mail out commit update information.
+while read oval nval ref
+do
+	if expr "$oval" : '0*$' >/dev/null
 	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
+		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
+	(
+		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
 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`
 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
-- 
2.23.0


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH 6/7] git-merge-index.txt: wrap shell listing in "----"
  2019-09-07 14:12 [PATCH 0/7] Fix more AsciiDoc/tor differences Martin Ågren
                   ` (4 preceding siblings ...)
  2019-09-07 14:12 ` [PATCH 5/7] git-receive-pack.txt: wrap shell [script] " Martin Ågren
@ 2019-09-07 14:12 ` " Martin Ågren
  2019-09-07 14:12 ` [PATCH 7/7] gitweb.conf.txt: switch pluses to backticks to help Asciidoctor Martin Ågren
  2019-09-13  4:48 ` [PATCH 0/7] Fix more AsciiDoc/tor differences Jeff King
  7 siblings, 0 replies; 10+ messages in thread
From: Martin Ågren @ 2019-09-07 14:12 UTC (permalink / raw)
  To: git; +Cc: Jeff King

The example output of `git merge-index` has been enriched by a second
"column" of helpful comments. When Asciidoctor renders this, the cells
in that second column aren't aligned.

Fix this by marking the example shell session as a code listing by
wrapping it in "----". Also drop some of the horizontal space between
the two columns so that we fit into 80 columns. This changes the
rendering with both AsciiDoc and Asciidoctor. They now render this
identically, nicely aligned, and within 80 columns.

Signed-off-by: Martin Ågren <martin.agren@gmail.com>
---
 Documentation/git-merge-index.txt | 26 +++++++++++++++-----------
 1 file changed, 15 insertions(+), 11 deletions(-)

diff --git a/Documentation/git-merge-index.txt b/Documentation/git-merge-index.txt
index 02676fb391..2ab84a91e5 100644
--- a/Documentation/git-merge-index.txt
+++ b/Documentation/git-merge-index.txt
@@ -54,20 +54,24 @@ original is first. But the argument order to the 3-way merge program
 
 Examples:
 
-  torvalds@ppc970:~/merge-test> git merge-index cat MM
-  This is MM from the original tree.			# original
-  This is modified MM in the branch A.			# merge1
-  This is modified MM in the branch B.			# merge2
-  This is modified MM in the branch B.			# current contents
+----
+torvalds@ppc970:~/merge-test> git merge-index cat MM
+This is MM from the original tree.		# original
+This is modified MM in the branch A.		# merge1
+This is modified MM in the branch B.		# merge2
+This is modified MM in the branch B.		# current contents
+----
 
 or
 
-  torvalds@ppc970:~/merge-test> git merge-index cat AA MM
-  cat: : No such file or directory
-  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
+----
+torvalds@ppc970:~/merge-test> git merge-index cat AA MM
+cat: : No such file or directory
+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
+----
 
 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
-- 
2.23.0


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH 7/7] gitweb.conf.txt: switch pluses to backticks to help Asciidoctor
  2019-09-07 14:12 [PATCH 0/7] Fix more AsciiDoc/tor differences Martin Ågren
                   ` (5 preceding siblings ...)
  2019-09-07 14:12 ` [PATCH 6/7] git-merge-index.txt: wrap shell " Martin Ågren
@ 2019-09-07 14:12 ` Martin Ågren
  2019-09-13  4:48 ` [PATCH 0/7] Fix more AsciiDoc/tor differences Jeff King
  7 siblings, 0 replies; 10+ messages in thread
From: Martin Ågren @ 2019-09-07 14:12 UTC (permalink / raw)
  To: git; +Cc: Jeff King

This paragraph uses a lot of +pluses+ to render text as monospace. That
works fine with AsciiDoc (8.6.10), and almost fine with Asciidoctor
(1.5.5), which renders the third of these literally ("+$projname+"). The
reason seems to be that Asciidoctor trips on the lone plus a bit
earlier, even though it is escaped.

Switch +$projname+ to `$projname`, and change the next, similar instance
too (+$projname/+), because otherwise, we'd trip on /that one/ instead.
If we would stop there, we would now start falling over on the escaped
plus ('\+') mentioned earlier, rendering /it/ literally. So change that
too...

In other words, unescape the lone '+' and change all the pluses that
follow it to backticks.

AsciiDoc renders this paragraph identically before and after this
commit, and Asciidoctor now renders this the same as AsciiDoc.

I did try to switch the whole paragraph to using backticks rather than
pluses. That worked great with Asciidoctor, but confused AsciiDoc...
Let's go with this rather surgical change instead.

Signed-off-by: Martin Ågren <martin.agren@gmail.com>
---
 Documentation/gitweb.conf.txt | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/Documentation/gitweb.conf.txt b/Documentation/gitweb.conf.txt
index 35317e71c8..7963a79ba9 100644
--- a/Documentation/gitweb.conf.txt
+++ b/Documentation/gitweb.conf.txt
@@ -786,9 +786,9 @@ forks::
 	subdirectories of project root (basename) to be forks of existing
 	projects.  For each project +$projname.git+, projects in the
 	+$projname/+ directory and its subdirectories will not be
-	shown in the main projects list.  Instead, a \'\+' mark is shown
-	next to +$projname+, which links to a "forks" view that lists all
-	the forks (all projects in +$projname/+ subdirectory).  Additionally
+	shown in the main projects list.  Instead, a \'+' mark is shown
+	next to `$projname`, which links to a "forks" view that lists all
+	the forks (all projects in `$projname/` subdirectory).  Additionally
 	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
-- 
2.23.0


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 0/7] Fix more AsciiDoc/tor differences
  2019-09-07 14:12 [PATCH 0/7] Fix more AsciiDoc/tor differences Martin Ågren
                   ` (6 preceding siblings ...)
  2019-09-07 14:12 ` [PATCH 7/7] gitweb.conf.txt: switch pluses to backticks to help Asciidoctor Martin Ågren
@ 2019-09-13  4:48 ` Jeff King
  2019-09-13 12:21   ` Martin Ågren
  7 siblings, 1 reply; 10+ messages in thread
From: Jeff King @ 2019-09-13  4:48 UTC (permalink / raw)
  To: Martin Ågren; +Cc: git

On Sat, Sep 07, 2019 at 04:12:46PM +0200, Martin Ågren wrote:

> This series roughly halves the line count of `./doc-diff --from-asciidoc
> --to-asciidoctor --cut-header-footer HEAD HEAD`. Together with my recent
> (independent) mini-series [1], I claim that Asciidoctor 1.5.5 now
> processes the manpages better than AsciiDoc 8.6.10 does.

I looked these over, both source and rendered output (both with asciidoc
and with asciidoctor 2.0.10), and they all look good to me.

I think the delimited literal blocks are _slightly_ less pretty than the
indented ones, but this is the solution we've been using for cross-tool
compatibility (and I think it's intentional in asciidoctor to deprecate
the indented blocks, because there are just too many corner cases). The
delimited ones are also easier to write correctly.

> Patch 6/7 actually changes the rendering with both engines, so that they
> look nice and the same. The other patches are all no-ops with one engine
> while fixing things with the other -- they all improve the situation
> with Asciidoctor (which is what I care most about) except patch 1/7
> which goes the other way (it reduces the doc-diff, which helps).

Yeah, I agree that the change in 6/7 is an improvement (and 1/7 is an
obvious bugfix looking at the doc-diff using just asciidoc).

> Patch 7/7 has an element of black magic to it. I wouldn't be too
> surprised if I've managed to appease my particular versions of these
> tools while not fixing -- or maybe even breaking? -- some other versions
> [that people actually use]. That's where I think a quick test would be
> the most valuable.

I can confirm that asciidoctor 2.0.10 has the same bogus output there
before your patches, and that 7/7 fixes it.

-Peff

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 0/7] Fix more AsciiDoc/tor differences
  2019-09-13  4:48 ` [PATCH 0/7] Fix more AsciiDoc/tor differences Jeff King
@ 2019-09-13 12:21   ` Martin Ågren
  0 siblings, 0 replies; 10+ messages in thread
From: Martin Ågren @ 2019-09-13 12:21 UTC (permalink / raw)
  To: Jeff King; +Cc: Git Mailing List

On Fri, 13 Sep 2019 at 06:48, Jeff King <peff@peff.net> wrote:
>
> On Sat, Sep 07, 2019 at 04:12:46PM +0200, Martin Ågren wrote:
>
> > This series roughly halves the line count of `./doc-diff --from-asciidoc
> > --to-asciidoctor --cut-header-footer HEAD HEAD`. Together with my recent
> > (independent) mini-series [1], I claim that Asciidoctor 1.5.5 now
> > processes the manpages better than AsciiDoc 8.6.10 does.
>
> I looked these over, both source and rendered output (both with asciidoc
> and with asciidoctor 2.0.10), and they all look good to me.

Thanks.

> I think the delimited literal blocks are _slightly_ less pretty than the
> indented ones, but this is the solution we've been using for cross-tool
> compatibility (and I think it's intentional in asciidoctor to deprecate
> the indented blocks, because there are just too many corner cases). The
> delimited ones are also easier to write correctly.

Agreed on all of this.

> > Patch 7/7 has an element of black magic to it. I wouldn't be too
> > surprised if I've managed to appease my particular versions of these
> > tools while not fixing -- or maybe even breaking? -- some other versions
> > [that people actually use]. That's where I think a quick test would be
> > the most valuable.
>
> I can confirm that asciidoctor 2.0.10 has the same bogus output there
> before your patches, and that 7/7 fixes it.

Cool. Thanks for testing it.

Martin

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, back to index

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-07 14:12 [PATCH 0/7] Fix more AsciiDoc/tor differences Martin Ågren
2019-09-07 14:12 ` [PATCH 1/7] Documentation: wrap blocks with "--" Martin Ågren
2019-09-07 14:12 ` [PATCH 2/7] git-merge-base.txt: render indentations correctly under Asciidoctor Martin Ågren
2019-09-07 14:12 ` [PATCH 3/7] Documentation: wrap config listings in "----" Martin Ågren
2019-09-07 14:12 ` [PATCH 4/7] git-ls-remote.txt: wrap shell listing " Martin Ågren
2019-09-07 14:12 ` [PATCH 5/7] git-receive-pack.txt: wrap shell [script] " Martin Ågren
2019-09-07 14:12 ` [PATCH 6/7] git-merge-index.txt: wrap shell " Martin Ågren
2019-09-07 14:12 ` [PATCH 7/7] gitweb.conf.txt: switch pluses to backticks to help Asciidoctor Martin Ågren
2019-09-13  4:48 ` [PATCH 0/7] Fix more AsciiDoc/tor differences Jeff King
2019-09-13 12:21   ` Martin Ågren

git@vger.kernel.org list mirror (unofficial, one of many)

Archives are clonable:
	git clone --mirror https://public-inbox.org/git
	git clone --mirror http://ou63pmih66umazou.onion/git
	git clone --mirror http://czquwvybam4bgbro.onion/git
	git clone --mirror http://hjrcffqmbrq6wope.onion/git

Newsgroups are available over NNTP:
	nntp://news.public-inbox.org/inbox.comp.version-control.git
	nntp://ou63pmih66umazou.onion/inbox.comp.version-control.git
	nntp://czquwvybam4bgbro.onion/inbox.comp.version-control.git
	nntp://hjrcffqmbrq6wope.onion/inbox.comp.version-control.git
	nntp://news.gmane.org/gmane.comp.version-control.git

 note: .onion URLs require Tor: https://www.torproject.org/

AGPL code for this site: git clone https://public-inbox.org/ public-inbox