git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 3/7] Documentation: wrap config listings in "----"

From
MÅMartin Ågren <martin.agren@gmail.com>
Date
Sep 7, 2019, 14:12 UTC
Message-ID
<2a8cc66dff38f3e5bf9220a06440382ae2641fea.1567707999.git.martin.agren@gmail.com>
In-Reply-To
<cover.1567707999.git.martin.agren@gmail.com>

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
Previous: Martin ÅgrenNext: Martin Ågren
Message 4 of 10 in “Fix more AsciiDoc/tor differences”
  1. 0/7 Fix more AsciiDoc/tor differencesMartin Ågren, Sep 7, 2019
  2. 4/7 git-ls-remote.txt: wrap shell listing in "----"Martin Ågren, Sep 7, 2019
  3. 1/7 Documentation: wrap blocks with "--"Martin Ågren, Sep 7, 2019
  4. 3/7 Documentation: wrap config listings in "----"Martin Ågren, Sep 7, 2019
  5. 2/7 git-merge-base.txt: render indentations correctly under AsciidoctorMartin Ågren, Sep 7, 2019
  6. 5/7 git-receive-pack.txt: wrap shell [script] listing in "----"Martin Ågren, Sep 7, 2019
  7. 7/7 gitweb.conf.txt: switch pluses to backticks to help AsciidoctorMartin Ågren, Sep 7, 2019
  8. 6/7 git-merge-index.txt: wrap shell listing in "----"Martin Ågren, Sep 7, 2019
  9. Jeff KingSep 13, 2019
  10. Martin ÅgrenSep 13, 2019

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.