From: Jeff King <peff@peff.net>
To: Julia Evans via GitGitGadget <gitgitgadget@gmail.com>
Cc: git@vger.kernel.org, Julia Evans <julia@jvns.ca>
Subject: Re: [PATCH] doc: add more AsciiDoc cross-references
Date: Wed, 23 Sep 2026 18:00:53 -0400 [thread overview]
Message-ID: <20260923220053.GB49087@coredump.intra.peff.net> (raw)
In-Reply-To: <pull.2416.git.git.1790105342890.gitgitgadget@gmail.com>
On Tue, Sep 22, 2026 at 07:29:02PM +0000, Julia Evans via GitGitGadget wrote:
> diff --git a/Documentation/git-add.adoc b/Documentation/git-add.adoc
> index 16b06e38e1..906db7ccf3 100644
> --- a/Documentation/git-add.adoc
> +++ b/Documentation/git-add.adoc
> @@ -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
> ---------------
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. ;)
> -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:
> - `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
next prev parent reply other threads:[~2026-09-23 22:00 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-22 19:29 [PATCH] doc: add more AsciiDoc cross-references Julia Evans via GitGitGadget
2026-09-22 20:20 ` Junio C Hamano
2026-09-22 20:54 ` Julia Evans
2026-09-23 21:40 ` Jeff King
2026-09-24 12:30 ` Julia Evans
2026-09-24 15:55 ` Jeff King
2026-09-24 17:15 ` Junio C Hamano
2026-09-24 17:22 ` Julia Evans
2026-09-24 18:17 ` Junio C Hamano
2026-09-24 18:42 ` Jeff King
2026-09-23 19:06 ` Kristoffer Haugsbakk
2026-09-23 22:00 ` Jeff King [this message]
2026-09-25 0:52 ` [PATCH v2] " Julia Evans via GitGitGadget
2026-09-25 8:27 ` Jeff King
2026-09-25 16:08 ` Rewriting the Git tutorial to cover less content Julia Evans
2026-09-25 16:47 ` Junio C Hamano
2026-09-25 17:25 ` Julia Evans
2026-09-25 18:23 ` Junio C Hamano
2026-09-25 19:22 ` Julia Evans
2026-09-25 19:34 ` Junio C Hamano
2026-09-28 12:21 ` Julia Evans
2026-09-28 15:16 ` Junio C Hamano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260923220053.GB49087@coredump.intra.peff.net \
--to=peff@peff.net \
--cc=git@vger.kernel.org \
--cc=gitgitgadget@gmail.com \
--cc=julia@jvns.ca \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox