Thread (23 messages) 23 messages, 6 authors, 5d ago

Re: [PATCH] doc: add more AsciiDoc cross-references

flat view

From: Junio C Hamano <hidden>
Date: 2026-09-22 20:20:25

"Julia Evans via GitGitGadget" [off-list ref] writes:
From: Julia Evans <redacted>

Instead of saying "see EXAMPLES below", say "see <<EXAMPLES,EXAMPLES>>
below" to make the man pages easier to navigate on the web.

The reason for using the more verbose <<EXAMPLES,EXAMPLES>>
(instead of <<EXAMPLES>>) is that if the header that `<<EXAMPLES>>`
is referring to is in an included page (for example `REMOTES` in the
`git-push` man page), then AsciiDoc will think it's a broken link even
though it isn't. So it's easier to just make all of the links use the
form with two parts.

Signed-off-by: Julia Evans <redacted>
---
Oh, I love a change that is so sharply focused on a single issue and
describes what the problem being solved is.
     * I tested it by running this script
       (https://gist.github.com/jvns/039c8ed0add092f2179f0dba52ebb896) which
       builds the previous and current views of all the man pages. I looked
       at the output to make sure there were no differences. You can see the
       output in that gist.
     * I believe that asciidoctor will automatically make sure that there
       are no broken links.
     * I also spot checked some of the HTML output to make sure it looked
       reasonable.
quoted hunk ↗ jump to hunk
diff --git a/Documentation/fetch-options.adoc b/Documentation/fetch-options.adoc
index 035f780e58..47dea1de8e 100644
--- a/Documentation/fetch-options.adoc
+++ b/Documentation/fetch-options.adoc
@@ -199,7 +199,7 @@ endif::git-pull[]
 	providing the tag refspec.
 ifndef::git-pull[]
 +
-See the PRUNING section below for more details.
+See the <<PRUNING,PRUNING>> section below for more details.
OK, we already see an example of the <<double,double>> reference
notation.  This needs to be in this form, intead of <<pruning>>,
because it refers to the named section of a different file, namely
git-fetch.adoc (I am just trying to make sure I understood your
explanation correctly).
quoted hunk ↗ jump to hunk
@@ -210,7 +210,7 @@ See the PRUNING section below for more details.
 	a shorthand for providing the explicit tag refspec along with
 	`--prune`, see the discussion about that in its documentation.
 +
-See the PRUNING section below for more details.
+See the <<PRUNING,PRUNING>> section below for more details.
Ditto.
quoted hunk ↗ jump to hunk
diff --git a/Documentation/git-bundle.adoc b/Documentation/git-bundle.adoc
index 03cd36fe8d..cd722bd674 100644
--- a/Documentation/git-bundle.adoc
+++ b/Documentation/git-bundle.adoc
@@ -94,7 +94,8 @@ unbundle <file>::
 
 <git-rev-list-args>::
 	A list of arguments, acceptable to 'git rev-parse' and
-	'git rev-list' (and containing a named ref, see SPECIFYING REFERENCES
+	'git rev-list' (and containing a named ref, see
+	<<SPECIFYING_REFERENCES,SPECIFYING REFERENCES>>
 	below), that specifies the specific objects and references
 	to transport.  For example, `master~10..master` causes the
 	current master reference to be packaged along with all objects
This doubled reference is more for consistency (in other words, "it
is easier to just make all of the links use the form") than the
"cross references from/to included page" we saw earlier, since ...
quoted hunk ↗ jump to hunk
@@ -127,6 +128,7 @@ unbundle <file>::
 	This flag makes the command not to report its progress
 	on the standard error stream.
 
+[[SPECIFYING_REFERENCES]]
 SPECIFYING REFERENCES
 ---------------------
... the target happens to live in the same file.  It of course
future-proofs the reference in case the section gets split out of
the file into another included one.

Thanks, will queue.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help