Skip to content

Commit a65cbd8

Browse files
peffgitster
authored andcommitted
gitglossary: fix indentation of sub-lists
The glossary entry is a list of terms and their definitions, so multi-paragraph definitions need "+" continuation lines to indicate that they are part of a single entry. When an entry contains a sub-list (say, a bulleted list), the final "+" may become ambiguous: is it connecting the next paragraph to the final entry of the sub-list, or to the original list of definition paragraphs? Asciidoc generally connects it to the former, even when we mean the latter, and you end up with the next paragraph indented incorrectly, like this: glob ...defines glob... Two consecutive asterisks ("**") in patterns matched against full pathname may have special meaning: - ...some special meaning of **... - ...another special meaning of **... - Other consecutive asterisks are considered invalid. Glob magic is incompatible with literal magic. That final "Glob magic is incompatible" paragraph is in the wrong spot. It should be at the same level as "Two consecutive asterisks", as it is not part of the final "Other consecutive asterisks" bullet point. The same problem appears in several other spots in the glossary. Usually we'd fix this by using "--" markers, which put the sub-list into its own block. But there's a catch: in some of these spots we are already in an open block, and nesting open blocks is a problem. It seems to work for me using Asciidoc 10.2.1, but Asciidoctor 2.0.26 makes a mess of it (our intent to open a new block seems to close the old one). Fortunately there's a work-around: when using a "+" list-continuation, the number of empty lines above the continuation indicates which level of parent list to continue. So by adding an empty line after our unordered list (before the "+"), we should be able to continue the definition list item. But asciidoc being asciidoc, of course that is not the end of the story. That technique works fine for the "glob" and "attr" lists in this patch, but under the "refs" item it works for only 1 of the 2 lists! I can't figure out why, and this may be an asciidoctor bug. But we can work around it by using "--" open-block markers here, since we're not already in an open block. So using the extra blank line for the first two instances, and "--" markers for the second two, this patch produces identical output from "doc-diff HEAD^ HEAD" for both --asciidoctor and --asciidoc modes. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent 67ad421 commit a65cbd8

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

Documentation/glossary-content.adoc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -430,6 +430,7 @@ full pathname may have special meaning:
430430
matches "`a/b`", "`a/x/b`", "`a/x/y/b`" and so on.
431431

432432
- Other consecutive asterisks are considered invalid.
433+
433434
+
434435
Glob magic is incompatible with literal magic.
435436

@@ -452,6 +453,7 @@ these forms:
452453

453454
- "`!ATTR`" requires that the attribute `ATTR` be
454455
unspecified.
456+
455457
+
456458
Note that when matching against a tree object, attributes are still
457459
obtained from working tree, not from the given tree object.
@@ -560,14 +562,17 @@ The ref namespace is hierarchical.
560562
Ref names must either start with `refs/` or be located in the root of
561563
the hierarchy. For the latter, their name must follow these rules:
562564
+
565+
--
563566
- The name consists of only upper-case characters or underscores.
564567

565568
- The name ends with "`_HEAD`" or is equal to "`HEAD`".
569+
--
566570
+
567571
There are some irregular refs in the root of the hierarchy that do not
568572
match these rules. The following list is exhaustive and shall not be
569573
extended in the future:
570574
+
575+
--
571576
- `AUTO_MERGE`
572577

573578
- `BISECT_EXPECTED_REV`
@@ -577,6 +582,7 @@ extended in the future:
577582
- `NOTES_MERGE_REF`
578583

579584
- `MERGE_AUTOSTASH`
585+
--
580586
+
581587
Different subhierarchies are used for different purposes. For example,
582588
the `refs/heads/` hierarchy is used to represent local branches whereas

0 commit comments

Comments
 (0)