Skip to contentSkip to conversation

doc: add more AsciiDoc cross-references

PATCH Superseded Julia Evans via GitGitGadget 6 participants 23 messages Sep 22 – Oct 18 Documentation

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 doc: add more AsciiDoc cross-references

From: Julia Evans <[email protected]>

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.

---
doc: add more AsciiDoc cross-references

This patch is a bit long so it's hard to review manually. A few notes about testing:

* 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.

There are some inconsistencies in how the cross-references are formatted but I left in all of the inconsistencies for now because it makes it easier to test that we're not introducing mistakes.

Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-2416%2Fjvns%2Fanchors-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-2416/jvns/anchors-v1
Pull-Request: https://github.com/git/git/pull/2416

 Documentation/fetch-options.adoc              |  4 +-
 Documentation/git-add.adoc                    |  3 +-
 Documentation/git-bundle.adoc                 |  7 +-
 Documentation/git-cat-file.adoc               | 12 ++--
 Documentation/git-checkout.adoc               | 11 +--
 Documentation/git-credential-cache.adoc       |  3 +-
 Documentation/git-credential-store.adoc       |  3 +-
 Documentation/git-fast-export.adoc            |  5 +-
 Documentation/git-fast-import.adoc            |  7 +-
 Documentation/git-fetch.adoc                  |  1 +
 Documentation/git-filter-branch.adoc          |  3 +-
 Documentation/git-for-each-ref.adoc           |  4 +-
 Documentation/git-format-patch.adoc           |  4 +-
 Documentation/git-gc.adoc                     | 12 ++--
 Documentation/git-grep.adoc                   |  9 ++-
 Documentation/git-http-backend.adoc           |  6 +-
 Documentation/git-ls-files.adoc               |  8 ++-
 Documentation/git-ls-tree.adoc                |  3 +-
 Documentation/git-maintenance.adoc            |  3 +-
 Documentation/git-merge-tree.adoc             |  2 +-
 Documentation/git-notes.adoc                  | 14 ++--
 Documentation/git-p4.adoc                     | 12 ++--
 Documentation/git-pack-objects.adoc           |  5 +-
 Documentation/git-prune.adoc                  |  3 +-
 Documentation/git-push.adoc                   | 10 +--
 Documentation/git-rebase.adoc                 | 69 +++++++++++--------
 Documentation/git-replay.adoc                 |  4 +-
 Documentation/git-repo.adoc                   |  5 +-
 Documentation/git-rev-parse.adoc              |  7 +-
 Documentation/git-send-email.adoc             |  5 +-
 Documentation/git-stash.adoc                  |  3 +-
 Documentation/git-svn.adoc                    | 10 +--
 Documentation/git-worktree.adoc               |  5 +-
 Documentation/gitremote-helpers.adoc          | 15 ++--
 Documentation/gitsubmodules.adoc              |  9 ++-
 Documentation/gitworkflows.adoc               |  6 +-
 .../howto/revert-a-faulty-merge.adoc          |  5 +-
 Documentation/revisions.adoc                  |  4 +-
 38 files changed, 190 insertions(+), 111 deletions(-)
Documentation/fetch-options.adoc +2 -2
index 035f780e58..47dea1de8e 100644
@@ -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.
 
 `-P`::
 `--prune-tags`::
@@ -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.
 
 endif::git-pull[]
 
Documentation/git-add.adoc +2 -1
index 16b06e38e1..906db7ccf3 100644
@@ -117,7 +117,7 @@ The intent of this option is to pick and choose lines of the patch to
 apply, or even to modify the contents of lines to be staged. This can be
 quicker and more flexible than using the interactive hunk selector.
 However, it is easy to confuse oneself and create a patch that does not
-apply to the index. See EDITING PATCHES below.
+apply to the index. See <<EDITING_PATCHES,EDITING PATCHES>> below.
 
 `-u`::
 `--update`::
@@ -375,6 +375,7 @@ diff::
   `HEAD` and index).
 
 
+[[EDITING_PATCHES]]
 EDITING PATCHES
 ---------------
 
Documentation/git-bundle.adoc +5 -2
index 03cd36fe8d..cd722bd674 100644
@@ -43,7 +43,7 @@ header indicating what references are contained within the bundle.
 
 Like the packed archive format itself bundles can either be
 self-contained, or be created using exclusions.
-See the "OBJECT PREREQUISITES" section below.
+See the <<OBJECT_PREREQUISITES,"OBJECT PREREQUISITES">> section below.
 
 Bundles created using revision exclusions are "thin packs" created
 using the `--thin` option to linkgit:git-pack-objects[1], and
@@ -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
@@ -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
 ---------------------
 
@@ -169,6 +171,7 @@ $ git bundle create master-yesterday.bundle master~10..master~5
 fatal: Refusing to create empty bundle.
 ----------------
 
+[[OBJECT_PREREQUISITES]]
 OBJECT PREREQUISITES
 --------------------
 
Documentation/git-cat-file.adoc +7 -5
index 514bfc0032..c4ea2524cf 100644
@@ -115,7 +115,7 @@ are not of the requested type.
 --
 	* When used with `--textconv` or `--filters`, the input lines
 	  must specify the path, separated by whitespace. See the section
-	  `BATCH OUTPUT` below for details.
+	  <<BATCH_OUTPUT,`BATCH OUTPUT`>> below for details.
 
 	* When used with `--use-mailmap`, for commit and tag objects, the
 	  contents part of the output shows the identities replaced using the
@@ -133,7 +133,7 @@ are not of the requested type.
 --
 	* When used with `--textconv` or `--filters`, the input lines must
 	 specify the path, separated by whitespace. See the section
-	 `BATCH OUTPUT` below for details.
+	 <<BATCH_OUTPUT,`BATCH OUTPUT`>> below for details.
 
 	* When used with `--use-mailmap`, for commit and tag objects, the
 	  printed object information shows the size of the object as if the
@@ -149,7 +149,7 @@ are not of the requested type.
 --
 	* When used with `--textconv` or `--filters`, the input lines must
 	  specify the path, separated by whitespace. See the section
-	  `BATCH OUTPUT` below for details.
+	  <<BATCH_OUTPUT,`BATCH OUTPUT`>> below for details.
 
 	* When used with `--use-mailmap`, for commit and tag objects, the
 	  `contents` command shows the identities replaced using the
@@ -295,6 +295,7 @@ If `-p` is specified, the contents of `<object>` are pretty-printed.
 If `<type>` is specified, the raw (though uncompressed) contents of the `<object>`
 will be returned.
 
+[[BATCH_OUTPUT]]
 BATCH OUTPUT
 ------------
 
@@ -333,12 +334,12 @@ newline. The available atoms are:
 
 `objectsize:disk`::
 	The size, in bytes, that the object takes up on disk. See the
-	note about on-disk sizes in the `CAVEATS` section below.
+	note about on-disk sizes in the <<CAVEATS,`CAVEATS`>> section below.
 
 `deltabase`::
 	If the object is stored as a delta on-disk, this expands to the
 	full hex representation of the delta base object name.
-	Otherwise, expands to the null OID (all zeroes). See `CAVEATS`
+	Otherwise, expands to the null OID (all zeroes). See <<CAVEATS,`CAVEATS`>>
 	below.
 
 `rest`::
@@ -447,6 +448,7 @@ are replaced with NUL terminators. This ensures that output will be parsable if
 the output itself would contain a linefeed and is thus recommended for
 scripting purposes.
 
+[[CAVEATS]]
 CAVEATS
 -------
 
Documentation/git-checkout.adoc +7 -4
index a8b3b8c2e2..2aefea0228 100644
@@ -27,7 +27,8 @@ DESCRIPTION
 2. **Restore a different version of a file**, for example with
    `git checkout <commit> <filename>` or `git checkout <filename>`
 
-See ARGUMENT DISAMBIGUATION below for how Git decides which one to do.
+See <<ARGUMENT_DISAMBIGUATION,ARGUMENT DISAMBIGUATION>> below
+for how Git decides which one to do.
 
 `git checkout [<branch>]`::
 	Switch to _<branch>_. This sets the current branch to _<branch>_ and
@@ -68,7 +69,7 @@ uncommitted changes.
 
 	The same as `git checkout <branch>`, except that instead of pointing
 	`HEAD` at the branch, it points `HEAD` at the commit ID.
-	See the "DETACHED HEAD" section below for more.
+	See the <<DETACHED_HEAD,"DETACHED HEAD">> section below for more.
 +
 Omitting _<branch>_ detaches `HEAD` at the tip of the current branch.
 
@@ -210,8 +211,8 @@ variable.
 	Rather than checking out a branch to work on it, check out a
 	commit for inspection and discardable experiments.
 	This is the default behavior of `git checkout <commit>` when
-	_<commit>_ is not a branch name.  See the "DETACHED HEAD" section
-	below for details.
+	_<commit>_ is not a branch name.  See the
+	<<DETACHED_HEAD,"DETACHED HEAD">> section below for details.
 
 `--orphan <new-branch>`::
 	Create a new unborn branch, named _<new-branch>_, started from
@@ -372,6 +373,7 @@ leave out at most one of _<rev-a>_ and _<rev-b>_, in which case it defaults to `
 +
 For more details, see the 'pathspec' entry in linkgit:gitglossary[7].
 
+[[DETACHED_HEAD]]
 DETACHED HEAD
 -------------
 `HEAD` normally refers to a named branch (e.g. `master`). Meanwhile, each
@@ -504,6 +506,7 @@ $ git reflog -2 HEAD # or
 $ git log -g -2 HEAD
 ------------
 
+[[ARGUMENT_DISAMBIGUATION]]
 ARGUMENT DISAMBIGUATION
 -----------------------
 
Documentation/git-credential-cache.adoc +2 -1
index 54fa7a27e1..2f6395937d 100644
@@ -24,7 +24,7 @@ user by filesystem permissions.
 
 You probably don't want to invoke this command directly; it is meant to
 be used as a credential helper by other parts of Git. See
-linkgit:gitcredentials[7] or `EXAMPLES` below.
+linkgit:gitcredentials[7] or <<EXAMPLES,`EXAMPLES`>> below.
 
 OPTIONS
 -------
@@ -54,6 +54,7 @@ credentials before their timeout, you can issue an `exit` action:
 git credential-cache exit
 --------------------------------------
 
+[[EXAMPLES]]
 EXAMPLES
 --------
 
Documentation/git-credential-store.adoc +2 -1
index 71864a8726..3f8a426f93 100644
@@ -24,7 +24,7 @@ Git programs.
 
 You probably don't want to invoke this command directly; it is meant to
 be used as a credential helper by other parts of git. See
-linkgit:gitcredentials[7] or `EXAMPLES` below.
+linkgit:gitcredentials[7] or <<EXAMPLES,`EXAMPLES`>> below.
 
 OPTIONS
 -------
@@ -67,6 +67,7 @@ written to.
 
 When erasing credentials, matching credentials will be erased from all files.
 
+[[EXAMPLES]]
 EXAMPLES
 --------
 
Documentation/git-fast-export.adoc +3 -2
index 719aeca244..0c2ce385c4 100644
@@ -148,12 +148,12 @@ by keeping the marks the same across runs.
 --anonymize::
 	Anonymize the contents of the repository while still retaining
 	the shape of the history and stored tree.  See the section on
-	`ANONYMIZING` below.
+	<<ANONYMIZING,`ANONYMIZING`>> below.
 
 --anonymize-map=<from>[:<to>]::
 	Convert token `<from>` to `<to>` in the anonymized output. If
 	`<to>` is omitted, map `<from>` to itself (i.e., do not
-	anonymize it). See the section on `ANONYMIZING` below.
+	anonymize it). See the section on <<ANONYMIZING,`ANONYMIZING`>> below.
 
 --reference-excluded-parents::
 	By default, running a command such as `git fast-export
@@ -219,6 +219,7 @@ referenced by that revision range contains the string
 'refs/heads/master'.
 
 
+[[ANONYMIZING]]
 ANONYMIZING
 -----------
 
Documentation/git-fast-import.adoc +4 -3
index fd165e11d2..c5e1cec1a5 100644
@@ -31,6 +31,7 @@ imports are supported from a particular foreign source depends on
 the frontend program in use.
 
 
+[[OPTIONS]]
 OPTIONS
 -------
 
@@ -456,7 +457,7 @@ and control the current import process.  More detailed discussion
 	supports the specified feature, and aborts if it does not.
 
 `option`::
-	Specify any of the options listed under OPTIONS that do not
+	Specify any of the options listed under <<OPTIONS,OPTIONS>> that do not
 	change stream semantic to suit the frontend's needs. This
 	command is optional and is not needed to perform an import.
 
@@ -1242,7 +1243,7 @@ no-relative-marks::
 force::
 	Act as though the corresponding command-line option with
 	a leading `--` was passed on the command line
-	(see OPTIONS, above).
+	(see <<OPTIONS,OPTIONS>>, above).
 
 import-marks::
 import-marks-if-exists::
@@ -1291,7 +1292,7 @@ options the user may specify to git fast-import itself.
 ....
 
 The `<option>` part of the command may contain any of the options
-listed in the OPTIONS section that do not change import semantics,
+listed in the <<OPTIONS,OPTIONS>> section that do not change import semantics,
 without the leading `--` and is treated in the same way.
 
 Option commands must be the first commands on the input (not counting
Documentation/git-fetch.adoc +1 -0
index db03541915..61fed797af 100644
@@ -103,6 +103,7 @@ The latter use of the `remote.<repository>.fetch` values can be
 overridden by giving the `--refmap=<refspec>` parameter(s) on the
 command line.
 
+[[PRUNING]]
 PRUNING
 -------
 
Documentation/git-filter-branch.adoc +2 -1
index 5a4f853785..80a55b3706 100644
@@ -125,7 +125,7 @@ OPTIONS
 	This is the filter for rewriting the index.  It is similar to the
 	tree filter but does not check out the tree, which makes it much
 	faster.  Frequently used with `git rm --cached
-	--ignore-unmatch ...`, see EXAMPLES below.  For hairy
+	--ignore-unmatch ...`, see <<EXAMPLES,EXAMPLES>> below.  For hairy
 	cases, see linkgit:git-update-index[1].
 
 --parent-filter <command>::
@@ -243,6 +243,7 @@ rewrite, the exit status is `2`.  On any other error, the exit status may be
 any other non-zero value.
 
 
+[[EXAMPLES]]
 EXAMPLES
 --------
 
Documentation/git-for-each-ref.adoc +3 -1
index c02cb7f886..a7b31e8aaf 100644
@@ -64,7 +64,8 @@ For all objects, the following names can be used:
 `objectsize`::
 	The size of the object (the same as 'git cat-file -s' reports).
 	Append `:disk` to get the size, in bytes, that the object takes up on
-	disk. See the note about on-disk sizes in the 'CAVEATS' section below.
+	disk. See the note about on-disk sizes in the
+	<<CAVEATS,'CAVEATS'>> section below.
 `objectname`::
 	The object name (aka SHA-1).
 	For a non-ambiguous abbreviation of the object name append `:short`.
@@ -448,6 +449,7 @@ This prints the authorname, if present.
 git for-each-ref --format="%(refname)%(if)%(authorname)%(then) Authored by: %(authorname)%(end)"
 ------------
 
+[[CAVEATS]]
 CAVEATS
 -------
 
Documentation/git-format-patch.adoc +3 -1
index 191f64b77d..a78fe564f0 100644
@@ -430,7 +430,8 @@ you can use `--suffix=-patch` to get `0001-description-of-my-change-patch`.
 `--no-base`::
 `--base[=<commit>]`::
 	Record the base tree information to identify the state the
-	patch series applies to.  See the BASE TREE INFORMATION section
+	patch series applies to.  See the
+	<<BASE_TREE_INFORMATION,BASE TREE INFORMATION>> section
 	below for details. If _<commit>_ is `auto`, a base commit is
 	automatically chosen. The `--no-base` option overrides a
 	`format.useAutoBase` configuration.
@@ -702,6 +703,7 @@ This should help you to submit patches inline using KMail.
 5. Back in the compose window: add whatever other text you wish to the
    message, complete the addressing and subject fields, and press send.
 
+[[BASE_TREE_INFORMATION]]
 BASE TREE INFORMATION
 ---------------------
 
Documentation/git-gc.adoc +8 -4
index 6fed646dd8..5788a43215 100644
@@ -39,14 +39,15 @@ OPTIONS
 	space utilization and performance.  This option will cause
 	'git gc' to more aggressively optimize the repository at the expense
 	of taking much more time.  The effects of this optimization are
-	mostly persistent. See the "AGGRESSIVE" section below for details.
+	mostly persistent. See the <<AGGRESSIVE,"AGGRESSIVE">>
+	section below for details.
 
 --auto::
 	With this option, 'git gc' checks whether any housekeeping is
 	required; if not, it exits without performing any work.
 +
-See the `gc.auto` option in the "CONFIGURATION" section below for how
-this heuristic works.
+See the `gc.auto` option in the <<CONFIGURATION,"CONFIGURATION">>
+section below for how this heuristic works.
 +
 Once housekeeping is triggered by exceeding the limits of
 configuration options such as `gc.auto` and `gc.autoPackLimit`, all
@@ -83,7 +84,7 @@ be performed as well.
 	overridable by the config variable `gc.pruneExpire`).
 	--prune=now prunes loose objects regardless of their age and
 	increases the risk of corruption if another process is writing to
-	the repository concurrently; see "NOTES" below. --prune is on by
+	the repository concurrently; see <<NOTES,"NOTES">> below. --prune is on by
 	default.
 
 --no-prune::
@@ -102,6 +103,7 @@ be performed as well.
 	a single pack. When this option is used, `gc.bigPackThreshold`
 	is ignored.
 
+[[AGGRESSIVE]]
 AGGRESSIVE
 ----------
 
@@ -128,6 +130,7 @@ more time, and the resulting space/delta optimization may or may not
 be worth it. Not using this at all is the right trade-off for most
 users and their repositories.
 
+[[CONFIGURATION]]
 CONFIGURATION
 -------------
 
@@ -135,6 +138,7 @@ include::includes/cmd-config-section-all.adoc[]
 
 include::config/gc.adoc[]
 
+[[NOTES]]
 NOTES
 -----
 
Documentation/git-grep.adoc +6 -3
index 19b3ade16d..dd4a7cc9e9 100644
@@ -58,7 +58,7 @@ OPTIONS
 	in linkgit:gitglossary[7] for more information.
 +
 This option cannot be used together with `--cached` or `--untracked`.
-See also `grep.fallbackToNoIndex` in 'CONFIGURATION' below.
+See also `grep.fallbackToNoIndex` in <<CONFIGURATION,'CONFIGURATION'>> below.
 
 `--no-exclude-standard`::
 	Also search in ignored files by not honoring the `.gitignore`
@@ -256,8 +256,9 @@ providing this option will cause it to die.
 	a non-zero status.
 
 `--threads <num>`::
-	Number of `grep` worker threads to use.  See `NOTES ON THREADS`
-	and `grep.threads` in 'CONFIGURATION' for more information.
+	Number of `grep` worker threads to use. See
+	<<NOTES_ON_THREADS,`NOTES ON THREADS`>> and `grep.threads` in
+	<<CONFIGURATION,'CONFIGURATION'>> for more information.
 
 `-f <file>`::
 	Read patterns from _<file>_, one per line.
@@ -337,6 +338,7 @@ EXAMPLES
 `git grep solution -- :^Documentation`::
 	Looks for `solution`, excluding files in `Documentation`.
 
+[[NOTES_ON_THREADS]]
 NOTES ON THREADS
 ----------------
 
@@ -348,6 +350,7 @@ with multiple threads might perform slower than single-threaded if `--textconv`
 is given and there are too many text conversions.  Thus, if low performance is
 experienced in this case, it might be desirable to use `--threads=1`.
 
+[[CONFIGURATION]]
 CONFIGURATION
 -------------
 
Documentation/git-http-backend.adoc +4 -2
index 1dea426852..5fabc85d12 100644
@@ -18,7 +18,7 @@ The program supports clients fetching using both the smart HTTP protocol
 and the backwards-compatible dumb HTTP protocol, as well as clients
 pushing using the smart HTTP protocol. It also supports Git's
 more-efficient "v2" protocol if properly configured; see the
-discussion of `GIT_PROTOCOL` in the ENVIRONMENT section below.
+discussion of `GIT_PROTOCOL` in the <<ENVIRONMENT,ENVIRONMENT>> section below.
 
 It verifies that the directory has the magic file
 "git-daemon-export-ok", and it will refuse to export any Git directory
@@ -69,6 +69,7 @@ manually in the web server configuration.  If GIT_PROJECT_ROOT is not
 set, 'git http-backend' reads PATH_TRANSLATED, which is also set
 automatically by the web server.
 
+[[EXAMPLES]]
 EXAMPLES
 --------
 All of the following examples map `http://$hostname/git/foo/bar.git`
@@ -257,6 +258,7 @@ $HTTP["url"] =~ "^/git/private" {
 ----------------------------------------------------------------
 
 
+[[ENVIRONMENT]]
 ENVIRONMENT
 -----------
 'git http-backend' relies upon the `CGI` environment variables set
@@ -290,7 +292,7 @@ via the `HTTP_GIT_PROTOCOL` variable, and `git-http-backend` will
 automatically copy that to `GIT_PROTOCOL`. However, some webservers may
 be more selective about which headers they'll pass, in which case they
 need to be configured explicitly (see the mention of `Git-Protocol` in
-the Apache config from the earlier EXAMPLES section).
+the Apache config from the earlier <<EXAMPLES,EXAMPLES>> section).
 
 The backend process sets GIT_COMMITTER_NAME to '$REMOTE_USER' and
 GIT_COMMITTER_EMAIL to '$\{REMOTE_USER}@http.$\{REMOTE_ADDR\}',
Documentation/git-ls-files.adoc +5 -3
index 2b175388e1..14ebad8b71 100644
@@ -98,7 +98,7 @@ OPTIONS
 
 -z::
 	\0 line termination on output and do not quote filenames.
-	See OUTPUT below for more information.
+	See <<OUTPUT,OUTPUT>> below for more information.
 
 --deduplicate::
 	When only filenames are shown, suppress duplicates that may
@@ -110,8 +110,8 @@ OPTIONS
 -x <pattern>::
 --exclude=<pattern>::
 	Skip untracked files matching pattern.
-	Note that pattern is a shell wildcard pattern. See EXCLUDE PATTERNS
-	below for more information.
+	Note that pattern is a shell wildcard pattern.
+	See <<EXCLUDE_PATTERNS,EXCLUDE PATTERNS>> below for more information.
 
 -X <file>::
 --exclude-from=<file>::
@@ -231,6 +231,7 @@ followed by the  ("attr/<eolattr>").
 	Files to show. If no files are given all files which match the other
 	specified criteria are shown.
 
+[[OUTPUT]]
 OUTPUT
 ------
 'git ls-files' just outputs the filenames unless `--stage` is specified in
@@ -292,6 +293,7 @@ eolattr::
 path::
 	The pathname of the file which is recorded in the index.
 
+[[EXCLUDE_PATTERNS]]
 EXCLUDE PATTERNS
 ----------------
 
Documentation/git-ls-tree.adoc +2 -1
index 6572095d8d..29bde9366d 100644
@@ -54,7 +54,7 @@ OPTIONS
 
 -z::
 	\0 line termination on output and do not quote filenames.
-	See OUTPUT FORMAT below for more information.
+	See <<OUTPUT_FORMAT,OUTPUT FORMAT>> below for more information.
 
 --name-only::
 --name-status::
@@ -99,6 +99,7 @@ OPTIONS
 	implicitly uses the root level of the tree as the sole path argument.
 
 
+[[OUTPUT_FORMAT]]
 Output Format
 -------------
 
Documentation/git-maintenance.adoc +2 -1
index bda616f14c..85f208031c 100644
@@ -95,6 +95,7 @@ in that order. Otherwise, the tasks are determined by which
 `maintenance.<task>.enabled` config options are true. By default, only
 `maintenance.gc.enabled` is true.
 
+[[TASKS]]
 TASKS
 -----
 
@@ -215,7 +216,7 @@ OPTIONS
 	specified tasks in the specified order. If no `--task=<task>`
 	arguments are specified, then only the tasks with
 	`maintenance.<task>.enabled` configured as `true` are considered.
-	See the 'TASKS' section for the list of accepted `<task>` values.
+	See the <<TASKS,'TASKS'>> section for the list of accepted `<task>` values.
 
 --scheduler=auto|crontab|systemd-timer|launchctl|schtasks::
 	When combined with the `start` subcommand, specify the scheduler
Documentation/git-merge-tree.adoc +1 -1
index 4391bbee47..c5351f9699 100644
@@ -35,7 +35,7 @@ linkgit:git-merge[1], including:
   * etc.
 
 After the merge completes, a new toplevel tree object is created.  See
-`OUTPUT` below for details.
+<<OUTPUT,`OUTPUT`>> below for details.
 
 OPTIONS
 -------
Documentation/git-notes.adoc +10 -4
index 46a232ca71..22d59ada86 100644
@@ -28,8 +28,9 @@ Adds, removes, or reads notes attached to objects, without touching
 the objects themselves.
 
 By default, notes are saved to and read from `refs/notes/commits`, but
-this default can be overridden.  See the OPTIONS, CONFIGURATION, and
-ENVIRONMENT sections below.  If this ref does not exist, it will be
+this default can be overridden.  See the <<OPTIONS,OPTIONS>>,
+<<CONFIGURATION,CONFIGURATION>>, and <<ENVIRONMENT,ENVIRONMENT>>
+sections below. If this ref does not exist, it will be
 quietly created when it is first needed to store a note.
 
 A typical use of notes is to supplement a commit message without
@@ -114,7 +115,8 @@ line.
 	any) into the current notes ref (called "local").
 +
 If conflicts arise and a strategy for automatically resolving
-conflicting notes (see the "NOTES MERGE STRATEGIES" section) is not given,
+conflicting notes (see the
+<<NOTES_MERGE_STRATEGIES,"NOTES MERGE STRATEGIES">> section) is not given,
 the `manual` resolver is used. This resolver checks out the
 conflicting notes in a special worktree (`.git/NOTES_MERGE_WORKTREE`),
 and instructs the user to manually resolve the conflicts there.
@@ -139,6 +141,7 @@ the command line.
 	Print the current notes ref. This provides an easy way to
 	retrieve the current notes ref (e.g. from scripts).
 
+[[OPTIONS]]
 OPTIONS
 -------
 `-f`::
@@ -225,7 +228,8 @@ future.
 	strategy. The following strategies are recognized: `manual`
 	(default), `ours`, `theirs`, `union` and `cat_sort_uniq`.
 	This option overrides the `notes.mergeStrategy` configuration setting.
-	See the "NOTES MERGE STRATEGIES" section below for more
+	See the <<NOTES_MERGE_STRATEGIES,"NOTES MERGE STRATEGIES">>
+	section below for more
 	information on each notes merge strategy.
 
 `--commit`::
@@ -278,6 +282,7 @@ object, in which case the history of the notes can be read with
 `git log -p -g <refname>`.
 
 
+[[NOTES_MERGE_STRATEGIES]]
 NOTES MERGE STRATEGIES
 ----------------------
 
@@ -361,6 +366,7 @@ include::includes/cmd-config-section-rest.adoc[]
 include::config/notes.adoc[]
 
 
+[[ENVIRONMENT]]
 ENVIRONMENT
 -----------
 
Documentation/git-p4.adoc +8 -4
index 59edd24134..acf14cd03d 100644
@@ -119,7 +119,8 @@ importing directly from p4 is considerably slower than pulling changes
 from a Git remote, this can be useful in a multi-developer environment.
 
 If there are multiple branches, doing 'git p4 sync' will automatically
-use the "BRANCH DETECTION" algorithm to try to partition new changes
+use the <<BRANCH_DETECTION,"BRANCH DETECTION">> algorithm
+to try to partition new changes
 into the right branch.  This can be overridden with the `--branch`
 option to specify just a single branch to update.
 
@@ -245,7 +246,7 @@ Git repository:
 
 --detect-branches::
 	Use the branch detection algorithm to find new paths in p4.  It is
-	documented below in "BRANCH DETECTION".
+	documented below in <<BRANCH_DETECTION,"BRANCH DETECTION">>.
 
 --changesfile <file>::
 	Import exactly the p4 change numbers listed in 'file', one per
@@ -297,7 +298,7 @@ Git repository:
 
 --use-client-spec::
 	Use a client spec to find the list of interesting files in p4.
-	See the "CLIENT SPEC" section below.
+	See the <<CLIENT_SPEC,"CLIENT SPEC">> section below.
 
 -/ <path>::
 	Exclude selected depot paths when cloning or syncing.
@@ -475,6 +476,7 @@ p4 revision specifier on the end:
 See 'p4 help revisions' for the full syntax of p4 revision specifiers.
 
 
+[[CLIENT_SPEC]]
 CLIENT SPEC
 -----------
 The p4 client specification is maintained with the 'p4 client' command
@@ -505,6 +507,7 @@ normal p4 mechanisms of determining the client are used:  environment
 variable `P4CLIENT`, a file referenced by `P4CONFIG`, or the local host name.
 
 
+[[BRANCH_DETECTION]]
 BRANCH DETECTION
 ----------------
 P4 does not have the same concept of a branch as Git.  Instead,
@@ -643,7 +646,8 @@ git-p4.labelImportRegexp::
 git-p4.useClientSpec::
 	Specify that the p4 client spec should be used to identify p4
 	depot paths of interest.  This is equivalent to specifying the
-	option `--use-client-spec`.  See the "CLIENT SPEC" section above.
+	option `--use-client-spec`.
+	See the <<CLIENT_SPEC,"CLIENT SPEC">> section above.
 	This variable is a boolean, not the name of a p4 client.
 
 git-p4.pathEncoding::
Documentation/git-pack-objects.adoc +3 -2
index 65cd00c152..ccad938c5b 100644
@@ -363,8 +363,8 @@ raise an error.
 	Keep unreachable objects in loose form. This implies `--revs`.
 
 --delta-islands::
-	Restrict delta matches based on "islands". See DELTA ISLANDS
-	below.
+	Restrict delta matches based on "islands".
+	See <<DELTA_ISLANDS,DELTA ISLANDS>> below.
 
 --name-hash-version=<n>::
 	While performing delta compression, Git groups objects that may be
@@ -411,6 +411,7 @@ request. The `--path-walk` option supports the `--filter=<spec>` forms
 `combine:<spec>+<spec>` form.
 
 
+[[DELTA_ISLANDS]]
 DELTA ISLANDS
 -------------
 
Documentation/git-prune.adoc +2 -1
index 9a45571b90..d7836e625f 100644
@@ -15,7 +15,7 @@ DESCRIPTION
 -----------
 
 NOTE: In most cases, users should run 'git gc', which calls
-'git prune'. See the section "NOTES", below.
+'git prune'. See the section <<NOTES,"NOTES">>, below.
 
 This runs 'git fsck --unreachable' using all the refs
 available in `refs/`, optionally with an additional set of
@@ -67,6 +67,7 @@ borrows from your repository via its
 $ git prune $(cd ../another && git rev-parse --all)
 ------------
 
+[[NOTES]]
 NOTES
 -----
 
Documentation/git-push.adoc +6 -4
index aa221c3909..e5b1023855 100644
@@ -132,7 +132,8 @@ as well as various other special refspec forms:
     linkgit:git-config[1]) suggest what refs/ namespace you may have
     wanted to push to.
 
-Not all updates are allowed: see PUSH RULES below for the details.
+Not all updates are allowed: see
+<<PUSH_RULES,PUSH RULES>> below for the details.
 
 `--all`::
 `--branches`::
@@ -337,9 +338,9 @@ allowing a forced update.
 	Usually, `git push` will refuse to update a branch that is not an
 	ancestor of the commit being pushed.
 +
-This flag disables that check, the other safety checks in PUSH RULES
-below, and the checks in `--force-with-lease`. It can cause the remote
-repository to lose commits; use it with care.
+This flag disables that check, the other safety checks in
+<<PUSH_RULES,PUSH RULES>> below, and the checks in `--force-with-lease`.
+It can cause the remote repository to lose commits; use it with care.
 +
 Note that `--force` applies to all the refs that are pushed, hence
 using it with `push.default` set to `matching` or with multiple push
@@ -568,6 +569,7 @@ reason::
 	refs, no explanation is needed. For a failed ref, the reason for
 	failure is described.
 
+[[PUSH_RULES]]
 PUSH RULES
 ----------
 
Documentation/git-rebase.adoc +40 -29

261 lines not on this page · raw message

Documentation/git-replay.adoc +2 -2
index 58b4c0c470..f3ac875bb7 100644
@@ -20,7 +20,7 @@ the working tree and the index untouched. By default, updates the
 relevant references using an atomic transaction (all refs update or
 none). Use `--ref-action=print` to avoid automatic ref updates and
 instead get update commands that can be piped to `git update-ref --stdin`
-(see the <<output,OUTPUT>> section below).
+(see the <<OUTPUT,OUTPUT>> section below).
 
 THIS COMMAND IS EXPERIMENTAL. THE BEHAVIOR MAY CHANGE.
 
@@ -118,7 +118,7 @@ behavior of git-rebase(1)'s `--no-rebase-merges` option.)
 :git-replay: 1
 include::rev-list-options.adoc[]
 
-[[output]]
+[[OUTPUT]]
 OUTPUT
 ------
 
Documentation/git-repo.adoc +3 -2
index ed7d80c690..cb8c1e7292 100644
@@ -22,8 +22,8 @@ COMMANDS
 --------
 `info [--format=(lines|nul) | -z] [--all | <key>...]`::
 	Retrieve metadata-related information about the current repository. Only
-	the requested data will be returned based on their keys (see "INFO KEYS"
-	section below).
+	the requested data will be returned based on their keys
+	(see <<INFO_KEYS,"INFO KEYS">> section below).
 +
 The values are returned in the same order in which their respective keys were
 requested. The `--all` flag requests the values for all the available keys.
@@ -89,6 +89,7 @@ supported:
 +
 `-z` is an alias for `--format=nul`.
 
+[[INFO_KEYS]]
 INFO KEYS
 ---------
 In order to obtain a set of values from `git repo info`, you should provide
Documentation/git-rev-parse.adoc +5 -2
index 5398691f3f..a6d4289e28 100644
@@ -38,12 +38,13 @@ Operation Modes
 Each of these options must appear first on the command line.
 
 --parseopt::
-	Use 'git rev-parse' in option parsing mode (see PARSEOPT section below).
+	Use 'git rev-parse' in option parsing mode
+	(see <<PARSEOPT,PARSEOPT>> section below).
 	The command in this mode can be used outside a repository or
 	a working tree controlled by a repository.
 
 --sq-quote::
-	Use 'git rev-parse' in shell quoting mode (see SQ-QUOTE
+	Use 'git rev-parse' in shell quoting mode (see <<SQ_QUOTE,SQ-QUOTE>>
 	section below). In contrast to the `--sq` option below, this
 	mode only does quoting. Nothing else is done to command input.
 	The command in this mode can be used outside a repository or
@@ -354,6 +355,7 @@ Other Options
 
 include::revisions.adoc[]
 
+[[PARSEOPT]]
 PARSEOPT
 --------
 
@@ -460,6 +462,7 @@ An option group Header
     -C[...]               option C with an optional argument
 ------------
 
+[[SQ_QUOTE]]
 SQ-QUOTE
 --------
 
Documentation/git-send-email.adoc +3 -2
index 5c9ab39944..4a5e0c359f 100644
@@ -50,7 +50,7 @@ Composing
 
 `--annotate`::
 	Review and edit each patch you're about to send. Default is the value
-	of `sendemail.annotate`. See the CONFIGURATION section for
+	of `sendemail.annotate`. See the <<CONFIGURATION,CONFIGURATION>> section for
 	`sendemail.multiEdit`.
 
 `--bcc=<address>,...`::
@@ -78,7 +78,7 @@ removed.
 +
 Missing `From` or `In-Reply-To` headers will be prompted for.
 +
-See the CONFIGURATION section for `sendemail.multiEdit`.
+See the <<CONFIGURATION,CONFIGURATION>> section for `sendemail.multiEdit`.
 
 `--from=<address>`::
 	Specify the sender of the emails.  If not specified on the command line,
@@ -559,6 +559,7 @@ Information
 	address to standard output, one per line. See `sendemail.aliasFile`
 	for more information about aliases.
 
+[[CONFIGURATION]]
 CONFIGURATION
 -------------
 
Documentation/git-stash.adoc +2 -1
index fc6a9a008c..d6e8c4144c 100644
@@ -133,7 +133,7 @@ with no conflicts.
 `clear`::
 	Remove all the stash entries. Note that those entries will then
 	be subject to pruning, and may be impossible to recover (see
-	'EXAMPLES' below for a possible strategy).
+	<<EXAMPLES,'EXAMPLES'>> below for a possible strategy).
 
 `drop [-q | --quiet] [<stash>]`::
 	Remove a single stash entry from the list of stash entries.
@@ -315,6 +315,7 @@ of the index, and `W` is a commit that records the state of the working
 tree.
 
 
+[[EXAMPLES]]
 EXAMPLES
 --------
 
Documentation/git-svn.adoc +6 -4
index 2a7fa60465..baaf3bff4e 100644
@@ -126,7 +126,7 @@ your Perl's Getopt::Long is < v2.37).
 	command-line argument.
 +
 This automatically updates the rev_map if needed (see
-'$GIT_DIR/svn/\**/.rev_map.*' in the FILES section below for details).
+'$GIT_DIR/svn/\**/.rev_map.*' in the <<FILES,FILES>> section below for details).
 
 --localtime;;
 	Store Git commit times in the local time zone instead of UTC.  This
@@ -239,7 +239,7 @@ Like 'git rebase'; this requires that the working tree be clean
 and have no uncommitted changes.
 +
 This automatically updates the rev_map if needed (see
-'$GIT_DIR/svn/\**/.rev_map.*' in the FILES section below for details).
+'$GIT_DIR/svn/\**/.rev_map.*' in the <<FILES,FILES>> section below for details).
 
 -l;;
 --local;;
@@ -524,7 +524,7 @@ This will set the property 'svn:keywords' to 'FreeBSD=%H' for the file
 	way to repair the repo is to use 'reset'.
 +
 Only the rev_map and refs/remotes/git-svn are changed (see
-'$GIT_DIR/svn/\**/.rev_map.*' in the FILES section below for details).
+'$GIT_DIR/svn/\**/.rev_map.*' in the <<FILES,FILES>> section below for details).
 Follow 'reset' with a 'fetch' and then 'git reset' or 'git rebase' to
 move local branches onto the new tree.
 
@@ -946,7 +946,7 @@ copy history (including branches and tags) for repositories adopting a
 standard layout, it cannot yet represent merge history that happened
 inside git back upstream to SVN users.  Therefore it is advised that
 users keep history as linear as possible inside Git to ease
-compatibility with SVN (see the CAVEATS section below).
+compatibility with SVN (see the <<CAVEATS,CAVEATS>> section below).
 
 HANDLING OF SVN BRANCHES
 ------------------------
@@ -994,6 +994,7 @@ to r.199 (one containing trunk/, one containing trunk/sub/). Finally,
 it will create a branch 'sub@200' pointing to the new parent commit of
 branch 'sub' (i.e. the commit for r.200 and trunk/sub/).
 
+[[CAVEATS]]
 CAVEATS
 -------
 
@@ -1135,6 +1136,7 @@ or tag has appeared. If the subset of branches or tags is changed after
 fetching, then $GIT_DIR/svn/.metadata must be manually edited to remove
 (or reset) branches-maxRev and/or tags-maxRev as appropriate.
 
+[[FILES]]
 FILES
 -----
 $GIT_DIR/svn/\**/.rev_map.*::
Documentation/git-worktree.adoc +3 -2
index 32787eacc3..e6e77252ab 100644
@@ -50,8 +50,8 @@ at the same commit as the current branch.
 
 If a working tree is deleted without using `git worktree remove`, then
 its associated administrative files, which reside in the repository
-(see "DETAILS" below), will eventually be removed automatically (see
-`gc.worktreePruneExpire` in linkgit:git-config[1]), or you can run
+(see <<DETAILS,"DETAILS">> below), will eventually be removed automatically
+(see `gc.worktreePruneExpire` in linkgit:git-config[1]), or you can run
 `git worktree prune` in the main or any linked worktree to clean up any
 stale administrative files.
 
@@ -360,6 +360,7 @@ share to all worktrees:
 See the documentation of `extensions.worktreeConfig` in
 linkgit:git-config[1] for more details.
 
+[[DETAILS]]
 DETAILS
 -------
 Each linked worktree has a private sub-directory in the repository's
Documentation/gitremote-helpers.adoc +10 -5
index 39cdece16e..4d794f32ad 100644
@@ -86,7 +86,7 @@ Capabilities
 
 Each remote helper is expected to support only a subset of commands.
 The operations a helper supports are declared to Git in the response
-to the `capabilities` command (see COMMANDS, below).
+to the `capabilities` command (see <<COMMANDS,COMMANDS>>, below).
 
 In the following, we list all defined capabilities and for
 each we list which commands a helper with that capability
@@ -124,7 +124,7 @@ Supported commands: 'list for-push', 'export'.
 
 If a helper advertises 'connect', Git will use it if possible and
 fall back to another capability if the helper requests so when
-connecting (see the 'connect' command under COMMANDS).
+connecting (see the 'connect' command under <<COMMANDS,COMMANDS>>).
 When choosing between 'push' and 'export', Git prefers 'push'.
 Other frontends may have some other order of preference.
 
@@ -173,7 +173,7 @@ Supported commands: 'list', 'import'.
 
 If a helper advertises 'connect', Git will use it if possible and
 fall back to another capability if the helper requests so when
-connecting (see the 'connect' command under COMMANDS).
+connecting (see the 'connect' command under <<COMMANDS,COMMANDS>>).
 When choosing between 'fetch' and 'import', Git prefers 'fetch'.
 Other frontends may have some other order of preference.
 
@@ -246,6 +246,7 @@ the remote repository.
 	side using an explicit hash algorithm extension.
 
 
+[[COMMANDS]]
 COMMANDS
 --------
 
@@ -269,8 +270,10 @@ Support for this command is mandatory.
 	unrecognized attributes are ignored. The list ends with a
 	blank line.
 +
-See REF LIST ATTRIBUTES for a list of currently defined attributes.
-See REF LIST KEYWORDS for a list of currently defined keywords.
+See <<REF_LIST_ATTRIBUTES,REF LIST ATTRIBUTES>> for a list of currently
+defined attributes.
+See <<REF_LIST_KEYWORDS,REF LIST KEYWORDS>> for a list of currently
+defined keywords.
 +
 Supported if the helper has the "fetch" or "import" capability.
 
@@ -435,6 +438,7 @@ completing a valid response for the current command.
 Additional commands may be supported, as may be determined from
 capabilities reported by the helper.
 
+[[REF_LIST_ATTRIBUTES]]
 REF LIST ATTRIBUTES
 -------------------
 
@@ -446,6 +450,7 @@ attributes are defined.
 	This ref is unchanged since the last import or fetch, although
 	the helper cannot necessarily determine what value that produced.
 
+[[REF_LIST_KEYWORDS]]
 REF LIST KEYWORDS
 -----------------
 
Documentation/gitsubmodules.adoc +6 -3
index 2082296199..8e8165637b 100644
@@ -21,7 +21,8 @@ A submodule is a repository embedded inside another repository.
 The submodule has its own history; the repository it is embedded
 in is called a superproject.
 
-On the filesystem, a submodule usually (but not always - see FORMS below)
+On the filesystem, a submodule usually
+(but not always - see <<FORMS,FORMS>> below)
 consists of (i) a Git directory located under the `$GIT_DIR/modules/`
 directory of its superproject, (ii) a working directory inside the
 superproject's working directory, and a `.git` file at the root of
@@ -102,8 +103,8 @@ remotes are configured in the submodule as usual in the `$GIT_DIR/config`
 file.
 
  * The configuration file `$GIT_DIR/config` in the superproject.
-   Git only recurses into active submodules (see "ACTIVE SUBMODULES"
-   section below).
+   Git only recurses into active submodules
+   (see <<ACTIVE_SUBMODULES,"ACTIVE SUBMODULES">> section below).
 +
 If the submodule is not yet initialized, then the configuration
 inside the submodule does not exist yet, so where to
@@ -122,6 +123,7 @@ If the submodule has never been initialized, this is the only place
 where submodule configuration is found. It serves as the last fallback
 to specify where to obtain the submodule from.
 
+[[FORMS]]
 FORMS
 -----
 
@@ -165,6 +167,7 @@ from another repository.
 To completely remove a submodule, manually delete
 `$GIT_DIR/modules/<name>/`.
 
+[[ACTIVE_SUBMODULES]]
 ACTIVE SUBMODULES
 -----------------
 
Documentation/gitworkflows.adoc +4 -2
index 59305265c5..4a4aea9fb4 100644
@@ -245,8 +245,9 @@ tag to the tip of 'master' indicating the release version:
 `git tag -s -m "Git X.Y.Z" vX.Y.Z master`
 =====================================
 
-You need to push the new tag to a public Git server (see
-"DISTRIBUTED WORKFLOWS" below). This makes the tag available to
+You need to push the new tag to a public Git server
+(see <<DISTRIBUTED_WORKFLOWS,"DISTRIBUTED WORKFLOWS">> below).
+This makes the tag available to
 others tracking your project. The push could also trigger a
 post-update hook to perform release-related items such as building
 release tarballs and preformatted documentation pages.
@@ -324,6 +325,7 @@ announcement is not necessary since 'seen' is a throw-away branch, as
 described above.
 
 
+[[DISTRIBUTED_WORKFLOWS]]
 DISTRIBUTED WORKFLOWS
 ---------------------
 
Documentation/howto/revert-a-faulty-merge.adoc +3 -2
index 19f59cc888..fc9a330e9c 100644
@@ -146,8 +146,8 @@ different resolution strategies:
    revert of a merge was rebuilt from scratch (i.e. rebasing and fixing,
    as you seem to have interpreted), then re-merging the result without
    doing anything else fancy would be the right thing to do.
-   (See the ADDENDUM below for how to rebuild a branch from scratch
-   without changing its original branching-off point.)
+   (See the <<ADDENDUM,ADDENDUM>> below for how to rebuild a branch
+   from scratch without changing its original branching-off point.)
 
 However, there are things to keep in mind when reverting a merge (and
 reverting such a revert).
@@ -184,6 +184,7 @@ ready yet, and I really need to undo _all_ of the merge"). So then you
 really should revert the merge, but when you want to re-do the merge, you
 now need to do it by reverting the revert.
 
+[[ADDENDUM]]
 ADDENDUM
 
 Sometimes you have to rewrite one of a topic branch's commits *and* you can't
Documentation/revisions.adoc +3 -1
index 3fbfbd3d5f..3bb6dc85b6 100644
@@ -1,3 +1,4 @@
+[[SPECIFYING_REVISIONS]]
 SPECIFYING REVISIONS
 --------------------
 
@@ -300,7 +301,8 @@ Dotted Range Notations
 The '..' (two-dot) Range Notation::
  The '{caret}r1 r2' set operation appears so often that there is a shorthand
  for it.  When you have two commits 'r1' and 'r2' (named according
- to the syntax explained in SPECIFYING REVISIONS above), you can ask
+ to the syntax explained in
+<<SPECIFYING_REVISIONS,SPECIFYING REVISIONS>> above), you can ask
  for commits that are reachable from r2 excluding those that are reachable
  from r1 by '{caret}r1 r2' and it can be written as 'r1..r2'.
 

base-commit: 3bc0341126508f78f5869cbfc0005e987efdf0c7

Signature · 1 line
gitgitgadget
#1 lore raw
Quoted 12 lines · Julia Evans via GitGitGadget

From: Julia Evans <[email protected]>

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.

Quoted 2 lines

---

Oh, I love a change that is so sharply focused on a single issue and describes what the problem being solved is.

Quoted 15 lines

* 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.

Documentation/fetch-options.adoc +0 -0
index 035f780e58..47dea1de8e 100644

Documentation/fetch-options.adoc endif::git-pull[] · line 202

Quoted 5 lines
Documentation/fetch-options.adoc +1 -1
@@ -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).

Documentation/fetch-options.adoc See the PRUNING section below for more details. · line 213

Quoted 6 lines
Documentation/fetch-options.adoc +1 -1
@@ -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 5 lines
Documentation/git-bundle.adoc +0 -0
index 03cd36fe8d..cd722bd674 100644

Documentation/git-bundle.adoc unbundle <file>:: · line 101

Quoted 9 lines
Documentation/git-bundle.adoc +2 -1
@@ -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 ...

Documentation/git-bundle.adoc unbundle <file>:: · line 133

Quoted 7 lines
Documentation/git-bundle.adoc +1 -0
@@ -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.

#2 lore raw
Quoted 3 lines

Oh, I love a change that is so sharply focused on a single issue and describes what the problem being solved is.

:)

Quoted 10 lines
Quoted 9 lines

* 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 16 lines

Documentation/fetch-options.adoc endif::git-pull[] · line 202

Quoted 10 lines
Documentation/fetch-options.adoc +1 -1
index 035f780e58..47dea1de8e 100644
@@ -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).

The reason I explained this in a bit of a confusing way is that I'm not 100% sure in which exact cases we need to use <<double,double> instead of <<single>.

I double checked just now that if in git-push.adoc, I change:

of a remote (see the section <<REMOTES,REMOTES>> below),

to:

of a remote (see the section <<REMOTES>> below),

Then there's a problem where in the HTML version it displays as "[REMOTES]" instead of just "REMOTES".

But in the <<PRUNING,PRUNING>> example, just using <<PRUNING>> seems to work. I started working on this way back in December 2025 so I assume that something in this patch was affected by this issue and that's how I came across this problem but I'm not sure exactly what it was.

#3 lore raw
Quoted 14 lines · Julia Evans
Quoted 7 lines
Quoted 1 line

+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).

The reason I explained this in a bit of a confusing way is that I'm not 100% sure in which exact cases we need to use <<double,double> instead of <<single>.

I double checked just now that if in git-push.adoc, I change:

Quoted 8 lines

of a remote (see the section <<REMOTES,REMOTES>> below),

to:

of a remote (see the section <<REMOTES>> below),

Then there's a problem where in the HTML version it displays as "[REMOTES]" instead of just "REMOTES".

Reading the asciidoc docs, I'm not sure how this is affected by the location of the reference at all. AFAICT the syntax <<FOO,BAR>> just means "link to FOO, using the text BAR".

The single-item <<FOO>> more or less means the same as "<<FOO,FOO>>", but as you noticed, vanilla asciidoc seems to pick the text "[FOO]" here, whereas asciidoctor uses "FOO". I'm using asciidoc 10.2.1 and asciidoctor 2.0.26 to test, and I see it even with the PRUNING examples, too.

Even weirder, in the manpage output both implementations actually expand this to: the section called "FOO". So changing your patch like this:

-See the <<PRUNING,PRUNING>> section below for more details. +See the <<PRUNING>> section below for more details.

gives doc-diff output like this:

- See the PRUNING section below for more details.
+ See the the section called “PRUNING” section below for more details.

which is obviously nonsense.

I could very well believe that some older versions did other weird things in the presence of includes. ;) But AFAICT the real need for the doubled text is to control what is in the expanded text (both because of differences between the versions, but also differences in output backends).

Which is kind of a shame, because writing just <<PRUNING>> makes the source a lot more readable. I wonder if we can configure these text fallbacks, which would let us use the single-item form reliably.

Alternatively, I think this is all syntactic sugar over "xref:FOO[BAR]". We already have our own linkgit: macro for linking to whole pages (which, btw, is something xref could do for us, too, though maybe not without the magic man section number). I wonder if it would be useful to have a section-link macro that would give us more control, but again, the syntax of <<PRUNING>> sure is nice.

Quoted 5 lines

But in the <<PRUNING,PRUNING>> example, just using <<PRUNING>> seems to work. I started working on this way back in December 2025 so I assume that something in this patch was affected by this issue and that's how I came across this problem but I'm not sure exactly what it was.

So I think using <<PRUNING,PRUNING>> is probably OK for a first pass here, rather than getting bogged down in trying to configure both asciidoc implementations. We can shrink them later if we come up with a good solution.

I do think the explanation in the commit message might be misleading, though (at least from what I can gather from the asciidoc reference and from a few experiments).

-Peff

#4 lore raw
Quoted 20 lines

Even weirder, in the manpage output both implementations actually expand this to: the section called "FOO". So changing your patch like this:

-See the <<PRUNING,PRUNING>> section below for more details. +See the <<PRUNING>> section below for more details.

gives doc-diff output like this:

- See the PRUNING section below for more details.
+ See the the section called “PRUNING” section below for more details.

which is obviously nonsense.

I could very well believe that some older versions did other weird things in the presence of includes. ;) But AFAICT the real need for the doubled text is to control what is in the expanded text (both because of differences between the versions, but also differences in output backends).

Quoted 3 lines

Which is kind of a shame, because writing just <<PRUNING>> makes the source a lot more readable. I wonder if we can configure these text fallbacks, which would let us use the single-item form reliably.

Thanks for investigating, I was really dreading looking into the guts of asciidoc to figure out exactly what was happening. It would be nice to be able to write just <<PRUNING>>, especially because I believe asciidoctor will check that internal links are valid, so there's no concern about breaking links if we change the title of a section.

Re your other message about breaking links because we're changing the HTML IDs: the options I see right now are

1. Leave it is as is and break some links
2. manually enter the ID like _editing_patches, trying to make sure to always match the auto-generated ID (I'm not sure how to do that). I think this might also cause some confusion for editors in the future as to why the section IDs are formatted like that
3. Somehow fix it so that we can just do <<PRUNING>>

I'm not sure if #1 or #2 is better, obviously I'm biased towards #1 because it's less work for me. #3 seems like the ideal but I don't know how to do that.

Here's a revised commit message, can submit that as a v2 if it seems correct.

doc: add more AsciiDoc cross-references

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 in some cases, the HTML output is rendered as "EXAMPLES" or [EXAMPLES] instead of just EXAMPLES. So this gives us more control over how the output looks.

This also changes some of the HTML IDs of the headings from _examples to EXAMPLES, which has the potential to break some links.

#5 lore raw
Quoted 5 lines · Julia Evans

Thanks for investigating, I was really dreading looking into the guts of asciidoc to figure out exactly what was happening. It would be nice to be able to write just <<PRUNING>>, especially because I believe asciidoctor will check that internal links are valid, so there's no concern about breaking links if we change the title of a section.

I think asciidoc(tor) doesn't do it itself, so HTML will be generated with a broken link. But in the manpage flow, we pass through xml docbook, which does complain loudly. So that will be enough to let us know about the breakage.

Quoted 9 lines

1. Leave it is as is and break some links
2. manually enter the ID like _editing_patches, trying to make sure to always match the auto-generated ID (I'm not sure how to do that). I think this might also cause some confusion for editors in the future as to why the section IDs are formatted like that
3. Somehow fix it so that we can just do <<PRUNING>>

I'm not sure if #1 or #2 is better, obviously I'm biased towards #1 because it's less work for me. #3 seems like the ideal but I don't know how to do that.

Yeah, sorry I was a bit rambly in my other message, but I think #1 is OK. I'm not sure if asciidoctor allows us to configure the algorithm for converting a title into a section id. If it does, it might be nice to have a flag day where we make all of the auto-ids look like what we'd expect. But that is a totally separate topic, and can happen later.

I think #3 is sort-of orthogonal, as I couldn't get the "natural" xrefs to work. So we have to either declare the ids ourselves or use the auto-generated ones, at which point the use of single- or double- <<FOO>> xrefs is purely a matter for the linking site, not the linked-to section.

Quoted 7 lines

Here's a revised commit message, can submit that as a v2 if it seems correct.

doc: add more AsciiDoc cross-references

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

Quoted 7 lines

The reason for using the more verbose <<EXAMPLES,EXAMPLES>> (instead of <<EXAMPLES>>) is in some cases, the HTML output is rendered as "EXAMPLES" or [EXAMPLES] instead of just EXAMPLES. So this gives us more control over how the output looks.

This also changes some of the HTML IDs of the headings from _examples to EXAMPLES, which has the potential to break some links.

Yeah, I think this is OK. If we want to be really pedantic, the "EXAMPLES" with quotes is only in the manpages, not the HTML (and also includes extra text: "the section called"). But the point is the same. We must use the doubled form to get consistent text output.

-Peff

#6 lore raw
In reply to Julia Evans
Quoted 7 lines · Julia Evans

Here's a revised commit message, can submit that as a v2 if it seems correct.

doc: add more AsciiDoc cross-references

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

Quoted 7 lines

The reason for using the more verbose <<EXAMPLES,EXAMPLES>> (instead of <<EXAMPLES>>) is in some cases, the HTML output is rendered as "EXAMPLES" or [EXAMPLES] instead of just EXAMPLES. So this gives us more control over how the output looks.

This also changes some of the HTML IDs of the headings from _examples to EXAMPLES, which has the potential to break some links.

To see if I understand correctly, let me rephrase the second paragraph a bit (not as an attempt to offer an improvement; by restating the above differently while expressing what I take to be the same thing, we will see whether I misunderstood what you wrote if my version ends up saying what you did not intend), as I found it somewhat puzzling.

The short form <<EXAMPLES>> uses EXAMPLES as both the link target (which is not shown to the end user except in the browser's location bar when the link is visited) and the clickable text. In different parts of the document, however, the text in HTML may need to be rendered as "EXAMPLES" or [EXAMPLES], which can be achieved by using the <<EXAMPLES,"EXAMPLES">> or <<EXAMPLES,[EXAMPLES]>> form. For consistency, always use the longer form, even when there are no such typesetting constraints.

I'll mark the topic as Expecting a reroll in my working copy of the "What's cooking" report of the next issue.

Thanks.

#7 lore raw
Quoted 8 lines

To see if I understand correctly, let me rephrase the second paragraph a bit (not as an attempt to offer an improvement; by restating the above differently while expressing what I take to be the same thing, we will see whether I misunderstood what you wrote if my version ends up saying what you did not intend), as I found it somewhat puzzling.

Quoted 9 lines

The short form <<EXAMPLES>> uses EXAMPLES as both the link target (which is not shown to the end user except in the browser's location bar when the link is visited) and the clickable text. In different parts of the document, however, the text in HTML may need to be rendered as "EXAMPLES" or [EXAMPLES], which can be achieved by using the <<EXAMPLES,"EXAMPLES">> or <<EXAMPLES,[EXAMPLES]>> form. For consistency, always use the longer form, even when there are no such typesetting constraints.

I meant something different, let me try again (with Peff's corrections as well):

The reason for using the more verbose <<EXAMPLES,EXAMPLES>> (instead of <<EXAMPLES>>) is that in some cases, <<EXAMPLES>> is rendered as the section called "EXAMPLES" or [EXAMPLES]. <<EXAMPLES,EXAMPLES>> is rendered as just EXAMPLES, which gives us more control over the output.

("in some cases" is code for "I still don't fully understand exactly when each one happens and why")

Quoted 4 lines

I'll mark the topic as Expecting a reroll in my working copy of the "What's cooking" report of the next issue.

Thanks.

#8 lore raw
Quoted 19 lines · Julia Evans
Quoted 7 lines

To see if I understand correctly, let me rephrase the second paragraph a bit (not as an attempt to offer an improvement; by restating the above differently while expressing what I take to be the same thing, we will see whether I misunderstood what you wrote if my version ends up saying what you did not intend), as I found it somewhat puzzling.

Quoted 9 lines

The short form <<EXAMPLES>> uses EXAMPLES as both the link target (which is not shown to the end user except in the browser's location bar when the link is visited) and the clickable text. In different parts of the document, however, the text in HTML may need to be rendered as "EXAMPLES" or [EXAMPLES], which can be achieved by using the <<EXAMPLES,"EXAMPLES">> or <<EXAMPLES,[EXAMPLES]>> form. For consistency, always use the longer form, even when there are no such typesetting constraints.

I meant something different, let me try again (with Peff's corrections as well):

Quoted 8 lines

The reason for using the more verbose <<EXAMPLES,EXAMPLES>> (instead of <<EXAMPLES>>) is that in some cases, <<EXAMPLES>> is rendered as the section called "EXAMPLES" or [EXAMPLES]. <<EXAMPLES,EXAMPLES>> is rendered as just EXAMPLES, which gives us more control over the output.

("in some cases" is code for "I still don't fully understand exactly when each one happens and why")

I see. I think I understand now.

In your example, "leaving it vanilla without any extra adornment" is the control you want to gain by using the two-argument form, while in the version that shows my (mis)understanding, it is "you can mark up the string that is shown in any way you want".

Either way, the shorthand form forces you to leave the rendering to the toolchain, but the two-argument form gives you more control over how the text is rendered.

Thanks.

#9 lore raw
In reply to Julia Evans
Quoted 10 lines · Julia Evans

I meant something different, let me try again (with Peff's corrections as well):

The reason for using the more verbose <<EXAMPLES,EXAMPLES>> (instead of <<EXAMPLES>>) is that in some cases, <<EXAMPLES>> is rendered as the section called "EXAMPLES" or [EXAMPLES]. <<EXAMPLES,EXAMPLES>> is rendered as just EXAMPLES, which gives us more control over the output.

("in some cases" is code for "I still don't fully understand exactly when each one happens and why")

I think it's just "depending on the implementation and output backends". The complete table I saw is:

| HTML | manpage
----------------------------------------------

  asciidoc    |  [FOO]  | the section called "FOO"
  asciidoctor |  FOO    | the section called "FOO"

I'm not sure if the manpage expansion is asciidoc itself, though, or docbook. I guess that should be easy to test...

Ah, yeah, it's docbook. Using <<PRUNING>>, the xml generated by asciidoc looks like this:

and the <xref linkend="PRUNING"/> section of

and then the roff output from docbook becomes:

and the
the section called \(lqPRUNING\(rq
section of

So if we wanted to override that, we'd do it at the docbook layer. If you use <<PRUNING,PRUNING>> instead, then the xml looks like:

and the <link linkend="PRUNING">PRUNING</link> section of

which takes the decision away from docbook and uses the text we provide.

I don't think your commit message needs to go into that detail, but I thought it worth documenting in case we revisit this later.

-Peff

#10 lore raw
In reply to Julia Evans
Quoted 8 lines · On Tuesday, 22 September 2026 22:54:17 CEST Julia Evans wrote:
Quoted 2 lines

Oh, I love a change that is so sharply focused on a single issue and describes what the problem being solved is.

:
:)
:

Quoted 3 lines
Quoted 3 lines

* I tested it by running this script

(https://gist.github.com/jvns/039c8ed0add092f2179f0dba52ebb896)

which

Quoted 1 line
Quoted 1 line
Quoted 1 line

builds the previous and current views of all the man pages. I

looked

Quoted 1 line
Quoted 1 line
Quoted 1 line

at the output to make sure there were no differences. You can see

the

Quoted 11 lines
Quoted 11 lines

Documentation/fetch-

Quoted 11 lines

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.

Documentation/fetch- renamed from Documentation/fetch-options.adoc +0 -0

options.adoc

Quoted 31 lines
Quoted 10 lines
Quoted 10 lines

index 035f780e58..47dea1de8e 100644

Documentation/fetch-options.adoc +0 -0
@@ -199,7 +199,7 @@ endif::git-pull[]
 
 	providing the tag refspec.
 
 ifndef::git-pull[]
 +
 
Quoted 8 lines

Documentation/fetch-options.adoc endif::git-pull[] · line 205

Quoted 2 lines
Documentation/fetch-options.adoc +1 -1
-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).

The reason I explained this in a bit of a confusing way is that I'm not 100% sure in which exact cases we need to use <<double,double> instead of <<single>.

I double checked just now that if in git-push.adoc, I change:

of a remote (see the section <<REMOTES,REMOTES>> below),

to:

of a remote (see the section <<REMOTES>> below),

Quoted 8 lines

Then there's a problem where in the HTML version it displays as "[REMOTES]" instead of just "REMOTES".

But in the <<PRUNING,PRUNING>> example, just using <<PRUNING>> seems to work. I started working on this way back in December 2025 so I assume that something in this patch was affected by this issue and that's how I came across this problem but I'm not sure exactly what it was.

I have a strong argument for using <<PRUNING,PRUNING>>, it is that the manual pages are now translated and that the translated term can require changes in the target languages and not be compatible with simply inserting the title, where English is very malleable.

#11 lore raw
In reply to Julia Evans via GitGitGadget
Quoted 12 lines · Julia Evans via GitGitGadget

From: Julia Evans <[email protected]>

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.

Quoted 3 lines

---
[snip]

Now that I’ve read this commit message, it seems like an obvious idea in hindsight.

#12 lore raw
In reply to Julia Evans via GitGitGadget
Quoted 14 lines · Julia Evans via GitGitGadget
Documentation/git-add.adoc +1 -1
index 16b06e38e1..906db7ccf3 100644
@@ -117,7 +117,7 @@ The intent of this option is to pick and choose lines of the patch to
 apply, or even to modify the contents of lines to be staged. This can be
 quicker and more flexible than using the interactive hunk selector.
 However, it is easy to confuse oneself and create a patch that does not
-apply to the index. See EDITING PATCHES below.
+apply to the index. See <<EDITING_PATCHES,EDITING PATCHES>> below.
 
 `-u`::
 `--update`::

Documentation/git-add.adoc diff:: · line 380

Quoted 6 lines
Documentation/git-add.adoc +1 -0
@@ -375,6 +375,7 @@ diff::
   `HEAD` and index).
 
 
+[[EDITING_PATCHES]]
 EDITING PATCHES
 ---------------

I think we have section auto-ids enabled these days, so I don't think it's strictly necessary to make our own ids like this. But the generated ids are syntactically a little different, so you'd need:

-apply to the index. See <<EDITING_PATCHES,EDITING PATCHES>> below. +apply to the index. See <<_editing_patches,EDITING PATCHES>> below.

The asciidoctor reference made some mention of linking to sections directly by title (a "Natural cross reference"). But it did not seem to work for me in this case, and anyway I think it only works with the single-argument form (which has other headaches).

So we could probably get away with using the auto-generated ones, but it does mean using their syntax. Though there is another related issue
there: these ids are also somewhat user-visible, because they end up in the final HTML documents and people link to them.

Right now this works:

https://git-scm.com/docs/git-add#_editing_patches

but after your patch, I think it will have to be spelled as:

https://git-scm.com/docs/git-add#EDITING_PATCHES

I think I prefer the all-caps one, but it is kind of gross that as we change the docs we may break fragment links across the web. IIRC there are similar problems with linking to list items, where we auto-generate ids to allow linking to specific options (this is custom code on git-scm.com, not asciidoctor and not within git.git). The resulting fragment ids are long and gross and have changed a few times over the years (I think we had to add in some disambiguation because multiple lists in the same file might generate the same id).

So I dunno what all that means. Your patch "breaks" existing links into the HTML by assigning a new (but IMHO prettier) id. At some point I don't know how much we want to care about that. But I thought it was worth ignoring consciously rather than accidentally. ;)

Documentation/git-add.adoc diff:: · line 381

Quoted 2 lines
Documentation/git-add.adoc +1 -1
-See the "OBJECT PREREQUISITES" section below.
+See the <<OBJECT_PREREQUISITES,"OBJECT PREREQUISITES">> section below.

I noticed a few interesting typographic bits, like this one. I'd have expected:

"<<OBJECT_PREREQUISITES,OBJECT PREREQUISITES>>"

but I guess this is one of the inconsistencies you mentioned in the cover letter. I'm fine punting on those for now and fixing them later.

Especially this one:

Documentation/git-add.adoc

Quoted 2 lines
Documentation/git-add.adoc +1 -1
-	  `BATCH OUTPUT` below for details.
+	  <<BATCH_OUTPUT,`BATCH OUTPUT`>> below for details.

which can't move the backticks out (because they'd suppress the xref syntax). But probably it ought to drop the backticks entirely (which again can come later).

-Peff

#13 lore raw

PATCH v2 1/1 doc: add more AsciiDoc cross-references

In reply to Julia Evans via GitGitGadget

From: Julia Evans <[email protected]>

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 in some cases, <<EXAMPLES>> is rendered as the section called "EXAMPLES" or [EXAMPLES]. <<EXAMPLES,EXAMPLES>> is rendered as EXAMPLES, which gives us more control over the output.

This also changes some of the HTML IDs of the headings from _examples to EXAMPLES, which has the potential to break some links.

---
doc: add more AsciiDoc cross-references

This version rewrites the commit message to be more accurate. The original message said that the problem was to do with included pages which wasn't true.

Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-2416%2Fjvns%2Fanchors-v2
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-2416/jvns/anchors-v2
Pull-Request: https://github.com/git/git/pull/2416

Range-diff vs v1:

1: 419aa1259f ! 1: 8f4e7bae85 doc: add more AsciiDoc cross-references
@@ Commit message
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.
+ (instead of <<EXAMPLES>>) is that in some cases, <<EXAMPLES>> is
+ rendered as the section called "EXAMPLES" or [EXAMPLES].
+ <<EXAMPLES,EXAMPLES>> is rendered as EXAMPLES, which gives us more
+ control over the output.
+
+ This also changes some of the HTML IDs of the headings from _examples
+ to EXAMPLES, which has the potential to break some links.

 Documentation/fetch-options.adoc              |  4 +-
 Documentation/git-add.adoc                    |  3 +-
 Documentation/git-bundle.adoc                 |  7 +-
 Documentation/git-cat-file.adoc               | 12 ++--
 Documentation/git-checkout.adoc               | 11 +--
 Documentation/git-credential-cache.adoc       |  3 +-
 Documentation/git-credential-store.adoc       |  3 +-
 Documentation/git-fast-export.adoc            |  5 +-
 Documentation/git-fast-import.adoc            |  7 +-
 Documentation/git-fetch.adoc                  |  1 +
 Documentation/git-filter-branch.adoc          |  3 +-
 Documentation/git-for-each-ref.adoc           |  4 +-
 Documentation/git-format-patch.adoc           |  4 +-
 Documentation/git-gc.adoc                     | 12 ++--
 Documentation/git-grep.adoc                   |  9 ++-
 Documentation/git-http-backend.adoc           |  6 +-
 Documentation/git-ls-files.adoc               |  8 ++-
 Documentation/git-ls-tree.adoc                |  3 +-
 Documentation/git-maintenance.adoc            |  3 +-
 Documentation/git-merge-tree.adoc             |  2 +-
 Documentation/git-notes.adoc                  | 14 ++--
 Documentation/git-p4.adoc                     | 12 ++--
 Documentation/git-pack-objects.adoc           |  5 +-
 Documentation/git-prune.adoc                  |  3 +-
 Documentation/git-push.adoc                   | 10 +--
 Documentation/git-rebase.adoc                 | 69 +++++++++++--------
 Documentation/git-replay.adoc                 |  4 +-
 Documentation/git-repo.adoc                   |  5 +-
 Documentation/git-rev-parse.adoc              |  7 +-
 Documentation/git-send-email.adoc             |  5 +-
 Documentation/git-stash.adoc                  |  3 +-
 Documentation/git-svn.adoc                    | 10 +--
 Documentation/git-worktree.adoc               |  5 +-
 Documentation/gitremote-helpers.adoc          | 15 ++--
 Documentation/gitsubmodules.adoc              |  9 ++-
 Documentation/gitworkflows.adoc               |  6 +-
 .../howto/revert-a-faulty-merge.adoc          |  5 +-
 Documentation/revisions.adoc                  |  4 +-
 38 files changed, 190 insertions(+), 111 deletions(-)
Documentation/fetch-options.adoc +2 -2
index 035f780e58..47dea1de8e 100644
@@ -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.
 
 `-P`::
 `--prune-tags`::
@@ -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.
 
 endif::git-pull[]
 
Documentation/git-add.adoc +2 -1
index 16b06e38e1..906db7ccf3 100644
@@ -117,7 +117,7 @@ The intent of this option is to pick and choose lines of the patch to
 apply, or even to modify the contents of lines to be staged. This can be
 quicker and more flexible than using the interactive hunk selector.
 However, it is easy to confuse oneself and create a patch that does not
-apply to the index. See EDITING PATCHES below.
+apply to the index. See <<EDITING_PATCHES,EDITING PATCHES>> below.
 
 `-u`::
 `--update`::
@@ -375,6 +375,7 @@ diff::
   `HEAD` and index).
 
 
+[[EDITING_PATCHES]]
 EDITING PATCHES
 ---------------
 
Documentation/git-bundle.adoc +5 -2
index 03cd36fe8d..cd722bd674 100644
@@ -43,7 +43,7 @@ header indicating what references are contained within the bundle.
 
 Like the packed archive format itself bundles can either be
 self-contained, or be created using exclusions.
-See the "OBJECT PREREQUISITES" section below.
+See the <<OBJECT_PREREQUISITES,"OBJECT PREREQUISITES">> section below.
 
 Bundles created using revision exclusions are "thin packs" created
 using the `--thin` option to linkgit:git-pack-objects[1], and
@@ -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
@@ -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
 ---------------------
 
@@ -169,6 +171,7 @@ $ git bundle create master-yesterday.bundle master~10..master~5
 fatal: Refusing to create empty bundle.
 ----------------
 
+[[OBJECT_PREREQUISITES]]
 OBJECT PREREQUISITES
 --------------------
 
Documentation/git-cat-file.adoc +7 -5
index 514bfc0032..c4ea2524cf 100644
@@ -115,7 +115,7 @@ are not of the requested type.
 --
 	* When used with `--textconv` or `--filters`, the input lines
 	  must specify the path, separated by whitespace. See the section
-	  `BATCH OUTPUT` below for details.
+	  <<BATCH_OUTPUT,`BATCH OUTPUT`>> below for details.
 
 	* When used with `--use-mailmap`, for commit and tag objects, the
 	  contents part of the output shows the identities replaced using the
@@ -133,7 +133,7 @@ are not of the requested type.
 --
 	* When used with `--textconv` or `--filters`, the input lines must
 	 specify the path, separated by whitespace. See the section
-	 `BATCH OUTPUT` below for details.
+	 <<BATCH_OUTPUT,`BATCH OUTPUT`>> below for details.
 
 	* When used with `--use-mailmap`, for commit and tag objects, the
 	  printed object information shows the size of the object as if the
@@ -149,7 +149,7 @@ are not of the requested type.
 --
 	* When used with `--textconv` or `--filters`, the input lines must
 	  specify the path, separated by whitespace. See the section
-	  `BATCH OUTPUT` below for details.
+	  <<BATCH_OUTPUT,`BATCH OUTPUT`>> below for details.
 
 	* When used with `--use-mailmap`, for commit and tag objects, the
 	  `contents` command shows the identities replaced using the
@@ -295,6 +295,7 @@ If `-p` is specified, the contents of `<object>` are pretty-printed.
 If `<type>` is specified, the raw (though uncompressed) contents of the `<object>`
 will be returned.
 
+[[BATCH_OUTPUT]]
 BATCH OUTPUT
 ------------
 
@@ -333,12 +334,12 @@ newline. The available atoms are:
 
 `objectsize:disk`::
 	The size, in bytes, that the object takes up on disk. See the
-	note about on-disk sizes in the `CAVEATS` section below.
+	note about on-disk sizes in the <<CAVEATS,`CAVEATS`>> section below.
 
 `deltabase`::
 	If the object is stored as a delta on-disk, this expands to the
 	full hex representation of the delta base object name.
-	Otherwise, expands to the null OID (all zeroes). See `CAVEATS`
+	Otherwise, expands to the null OID (all zeroes). See <<CAVEATS,`CAVEATS`>>
 	below.
 
 `rest`::
@@ -447,6 +448,7 @@ are replaced with NUL terminators. This ensures that output will be parsable if
 the output itself would contain a linefeed and is thus recommended for
 scripting purposes.
 
+[[CAVEATS]]
 CAVEATS
 -------
 
Documentation/git-checkout.adoc +7 -4
index a8b3b8c2e2..2aefea0228 100644
@@ -27,7 +27,8 @@ DESCRIPTION
 2. **Restore a different version of a file**, for example with
    `git checkout <commit> <filename>` or `git checkout <filename>`
 
-See ARGUMENT DISAMBIGUATION below for how Git decides which one to do.
+See <<ARGUMENT_DISAMBIGUATION,ARGUMENT DISAMBIGUATION>> below
+for how Git decides which one to do.
 
 `git checkout [<branch>]`::
 	Switch to _<branch>_. This sets the current branch to _<branch>_ and
@@ -68,7 +69,7 @@ uncommitted changes.
 
 	The same as `git checkout <branch>`, except that instead of pointing
 	`HEAD` at the branch, it points `HEAD` at the commit ID.
-	See the "DETACHED HEAD" section below for more.
+	See the <<DETACHED_HEAD,"DETACHED HEAD">> section below for more.
 +
 Omitting _<branch>_ detaches `HEAD` at the tip of the current branch.
 
@@ -210,8 +211,8 @@ variable.
 	Rather than checking out a branch to work on it, check out a
 	commit for inspection and discardable experiments.
 	This is the default behavior of `git checkout <commit>` when
-	_<commit>_ is not a branch name.  See the "DETACHED HEAD" section
-	below for details.
+	_<commit>_ is not a branch name.  See the
+	<<DETACHED_HEAD,"DETACHED HEAD">> section below for details.
 
 `--orphan <new-branch>`::
 	Create a new unborn branch, named _<new-branch>_, started from
@@ -372,6 +373,7 @@ leave out at most one of _<rev-a>_ and _<rev-b>_, in which case it defaults to `
 +
 For more details, see the 'pathspec' entry in linkgit:gitglossary[7].
 
+[[DETACHED_HEAD]]
 DETACHED HEAD
 -------------
 `HEAD` normally refers to a named branch (e.g. `master`). Meanwhile, each
@@ -504,6 +506,7 @@ $ git reflog -2 HEAD # or
 $ git log -g -2 HEAD
 ------------
 
+[[ARGUMENT_DISAMBIGUATION]]
 ARGUMENT DISAMBIGUATION
 -----------------------
 
Documentation/git-credential-cache.adoc +2 -1
index 54fa7a27e1..2f6395937d 100644
@@ -24,7 +24,7 @@ user by filesystem permissions.
 
 You probably don't want to invoke this command directly; it is meant to
 be used as a credential helper by other parts of Git. See
-linkgit:gitcredentials[7] or `EXAMPLES` below.
+linkgit:gitcredentials[7] or <<EXAMPLES,`EXAMPLES`>> below.
 
 OPTIONS
 -------
@@ -54,6 +54,7 @@ credentials before their timeout, you can issue an `exit` action:
 git credential-cache exit
 --------------------------------------
 
+[[EXAMPLES]]
 EXAMPLES
 --------
 
Documentation/git-credential-store.adoc +2 -1
index 71864a8726..3f8a426f93 100644
@@ -24,7 +24,7 @@ Git programs.
 
 You probably don't want to invoke this command directly; it is meant to
 be used as a credential helper by other parts of git. See
-linkgit:gitcredentials[7] or `EXAMPLES` below.
+linkgit:gitcredentials[7] or <<EXAMPLES,`EXAMPLES`>> below.
 
 OPTIONS
 -------
@@ -67,6 +67,7 @@ written to.
 
 When erasing credentials, matching credentials will be erased from all files.
 
+[[EXAMPLES]]
 EXAMPLES
 --------
 
Documentation/git-fast-export.adoc +3 -2
index 719aeca244..0c2ce385c4 100644
@@ -148,12 +148,12 @@ by keeping the marks the same across runs.
 --anonymize::
 	Anonymize the contents of the repository while still retaining
 	the shape of the history and stored tree.  See the section on
-	`ANONYMIZING` below.
+	<<ANONYMIZING,`ANONYMIZING`>> below.
 
 --anonymize-map=<from>[:<to>]::
 	Convert token `<from>` to `<to>` in the anonymized output. If
 	`<to>` is omitted, map `<from>` to itself (i.e., do not
-	anonymize it). See the section on `ANONYMIZING` below.
+	anonymize it). See the section on <<ANONYMIZING,`ANONYMIZING`>> below.
 
 --reference-excluded-parents::
 	By default, running a command such as `git fast-export
@@ -219,6 +219,7 @@ referenced by that revision range contains the string
 'refs/heads/master'.
 
 
+[[ANONYMIZING]]
 ANONYMIZING
 -----------
 
Documentation/git-fast-import.adoc +4 -3
index fd165e11d2..c5e1cec1a5 100644
@@ -31,6 +31,7 @@ imports are supported from a particular foreign source depends on
 the frontend program in use.
 
 
+[[OPTIONS]]
 OPTIONS
 -------
 
@@ -456,7 +457,7 @@ and control the current import process.  More detailed discussion
 	supports the specified feature, and aborts if it does not.
 
 `option`::
-	Specify any of the options listed under OPTIONS that do not
+	Specify any of the options listed under <<OPTIONS,OPTIONS>> that do not
 	change stream semantic to suit the frontend's needs. This
 	command is optional and is not needed to perform an import.
 
@@ -1242,7 +1243,7 @@ no-relative-marks::
 force::
 	Act as though the corresponding command-line option with
 	a leading `--` was passed on the command line
-	(see OPTIONS, above).
+	(see <<OPTIONS,OPTIONS>>, above).
 
 import-marks::
 import-marks-if-exists::
@@ -1291,7 +1292,7 @@ options the user may specify to git fast-import itself.
 ....
 
 The `<option>` part of the command may contain any of the options
-listed in the OPTIONS section that do not change import semantics,
+listed in the <<OPTIONS,OPTIONS>> section that do not change import semantics,
 without the leading `--` and is treated in the same way.
 
 Option commands must be the first commands on the input (not counting
Documentation/git-fetch.adoc +1 -0
index db03541915..61fed797af 100644
@@ -103,6 +103,7 @@ The latter use of the `remote.<repository>.fetch` values can be
 overridden by giving the `--refmap=<refspec>` parameter(s) on the
 command line.
 
+[[PRUNING]]
 PRUNING
 -------
 
Documentation/git-filter-branch.adoc +2 -1
index 5a4f853785..80a55b3706 100644
@@ -125,7 +125,7 @@ OPTIONS
 	This is the filter for rewriting the index.  It is similar to the
 	tree filter but does not check out the tree, which makes it much
 	faster.  Frequently used with `git rm --cached
-	--ignore-unmatch ...`, see EXAMPLES below.  For hairy
+	--ignore-unmatch ...`, see <<EXAMPLES,EXAMPLES>> below.  For hairy
 	cases, see linkgit:git-update-index[1].
 
 --parent-filter <command>::
@@ -243,6 +243,7 @@ rewrite, the exit status is `2`.  On any other error, the exit status may be
 any other non-zero value.
 
 
+[[EXAMPLES]]
 EXAMPLES
 --------
 
Documentation/git-for-each-ref.adoc +3 -1
index c02cb7f886..a7b31e8aaf 100644
@@ -64,7 +64,8 @@ For all objects, the following names can be used:
 `objectsize`::
 	The size of the object (the same as 'git cat-file -s' reports).
 	Append `:disk` to get the size, in bytes, that the object takes up on
-	disk. See the note about on-disk sizes in the 'CAVEATS' section below.
+	disk. See the note about on-disk sizes in the
+	<<CAVEATS,'CAVEATS'>> section below.
 `objectname`::
 	The object name (aka SHA-1).
 	For a non-ambiguous abbreviation of the object name append `:short`.
@@ -448,6 +449,7 @@ This prints the authorname, if present.
 git for-each-ref --format="%(refname)%(if)%(authorname)%(then) Authored by: %(authorname)%(end)"
 ------------
 
+[[CAVEATS]]
 CAVEATS
 -------
 
Documentation/git-format-patch.adoc +3 -1
index 191f64b77d..a78fe564f0 100644
@@ -430,7 +430,8 @@ you can use `--suffix=-patch` to get `0001-description-of-my-change-patch`.
 `--no-base`::
 `--base[=<commit>]`::
 	Record the base tree information to identify the state the
-	patch series applies to.  See the BASE TREE INFORMATION section
+	patch series applies to.  See the
+	<<BASE_TREE_INFORMATION,BASE TREE INFORMATION>> section
 	below for details. If _<commit>_ is `auto`, a base commit is
 	automatically chosen. The `--no-base` option overrides a
 	`format.useAutoBase` configuration.
@@ -702,6 +703,7 @@ This should help you to submit patches inline using KMail.
 5. Back in the compose window: add whatever other text you wish to the
    message, complete the addressing and subject fields, and press send.
 
+[[BASE_TREE_INFORMATION]]
 BASE TREE INFORMATION
 ---------------------
 
Documentation/git-gc.adoc +8 -4
index 6fed646dd8..5788a43215 100644
@@ -39,14 +39,15 @@ OPTIONS
 	space utilization and performance.  This option will cause
 	'git gc' to more aggressively optimize the repository at the expense
 	of taking much more time.  The effects of this optimization are
-	mostly persistent. See the "AGGRESSIVE" section below for details.
+	mostly persistent. See the <<AGGRESSIVE,"AGGRESSIVE">>
+	section below for details.
 
 --auto::
 	With this option, 'git gc' checks whether any housekeeping is
 	required; if not, it exits without performing any work.
 +
-See the `gc.auto` option in the "CONFIGURATION" section below for how
-this heuristic works.
+See the `gc.auto` option in the <<CONFIGURATION,"CONFIGURATION">>
+section below for how this heuristic works.
 +
 Once housekeeping is triggered by exceeding the limits of
 configuration options such as `gc.auto` and `gc.autoPackLimit`, all
@@ -83,7 +84,7 @@ be performed as well.
 	overridable by the config variable `gc.pruneExpire`).
 	--prune=now prunes loose objects regardless of their age and
 	increases the risk of corruption if another process is writing to
-	the repository concurrently; see "NOTES" below. --prune is on by
+	the repository concurrently; see <<NOTES,"NOTES">> below. --prune is on by
 	default.
 
 --no-prune::
@@ -102,6 +103,7 @@ be performed as well.
 	a single pack. When this option is used, `gc.bigPackThreshold`
 	is ignored.
 
+[[AGGRESSIVE]]
 AGGRESSIVE
 ----------
 
@@ -128,6 +130,7 @@ more time, and the resulting space/delta optimization may or may not
 be worth it. Not using this at all is the right trade-off for most
 users and their repositories.
 
+[[CONFIGURATION]]
 CONFIGURATION
 -------------
 
@@ -135,6 +138,7 @@ include::includes/cmd-config-section-all.adoc[]
 
 include::config/gc.adoc[]
 
+[[NOTES]]
 NOTES
 -----
 
Documentation/git-grep.adoc +6 -3
index 19b3ade16d..dd4a7cc9e9 100644
@@ -58,7 +58,7 @@ OPTIONS
 	in linkgit:gitglossary[7] for more information.
 +
 This option cannot be used together with `--cached` or `--untracked`.
-See also `grep.fallbackToNoIndex` in 'CONFIGURATION' below.
+See also `grep.fallbackToNoIndex` in <<CONFIGURATION,'CONFIGURATION'>> below.
 
 `--no-exclude-standard`::
 	Also search in ignored files by not honoring the `.gitignore`
@@ -256,8 +256,9 @@ providing this option will cause it to die.
 	a non-zero status.
 
 `--threads <num>`::
-	Number of `grep` worker threads to use.  See `NOTES ON THREADS`
-	and `grep.threads` in 'CONFIGURATION' for more information.
+	Number of `grep` worker threads to use. See
+	<<NOTES_ON_THREADS,`NOTES ON THREADS`>> and `grep.threads` in
+	<<CONFIGURATION,'CONFIGURATION'>> for more information.
 
 `-f <file>`::
 	Read patterns from _<file>_, one per line.
@@ -337,6 +338,7 @@ EXAMPLES
 `git grep solution -- :^Documentation`::
 	Looks for `solution`, excluding files in `Documentation`.
 
+[[NOTES_ON_THREADS]]
 NOTES ON THREADS
 ----------------
 
@@ -348,6 +350,7 @@ with multiple threads might perform slower than single-threaded if `--textconv`
 is given and there are too many text conversions.  Thus, if low performance is
 experienced in this case, it might be desirable to use `--threads=1`.
 
+[[CONFIGURATION]]
 CONFIGURATION
 -------------
 
Documentation/git-http-backend.adoc +4 -2
index 1dea426852..5fabc85d12 100644
@@ -18,7 +18,7 @@ The program supports clients fetching using both the smart HTTP protocol
 and the backwards-compatible dumb HTTP protocol, as well as clients
 pushing using the smart HTTP protocol. It also supports Git's
 more-efficient "v2" protocol if properly configured; see the
-discussion of `GIT_PROTOCOL` in the ENVIRONMENT section below.
+discussion of `GIT_PROTOCOL` in the <<ENVIRONMENT,ENVIRONMENT>> section below.
 
 It verifies that the directory has the magic file
 "git-daemon-export-ok", and it will refuse to export any Git directory
@@ -69,6 +69,7 @@ manually in the web server configuration.  If GIT_PROJECT_ROOT is not
 set, 'git http-backend' reads PATH_TRANSLATED, which is also set
 automatically by the web server.
 
+[[EXAMPLES]]
 EXAMPLES
 --------
 All of the following examples map `http://$hostname/git/foo/bar.git`
@@ -257,6 +258,7 @@ $HTTP["url"] =~ "^/git/private" {
 ----------------------------------------------------------------
 
 
+[[ENVIRONMENT]]
 ENVIRONMENT
 -----------
 'git http-backend' relies upon the `CGI` environment variables set
@@ -290,7 +292,7 @@ via the `HTTP_GIT_PROTOCOL` variable, and `git-http-backend` will
 automatically copy that to `GIT_PROTOCOL`. However, some webservers may
 be more selective about which headers they'll pass, in which case they
 need to be configured explicitly (see the mention of `Git-Protocol` in
-the Apache config from the earlier EXAMPLES section).
+the Apache config from the earlier <<EXAMPLES,EXAMPLES>> section).
 
 The backend process sets GIT_COMMITTER_NAME to '$REMOTE_USER' and
 GIT_COMMITTER_EMAIL to '$\{REMOTE_USER}@http.$\{REMOTE_ADDR\}',
Documentation/git-ls-files.adoc +5 -3
index 2b175388e1..14ebad8b71 100644
@@ -98,7 +98,7 @@ OPTIONS
 
 -z::
 	\0 line termination on output and do not quote filenames.
-	See OUTPUT below for more information.
+	See <<OUTPUT,OUTPUT>> below for more information.
 
 --deduplicate::
 	When only filenames are shown, suppress duplicates that may
@@ -110,8 +110,8 @@ OPTIONS
 -x <pattern>::
 --exclude=<pattern>::
 	Skip untracked files matching pattern.
-	Note that pattern is a shell wildcard pattern. See EXCLUDE PATTERNS
-	below for more information.
+	Note that pattern is a shell wildcard pattern.
+	See <<EXCLUDE_PATTERNS,EXCLUDE PATTERNS>> below for more information.
 
 -X <file>::
 --exclude-from=<file>::
@@ -231,6 +231,7 @@ followed by the  ("attr/<eolattr>").
 	Files to show. If no files are given all files which match the other
 	specified criteria are shown.
 
+[[OUTPUT]]
 OUTPUT
 ------
 'git ls-files' just outputs the filenames unless `--stage` is specified in
@@ -292,6 +293,7 @@ eolattr::
 path::
 	The pathname of the file which is recorded in the index.
 
+[[EXCLUDE_PATTERNS]]
 EXCLUDE PATTERNS
 ----------------
 
Documentation/git-ls-tree.adoc +2 -1
index 6572095d8d..29bde9366d 100644
@@ -54,7 +54,7 @@ OPTIONS
 
 -z::
 	\0 line termination on output and do not quote filenames.
-	See OUTPUT FORMAT below for more information.
+	See <<OUTPUT_FORMAT,OUTPUT FORMAT>> below for more information.
 
 --name-only::
 --name-status::
@@ -99,6 +99,7 @@ OPTIONS
 	implicitly uses the root level of the tree as the sole path argument.
 
 
+[[OUTPUT_FORMAT]]
 Output Format
 -------------
 
Documentation/git-maintenance.adoc +2 -1
index bda616f14c..85f208031c 100644
@@ -95,6 +95,7 @@ in that order. Otherwise, the tasks are determined by which
 `maintenance.<task>.enabled` config options are true. By default, only
 `maintenance.gc.enabled` is true.
 
+[[TASKS]]
 TASKS
 -----
 
@@ -215,7 +216,7 @@ OPTIONS
 	specified tasks in the specified order. If no `--task=<task>`
 	arguments are specified, then only the tasks with
 	`maintenance.<task>.enabled` configured as `true` are considered.
-	See the 'TASKS' section for the list of accepted `<task>` values.
+	See the <<TASKS,'TASKS'>> section for the list of accepted `<task>` values.
 
 --scheduler=auto|crontab|systemd-timer|launchctl|schtasks::
 	When combined with the `start` subcommand, specify the scheduler
Documentation/git-merge-tree.adoc +1 -1
index 4391bbee47..c5351f9699 100644
@@ -35,7 +35,7 @@ linkgit:git-merge[1], including:
   * etc.
 
 After the merge completes, a new toplevel tree object is created.  See
-`OUTPUT` below for details.
+<<OUTPUT,`OUTPUT`>> below for details.
 
 OPTIONS
 -------
Documentation/git-notes.adoc +10 -4
index 46a232ca71..22d59ada86 100644
@@ -28,8 +28,9 @@ Adds, removes, or reads notes attached to objects, without touching
 the objects themselves.
 
 By default, notes are saved to and read from `refs/notes/commits`, but
-this default can be overridden.  See the OPTIONS, CONFIGURATION, and
-ENVIRONMENT sections below.  If this ref does not exist, it will be
+this default can be overridden.  See the <<OPTIONS,OPTIONS>>,
+<<CONFIGURATION,CONFIGURATION>>, and <<ENVIRONMENT,ENVIRONMENT>>
+sections below. If this ref does not exist, it will be
 quietly created when it is first needed to store a note.
 
 A typical use of notes is to supplement a commit message without
@@ -114,7 +115,8 @@ line.
 	any) into the current notes ref (called "local").
 +
 If conflicts arise and a strategy for automatically resolving
-conflicting notes (see the "NOTES MERGE STRATEGIES" section) is not given,
+conflicting notes (see the
+<<NOTES_MERGE_STRATEGIES,"NOTES MERGE STRATEGIES">> section) is not given,
 the `manual` resolver is used. This resolver checks out the
 conflicting notes in a special worktree (`.git/NOTES_MERGE_WORKTREE`),
 and instructs the user to manually resolve the conflicts there.
@@ -139,6 +141,7 @@ the command line.
 	Print the current notes ref. This provides an easy way to
 	retrieve the current notes ref (e.g. from scripts).
 
+[[OPTIONS]]
 OPTIONS
 -------
 `-f`::
@@ -225,7 +228,8 @@ future.
 	strategy. The following strategies are recognized: `manual`
 	(default), `ours`, `theirs`, `union` and `cat_sort_uniq`.
 	This option overrides the `notes.mergeStrategy` configuration setting.
-	See the "NOTES MERGE STRATEGIES" section below for more
+	See the <<NOTES_MERGE_STRATEGIES,"NOTES MERGE STRATEGIES">>
+	section below for more
 	information on each notes merge strategy.
 
 `--commit`::
@@ -278,6 +282,7 @@ object, in which case the history of the notes can be read with
 `git log -p -g <refname>`.
 
 
+[[NOTES_MERGE_STRATEGIES]]
 NOTES MERGE STRATEGIES
 ----------------------
 
@@ -361,6 +366,7 @@ include::includes/cmd-config-section-rest.adoc[]
 include::config/notes.adoc[]
 
 
+[[ENVIRONMENT]]
 ENVIRONMENT
 -----------
 
Documentation/git-p4.adoc +8 -4
index 59edd24134..acf14cd03d 100644
@@ -119,7 +119,8 @@ importing directly from p4 is considerably slower than pulling changes
 from a Git remote, this can be useful in a multi-developer environment.
 
 If there are multiple branches, doing 'git p4 sync' will automatically
-use the "BRANCH DETECTION" algorithm to try to partition new changes
+use the <<BRANCH_DETECTION,"BRANCH DETECTION">> algorithm
+to try to partition new changes
 into the right branch.  This can be overridden with the `--branch`
 option to specify just a single branch to update.
 
@@ -245,7 +246,7 @@ Git repository:
 
 --detect-branches::
 	Use the branch detection algorithm to find new paths in p4.  It is
-	documented below in "BRANCH DETECTION".
+	documented below in <<BRANCH_DETECTION,"BRANCH DETECTION">>.
 
 --changesfile <file>::
 	Import exactly the p4 change numbers listed in 'file', one per
@@ -297,7 +298,7 @@ Git repository:
 
 --use-client-spec::
 	Use a client spec to find the list of interesting files in p4.
-	See the "CLIENT SPEC" section below.
+	See the <<CLIENT_SPEC,"CLIENT SPEC">> section below.
 
 -/ <path>::
 	Exclude selected depot paths when cloning or syncing.
@@ -475,6 +476,7 @@ p4 revision specifier on the end:
 See 'p4 help revisions' for the full syntax of p4 revision specifiers.
 
 
+[[CLIENT_SPEC]]
 CLIENT SPEC
 -----------
 The p4 client specification is maintained with the 'p4 client' command
@@ -505,6 +507,7 @@ normal p4 mechanisms of determining the client are used:  environment
 variable `P4CLIENT`, a file referenced by `P4CONFIG`, or the local host name.
 
 
+[[BRANCH_DETECTION]]
 BRANCH DETECTION
 ----------------
 P4 does not have the same concept of a branch as Git.  Instead,
@@ -643,7 +646,8 @@ git-p4.labelImportRegexp::
 git-p4.useClientSpec::
 	Specify that the p4 client spec should be used to identify p4
 	depot paths of interest.  This is equivalent to specifying the
-	option `--use-client-spec`.  See the "CLIENT SPEC" section above.
+	option `--use-client-spec`.
+	See the <<CLIENT_SPEC,"CLIENT SPEC">> section above.
 	This variable is a boolean, not the name of a p4 client.
 
 git-p4.pathEncoding::
Documentation/git-pack-objects.adoc +3 -2
index 65cd00c152..ccad938c5b 100644
@@ -363,8 +363,8 @@ raise an error.
 	Keep unreachable objects in loose form. This implies `--revs`.
 
 --delta-islands::
-	Restrict delta matches based on "islands". See DELTA ISLANDS
-	below.
+	Restrict delta matches based on "islands".
+	See <<DELTA_ISLANDS,DELTA ISLANDS>> below.
 
 --name-hash-version=<n>::
 	While performing delta compression, Git groups objects that may be
@@ -411,6 +411,7 @@ request. The `--path-walk` option supports the `--filter=<spec>` forms
 `combine:<spec>+<spec>` form.
 
 
+[[DELTA_ISLANDS]]
 DELTA ISLANDS
 -------------
 
Documentation/git-prune.adoc +2 -1
index 9a45571b90..d7836e625f 100644
@@ -15,7 +15,7 @@ DESCRIPTION
 -----------
 
 NOTE: In most cases, users should run 'git gc', which calls
-'git prune'. See the section "NOTES", below.
+'git prune'. See the section <<NOTES,"NOTES">>, below.
 
 This runs 'git fsck --unreachable' using all the refs
 available in `refs/`, optionally with an additional set of
@@ -67,6 +67,7 @@ borrows from your repository via its
 $ git prune $(cd ../another && git rev-parse --all)
 ------------
 
+[[NOTES]]
 NOTES
 -----
 
Documentation/git-push.adoc +6 -4
index aa221c3909..e5b1023855 100644
@@ -132,7 +132,8 @@ as well as various other special refspec forms:
     linkgit:git-config[1]) suggest what refs/ namespace you may have
     wanted to push to.
 
-Not all updates are allowed: see PUSH RULES below for the details.
+Not all updates are allowed: see
+<<PUSH_RULES,PUSH RULES>> below for the details.
 
 `--all`::
 `--branches`::
@@ -337,9 +338,9 @@ allowing a forced update.
 	Usually, `git push` will refuse to update a branch that is not an
 	ancestor of the commit being pushed.
 +
-This flag disables that check, the other safety checks in PUSH RULES
-below, and the checks in `--force-with-lease`. It can cause the remote
-repository to lose commits; use it with care.
+This flag disables that check, the other safety checks in
+<<PUSH_RULES,PUSH RULES>> below, and the checks in `--force-with-lease`.
+It can cause the remote repository to lose commits; use it with care.
 +
 Note that `--force` applies to all the refs that are pushed, hence
 using it with `push.default` set to `matching` or with multiple push
@@ -568,6 +569,7 @@ reason::
 	refs, no explanation is needed. For a failed ref, the reason for
 	failure is described.
 
+[[PUSH_RULES]]
 PUSH RULES
 ----------
 
Documentation/git-rebase.adoc +40 -29

261 lines not on this page · raw message

Documentation/git-replay.adoc +2 -2
index 58b4c0c470..f3ac875bb7 100644
@@ -20,7 +20,7 @@ the working tree and the index untouched. By default, updates the
 relevant references using an atomic transaction (all refs update or
 none). Use `--ref-action=print` to avoid automatic ref updates and
 instead get update commands that can be piped to `git update-ref --stdin`
-(see the <<output,OUTPUT>> section below).
+(see the <<OUTPUT,OUTPUT>> section below).
 
 THIS COMMAND IS EXPERIMENTAL. THE BEHAVIOR MAY CHANGE.
 
@@ -118,7 +118,7 @@ behavior of git-rebase(1)'s `--no-rebase-merges` option.)
 :git-replay: 1
 include::rev-list-options.adoc[]
 
-[[output]]
+[[OUTPUT]]
 OUTPUT
 ------
 
Documentation/git-repo.adoc +3 -2
index ed7d80c690..cb8c1e7292 100644
@@ -22,8 +22,8 @@ COMMANDS
 --------
 `info [--format=(lines|nul) | -z] [--all | <key>...]`::
 	Retrieve metadata-related information about the current repository. Only
-	the requested data will be returned based on their keys (see "INFO KEYS"
-	section below).
+	the requested data will be returned based on their keys
+	(see <<INFO_KEYS,"INFO KEYS">> section below).
 +
 The values are returned in the same order in which their respective keys were
 requested. The `--all` flag requests the values for all the available keys.
@@ -89,6 +89,7 @@ supported:
 +
 `-z` is an alias for `--format=nul`.
 
+[[INFO_KEYS]]
 INFO KEYS
 ---------
 In order to obtain a set of values from `git repo info`, you should provide
Documentation/git-rev-parse.adoc +5 -2
index 5398691f3f..a6d4289e28 100644
@@ -38,12 +38,13 @@ Operation Modes
 Each of these options must appear first on the command line.
 
 --parseopt::
-	Use 'git rev-parse' in option parsing mode (see PARSEOPT section below).
+	Use 'git rev-parse' in option parsing mode
+	(see <<PARSEOPT,PARSEOPT>> section below).
 	The command in this mode can be used outside a repository or
 	a working tree controlled by a repository.
 
 --sq-quote::
-	Use 'git rev-parse' in shell quoting mode (see SQ-QUOTE
+	Use 'git rev-parse' in shell quoting mode (see <<SQ_QUOTE,SQ-QUOTE>>
 	section below). In contrast to the `--sq` option below, this
 	mode only does quoting. Nothing else is done to command input.
 	The command in this mode can be used outside a repository or
@@ -354,6 +355,7 @@ Other Options
 
 include::revisions.adoc[]
 
+[[PARSEOPT]]
 PARSEOPT
 --------
 
@@ -460,6 +462,7 @@ An option group Header
     -C[...]               option C with an optional argument
 ------------
 
+[[SQ_QUOTE]]
 SQ-QUOTE
 --------
 
Documentation/git-send-email.adoc +3 -2
index 5c9ab39944..4a5e0c359f 100644
@@ -50,7 +50,7 @@ Composing
 
 `--annotate`::
 	Review and edit each patch you're about to send. Default is the value
-	of `sendemail.annotate`. See the CONFIGURATION section for
+	of `sendemail.annotate`. See the <<CONFIGURATION,CONFIGURATION>> section for
 	`sendemail.multiEdit`.
 
 `--bcc=<address>,...`::
@@ -78,7 +78,7 @@ removed.
 +
 Missing `From` or `In-Reply-To` headers will be prompted for.
 +
-See the CONFIGURATION section for `sendemail.multiEdit`.
+See the <<CONFIGURATION,CONFIGURATION>> section for `sendemail.multiEdit`.
 
 `--from=<address>`::
 	Specify the sender of the emails.  If not specified on the command line,
@@ -559,6 +559,7 @@ Information
 	address to standard output, one per line. See `sendemail.aliasFile`
 	for more information about aliases.
 
+[[CONFIGURATION]]
 CONFIGURATION
 -------------
 
Documentation/git-stash.adoc +2 -1
index fc6a9a008c..d6e8c4144c 100644
@@ -133,7 +133,7 @@ with no conflicts.
 `clear`::
 	Remove all the stash entries. Note that those entries will then
 	be subject to pruning, and may be impossible to recover (see
-	'EXAMPLES' below for a possible strategy).
+	<<EXAMPLES,'EXAMPLES'>> below for a possible strategy).
 
 `drop [-q | --quiet] [<stash>]`::
 	Remove a single stash entry from the list of stash entries.
@@ -315,6 +315,7 @@ of the index, and `W` is a commit that records the state of the working
 tree.
 
 
+[[EXAMPLES]]
 EXAMPLES
 --------
 
Documentation/git-svn.adoc +6 -4
index 2a7fa60465..baaf3bff4e 100644
@@ -126,7 +126,7 @@ your Perl's Getopt::Long is < v2.37).
 	command-line argument.
 +
 This automatically updates the rev_map if needed (see
-'$GIT_DIR/svn/\**/.rev_map.*' in the FILES section below for details).
+'$GIT_DIR/svn/\**/.rev_map.*' in the <<FILES,FILES>> section below for details).
 
 --localtime;;
 	Store Git commit times in the local time zone instead of UTC.  This
@@ -239,7 +239,7 @@ Like 'git rebase'; this requires that the working tree be clean
 and have no uncommitted changes.
 +
 This automatically updates the rev_map if needed (see
-'$GIT_DIR/svn/\**/.rev_map.*' in the FILES section below for details).
+'$GIT_DIR/svn/\**/.rev_map.*' in the <<FILES,FILES>> section below for details).
 
 -l;;
 --local;;
@@ -524,7 +524,7 @@ This will set the property 'svn:keywords' to 'FreeBSD=%H' for the file
 	way to repair the repo is to use 'reset'.
 +
 Only the rev_map and refs/remotes/git-svn are changed (see
-'$GIT_DIR/svn/\**/.rev_map.*' in the FILES section below for details).
+'$GIT_DIR/svn/\**/.rev_map.*' in the <<FILES,FILES>> section below for details).
 Follow 'reset' with a 'fetch' and then 'git reset' or 'git rebase' to
 move local branches onto the new tree.
 
@@ -946,7 +946,7 @@ copy history (including branches and tags) for repositories adopting a
 standard layout, it cannot yet represent merge history that happened
 inside git back upstream to SVN users.  Therefore it is advised that
 users keep history as linear as possible inside Git to ease
-compatibility with SVN (see the CAVEATS section below).
+compatibility with SVN (see the <<CAVEATS,CAVEATS>> section below).
 
 HANDLING OF SVN BRANCHES
 ------------------------
@@ -994,6 +994,7 @@ to r.199 (one containing trunk/, one containing trunk/sub/). Finally,
 it will create a branch 'sub@200' pointing to the new parent commit of
 branch 'sub' (i.e. the commit for r.200 and trunk/sub/).
 
+[[CAVEATS]]
 CAVEATS
 -------
 
@@ -1135,6 +1136,7 @@ or tag has appeared. If the subset of branches or tags is changed after
 fetching, then $GIT_DIR/svn/.metadata must be manually edited to remove
 (or reset) branches-maxRev and/or tags-maxRev as appropriate.
 
+[[FILES]]
 FILES
 -----
 $GIT_DIR/svn/\**/.rev_map.*::
Documentation/git-worktree.adoc +3 -2
index 32787eacc3..e6e77252ab 100644
@@ -50,8 +50,8 @@ at the same commit as the current branch.
 
 If a working tree is deleted without using `git worktree remove`, then
 its associated administrative files, which reside in the repository
-(see "DETAILS" below), will eventually be removed automatically (see
-`gc.worktreePruneExpire` in linkgit:git-config[1]), or you can run
+(see <<DETAILS,"DETAILS">> below), will eventually be removed automatically
+(see `gc.worktreePruneExpire` in linkgit:git-config[1]), or you can run
 `git worktree prune` in the main or any linked worktree to clean up any
 stale administrative files.
 
@@ -360,6 +360,7 @@ share to all worktrees:
 See the documentation of `extensions.worktreeConfig` in
 linkgit:git-config[1] for more details.
 
+[[DETAILS]]
 DETAILS
 -------
 Each linked worktree has a private sub-directory in the repository's
Documentation/gitremote-helpers.adoc +10 -5
index 39cdece16e..4d794f32ad 100644
@@ -86,7 +86,7 @@ Capabilities
 
 Each remote helper is expected to support only a subset of commands.
 The operations a helper supports are declared to Git in the response
-to the `capabilities` command (see COMMANDS, below).
+to the `capabilities` command (see <<COMMANDS,COMMANDS>>, below).
 
 In the following, we list all defined capabilities and for
 each we list which commands a helper with that capability
@@ -124,7 +124,7 @@ Supported commands: 'list for-push', 'export'.
 
 If a helper advertises 'connect', Git will use it if possible and
 fall back to another capability if the helper requests so when
-connecting (see the 'connect' command under COMMANDS).
+connecting (see the 'connect' command under <<COMMANDS,COMMANDS>>).
 When choosing between 'push' and 'export', Git prefers 'push'.
 Other frontends may have some other order of preference.
 
@@ -173,7 +173,7 @@ Supported commands: 'list', 'import'.
 
 If a helper advertises 'connect', Git will use it if possible and
 fall back to another capability if the helper requests so when
-connecting (see the 'connect' command under COMMANDS).
+connecting (see the 'connect' command under <<COMMANDS,COMMANDS>>).
 When choosing between 'fetch' and 'import', Git prefers 'fetch'.
 Other frontends may have some other order of preference.
 
@@ -246,6 +246,7 @@ the remote repository.
 	side using an explicit hash algorithm extension.
 
 
+[[COMMANDS]]
 COMMANDS
 --------
 
@@ -269,8 +270,10 @@ Support for this command is mandatory.
 	unrecognized attributes are ignored. The list ends with a
 	blank line.
 +
-See REF LIST ATTRIBUTES for a list of currently defined attributes.
-See REF LIST KEYWORDS for a list of currently defined keywords.
+See <<REF_LIST_ATTRIBUTES,REF LIST ATTRIBUTES>> for a list of currently
+defined attributes.
+See <<REF_LIST_KEYWORDS,REF LIST KEYWORDS>> for a list of currently
+defined keywords.
 +
 Supported if the helper has the "fetch" or "import" capability.
 
@@ -435,6 +438,7 @@ completing a valid response for the current command.
 Additional commands may be supported, as may be determined from
 capabilities reported by the helper.
 
+[[REF_LIST_ATTRIBUTES]]
 REF LIST ATTRIBUTES
 -------------------
 
@@ -446,6 +450,7 @@ attributes are defined.
 	This ref is unchanged since the last import or fetch, although
 	the helper cannot necessarily determine what value that produced.
 
+[[REF_LIST_KEYWORDS]]
 REF LIST KEYWORDS
 -----------------
 
Documentation/gitsubmodules.adoc +6 -3
index 2082296199..8e8165637b 100644
@@ -21,7 +21,8 @@ A submodule is a repository embedded inside another repository.
 The submodule has its own history; the repository it is embedded
 in is called a superproject.
 
-On the filesystem, a submodule usually (but not always - see FORMS below)
+On the filesystem, a submodule usually
+(but not always - see <<FORMS,FORMS>> below)
 consists of (i) a Git directory located under the `$GIT_DIR/modules/`
 directory of its superproject, (ii) a working directory inside the
 superproject's working directory, and a `.git` file at the root of
@@ -102,8 +103,8 @@ remotes are configured in the submodule as usual in the `$GIT_DIR/config`
 file.
 
  * The configuration file `$GIT_DIR/config` in the superproject.
-   Git only recurses into active submodules (see "ACTIVE SUBMODULES"
-   section below).
+   Git only recurses into active submodules
+   (see <<ACTIVE_SUBMODULES,"ACTIVE SUBMODULES">> section below).
 +
 If the submodule is not yet initialized, then the configuration
 inside the submodule does not exist yet, so where to
@@ -122,6 +123,7 @@ If the submodule has never been initialized, this is the only place
 where submodule configuration is found. It serves as the last fallback
 to specify where to obtain the submodule from.
 
+[[FORMS]]
 FORMS
 -----
 
@@ -165,6 +167,7 @@ from another repository.
 To completely remove a submodule, manually delete
 `$GIT_DIR/modules/<name>/`.
 
+[[ACTIVE_SUBMODULES]]
 ACTIVE SUBMODULES
 -----------------
 
Documentation/gitworkflows.adoc +4 -2
index 59305265c5..4a4aea9fb4 100644
@@ -245,8 +245,9 @@ tag to the tip of 'master' indicating the release version:
 `git tag -s -m "Git X.Y.Z" vX.Y.Z master`
 =====================================
 
-You need to push the new tag to a public Git server (see
-"DISTRIBUTED WORKFLOWS" below). This makes the tag available to
+You need to push the new tag to a public Git server
+(see <<DISTRIBUTED_WORKFLOWS,"DISTRIBUTED WORKFLOWS">> below).
+This makes the tag available to
 others tracking your project. The push could also trigger a
 post-update hook to perform release-related items such as building
 release tarballs and preformatted documentation pages.
@@ -324,6 +325,7 @@ announcement is not necessary since 'seen' is a throw-away branch, as
 described above.
 
 
+[[DISTRIBUTED_WORKFLOWS]]
 DISTRIBUTED WORKFLOWS
 ---------------------
 
Documentation/howto/revert-a-faulty-merge.adoc +3 -2
index 19f59cc888..fc9a330e9c 100644
@@ -146,8 +146,8 @@ different resolution strategies:
    revert of a merge was rebuilt from scratch (i.e. rebasing and fixing,
    as you seem to have interpreted), then re-merging the result without
    doing anything else fancy would be the right thing to do.
-   (See the ADDENDUM below for how to rebuild a branch from scratch
-   without changing its original branching-off point.)
+   (See the <<ADDENDUM,ADDENDUM>> below for how to rebuild a branch
+   from scratch without changing its original branching-off point.)
 
 However, there are things to keep in mind when reverting a merge (and
 reverting such a revert).
@@ -184,6 +184,7 @@ ready yet, and I really need to undo _all_ of the merge"). So then you
 really should revert the merge, but when you want to re-do the merge, you
 now need to do it by reverting the revert.
 
+[[ADDENDUM]]
 ADDENDUM
 
 Sometimes you have to rewrite one of a topic branch's commits *and* you can't
Documentation/revisions.adoc +3 -1
index 3fbfbd3d5f..3bb6dc85b6 100644
@@ -1,3 +1,4 @@
+[[SPECIFYING_REVISIONS]]
 SPECIFYING REVISIONS
 --------------------
 
@@ -300,7 +301,8 @@ Dotted Range Notations
 The '..' (two-dot) Range Notation::
  The '{caret}r1 r2' set operation appears so often that there is a shorthand
  for it.  When you have two commits 'r1' and 'r2' (named according
- to the syntax explained in SPECIFYING REVISIONS above), you can ask
+ to the syntax explained in
+<<SPECIFYING_REVISIONS,SPECIFYING REVISIONS>> above), you can ask
  for commits that are reachable from r2 excluding those that are reachable
  from r1 by '{caret}r1 r2' and it can be written as 'r1..r2'.
 

base-commit: 3bc0341126508f78f5869cbfc0005e987efdf0c7

Signature · 1 line
gitgitgadget
#14 lore raw
Quoted 3 lines · Julia Evans via GitGitGadget

This version rewrites the commit message to be more accurate. The original message said that the problem was to do with included pages which wasn't true.

Thanks, it looks good to me.

-Peff

#15 lore raw

Rewriting the Git tutorial to cover less content

Hello!

I'm working on a patch series to replace gittutorial.adoc with a completely rewritten tutorial, since a lot has changed since it was originally written.

The new tutorial will cover much less material: just git init, git add, git commit, git status, git diff, git push, git config, and git remote add. One choice that might be controversial is that I'm not covering branches, though I think it would probably make sense to write a second tutorial on branches and using Git to collaborate later.

The reason to cover fewer commands is that even this smaller set of commands is a lot for beginners to absorb. I've already gotten feedback from a test reader that they appreciated the "you can stop here!" in the middle of the tutorial, since they didn't feel like they could absorb any more information at that point.

If you'd like, you can read the current draft here:
https://github.com/jvns/git/blob/git-tutorial/Documentation/gittutorial.adoc
I'm not looking for detailed feedback at this stage since I expect a lot of the details to change, and since right now I'm prioritizing feedback from Git beginners who are trying to learn Git for the first time from the tutorial.

But if folks have major objections to the high-level structure, let me know!

I'm excited about this direction, I've already gotten some positive feedback from test readers, like:

Quoted 1 line

I can say I liked this tutorial better than any of the other git tutorials I've tried.

and

Quoted 1 line

I really like the tutorial, it's easy to follow and I learned a lot!

I have some ideas for what to do with gittutorial-2 too but I'll leave that for another discussion.

thanks!
Julia

#16 lore raw

Re: Rewriting the Git tutorial to cover less content

Quoted 6 lines · Julia Evans

I'm working on a patch series to replace gittutorial.adoc with a completely rewritten tutorial, since a lot has changed since it was originally written.
...
I'm excited about this direction, I've already gotten some positive feedback from test readers, like:

Quoted 8 lines
Quoted 1 line

I can say I liked this tutorial better than any of the other git tutorials I've tried.

and

Quoted 1 line

I really like the tutorial, it's easy to follow and I learned a lot!

I have some ideas for what to do with gittutorial-2 too but I'll leave that for another discussion.

As long as it does not mean that learners now have to read three documents instead of two (i.e., your replacement, gittutorial.adoc, and gittutorial-2.adoc), I am also excited.

Omitting some material that is covered in the current tutorial from the new one would mean that the topics covered by the remainder of the current tutorial have to be sifted into three buckets: one that is to be discarded because it is no longer useful to the target audience, another that needs to be described somewhere in our documentation set, and the rest that need to be taught elsewhere, though that may be beyond the scope of the project documentation and better left to other projects that produce "books on Git". It is somewhat unclear from your description what your plan is to cover other topics that should still be taught.

As we reached consensus at the contributors' summit, we should wean ourselves away from the mindset that these tutorial materials can be incrementally polished to match today's needs, so if the plan for 'the rest' is also to write on these topics from the ground up, that would be very good.

Thanks.

#17 lore raw

Re: Rewriting the Git tutorial to cover less content

Quoted 6 lines

Omitting some material that is covered in the current tutorial from the new one would mean that the topics covered by the remainder of the current tutorial have to be sifted into three buckets: one that is to be discarded because it is no longer useful to the target audience, another that needs to be described somewhere in our documentation set, and the rest that need to be taught elsewhere,

I do think there's a cost to keeping guides around that are outdated and difficult for users to understand.

For example right now man git says:

Quoted 2 lines

See gittutorial(7) to get started, then see giteveryday(7) for a useful minimum set of commands.

This is a nice friendly statement, but in my opinion gittutorial and giteveryday really do not live up to what it promises, and I think it undermines trust in the documentation.

Quoted 4 lines

though that may be beyond the scope of the project documentation and better left to other projects that produce "books on Git". It is somewhat unclear from your description what your plan is to cover other topics that should still be taught.

I see a couple of possible strategies.

* We can write new guides which are clearer
* We can link to outside resources (via https://git-scm.com/learn)
which we think do a good job. Right now that page is pretty out of date and it would be very easy to improve.

I think a mix of both is probably most realistic right now.

#18 lore raw

Re: Rewriting the Git tutorial to cover less content

Quoted 5 lines · Julia Evans
Quoted 2 lines

See gittutorial(7) to get started, then see giteveryday(7) for a useful minimum set of commands.

This is a nice friendly statement, but in my opinion gittutorial and giteveryday really do not live up to what it promises, ...

Yes, it outlived its time and the world has moved on.

Quoted 8 lines

I see a couple of possible strategies.

* We can write new guides which are clearer
* We can link to outside resources (via https://git-scm.com/learn)
which we think do a good job. Right now that page is pretty out of date and it would be very easy to improve.

I think a mix of both is probably most realistic right now.

Whatever we do, it is not enough that new guides are more clear than the current one. The goal should be that it also is sufficient to replace the current one. Removing the stale and unuseful document can be made the primary goal, and a new document may be a means to do so ;-).

I do not know if we have bandwidth to keep external links fresh, and having a set of links to stale pages ourselves may hurt more than help.

Thanks.

#19 lore raw

Re: Rewriting the Git tutorial to cover less content

Quoted 17 lines · Junio C Hamano
Quoted 5 lines · Julia Evans
Quoted 2 lines

See gittutorial(7) to get started, then see giteveryday(7) for a useful minimum set of commands.

This is a nice friendly statement, but in my opinion gittutorial and giteveryday really do not live up to what it promises, ...

Yes, it outlived its time and the world has moved on.

Quoted 7 lines

I see a couple of possible strategies.

* We can write new guides which are clearer
* We can link to outside resources (via https://git-scm.com/learn)
which we think do a good job. Right now that page is pretty out of date and it would be very easy to improve.

Quoted 5 lines
Quoted 1 line

I think a mix of both is probably most realistic right now.

Whatever we do, it is not enough that new guides are more clear than the current one. The goal should be that it also is sufficient to replace the current one.

I don't understand what you mean by "replace the current one". Some interpretations I can imagine:

1. The documentation remains internally consistent, like if it says "see <page> for <information>", then the information is in fact on that page
2. Any information explained in a guide must always be explained a in some guide in the future
3. We should aim to make guides more _useful_ over time: on average, a user reading the new version of the guide should come away having learned more relevant-to-them information about Git than with the old guide.
4. The original intent of a guide needs to be maintained.

I imagine everyone agrees that #1 is important. I spend most of my time thinking about how to do a good job of #3.

Quoted 3 lines

I do not know if we have bandwidth to keep external links fresh, and having a set of links to stale pages ourselves may hurt more than help.

We've had a list of links like this since 2013, at https://git-scm.com/doc/ext.
It definitely has broken links and it would be pretty easy to update some of them once, which would help in the short term.

#20 lore raw

Re: Rewriting the Git tutorial to cover less content

Quoted 1 line · Julia Evans

I don't understand what you mean by "replace the current one".

If giteveryday for example is so stale and unusable, we should drop the entire file. If there were some topics in there that can be salvagd, we should freshly explain these topics elsewhere in our documentation, and starting a new document is one way to do so. Then we "replaced" the current "giteveryday" with something else.

Quoted 12 lines

Some interpretations I can imagine:

1. The documentation remains internally consistent, like if it says "see <page> for <information>", then the information is in fact on that page
2. Any information explained in a guide must always be explained a in some guide in the future
3. We should aim to make guides more _useful_ over time: on average, a user reading the new version of the guide should come away having learned more relevant-to-them information about Git than with the old guide.
4. The original intent of a guide needs to be maintained.

Quoted 7 lines
Quoted 3 lines

I do not know if we have bandwidth to keep external links fresh, and having a set of links to stale pages ourselves may hurt more than help.

We've had a list of links like this since 2013, at https://git-scm.com/doc/ext.
It definitely has broken links and it would be pretty easy to update some of them once, which would help in the short term.

Dealing with broken links is easier as we can just remove them. Noticing a link that points at an unmaintained stale document that describes what used to be relevant but no longer in today's environment and replacing it with something more relevant was what I am worried about.

#21 lore raw

Re: Rewriting the Git tutorial to cover less content

Quoted 5 lines

Dealing with broken links is easier as we can just remove them. Noticing a link that points at an unmaintained stale document that describes what used to be relevant but no longer in today's environment and replacing it with something more relevant was what I am worried about.

Thanks, this is helpful. Let me try to rephrase to see if I understand, let me know if I'm understanding wrong.

When possible, it's better to split up changes into smaller pieces so that they can be reviewed more easily.

For this change, it would help to split it up into two different patch series:
"remove tutorial" and "add new tutorial", where the first patch series deletes all references to the tutorial. If we do it this way, we can both make sure that there isn't any content that we regret deleting, and lets us take a look at the documents that reference the tutorial too.

- Julia

#22 lore raw

Re: Rewriting the Git tutorial to cover less content

Quoted 8 lines · Julia Evans
Quoted 5 lines

Dealing with broken links is easier as we can just remove them. Noticing a link that points at an unmaintained stale document that describes what used to be relevant but no longer in today's environment and replacing it with something more relevant was what I am worried about.

Thanks, this is helpful. Let me try to rephrase to see if I understand, let me know if I'm understanding wrong.

In the above, I was talking about the reference links that are stale at https://git-scm.com/doc/ext which you mentioned. You said that it is easy to update broken links there. I wanted to point out that there are two kinds of staleness, one that you can validate by clicking on the link and seeing 404 (your "easy" kind), and the other that you have to read what you are given by clicking on the link and evaluate its relevance in today's world (which is much harder).

So, while I do agree with everything you said in the two paragraphs below, I do not think these two paragraphs have any rephrased version of what I wanted to say ?-).

Quoted 8 lines

When possible, it's better to split up changes into smaller pieces so that they can be reviewed more easily.

For this change, it would help to split it up into two different patch series:
"remove tutorial" and "add new tutorial", where the first patch series deletes all references to the tutorial. If we do it this way, we can both make sure that there isn't any content that we regret deleting, and lets us take a look at the documents that reference the tutorial too.

Yes, feeding smaller independent pieces is a format that is easier to review. If the end result is that the old tutorial is gone and replaced by the new tutorial, that would be what we want. When we added gittutorial-2, we did not remove gittutorial, probably because nobody had the guts to say "let's rip out what Linus wrote, it is so out of date and gives much less relevant information useful in today's world".

I do not want to repeat that; it is like https://xkcd.com/927/.