]> git.ipfire.org Git - thirdparty/git.git/commit
doc: check well-formedness of delimited sections
authorJean-Noël Avila <jn.avila@free.fr>
Mon, 11 Aug 2025 20:53:16 +0000 (20:53 +0000)
committerJunio C Hamano <gitster@pobox.com>
Mon, 11 Aug 2025 21:16:03 +0000 (14:16 -0700)
commit63d33eb7f6ba315c3ecdda63295d9f915d184fcd
tree69971ca3b9be15cb8b5000362bd1825920ad1a6a
parentf81a574f59a61dd85ee918f8759a624d33f3539e
doc: check well-formedness of delimited sections

Having an empty line before each delimited sections is not required by
asciidoc, but it is a safety measure that prevents generating malformed
asciidoc when generating translated documentation.

When a delimited section appears just after a paragraph, the asciidoc
processor checks that the length of the delimited section header is
different from the length of the paragraph. If it is not, the asciidoc
processor will generate a title. In the original English documentation, this
is not a problem because the authors always check the output of the asciidoc
processor and fix the length of the delimited section header if it turns out
to be the same as the paragraph length. However, this is not the case for
translations, where the authors have no way to check the length of the
delimited section header or the output of the asciidoc processor. This can
lead to a section title that is not intended.

Indeed, this test also checks that titles are correctly formed, that is,
the length of the underline is equal to the length of the title (otherwise
it would not be a title but a section header).

Finally, this test checks that the delimited section are terminated within
the same file.

Signed-off-by: Jean-Noël Avila <jn.avila@free.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 files changed:
Documentation/Makefile
Documentation/RelNotes/1.6.2.4.adoc
Documentation/diff-format.adoc
Documentation/git-commit.adoc
Documentation/git-fast-import.adoc
Documentation/git-p4.adoc
Documentation/git-rebase.adoc
Documentation/git-svn.adoc
Documentation/gitprotocol-http.adoc
Documentation/gitsubmodules.adoc
Documentation/lint-delimited-sections.perl [new file with mode: 0755]
Documentation/mergetools/vimdiff.adoc
Documentation/technical/long-running-process-protocol.adoc
shared.mak