git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v8 06/12] docs: move commit-graph format docs to man section 5

From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Date
Nov 9, 2022, 01:34 UTC
Message-ID
<221109.86bkpgriso.gmgdl@evledraar.gmail.com>
In-Reply-To
<20221108212741.GC1731@szeder.dev>
On Tue, Nov 08 2022, SZEDER Gábor wrote:
Show 43 quoted lines
> On Tue, Nov 08, 2022 at 08:16:49PM +0100, Ævar Arnfjörð Bjarmason wrote:
>> 
>> On Tue, Nov 08 2022, SZEDER Gábor wrote:
>> 
>> > On Thu, Aug 04, 2022 at 06:28:35PM +0200, Ævar Arnfjörð Bjarmason wrote:
>> >> Continue the move of existing Documentation/technical/* protocol and
>> >> file-format documentation into our main documentation space.
>> >> 
>> >> By moving the documentation for the commit-graph format into man
>> >> section 5 and the new "developerinterfaces" category. This change is
>> >> split from subsequent commits due to the relatively large amount of
>> >> ASCIIDOC formatting changes that are required.
>> >
>> > So after this series I got a couple of gitformat-* manpages, but,
>> > alas, most of them render improperly: a lot of paragraphs are for some
>> > reason fixed width even in a fullscreen terminal window, and their
>> > width is more than 80 chars, so they are rather awkward in a
>> > standard-width terminal.  This also affects the html version, where
>> > those paragraphs are rendered with a fixed-width font.
>> 
>> Do you have examples of that
>
> Here's the description of two chunks copy-pasted from 'man
> gitformat-commit-graph' in a full-screen terminal, the first being
> properly formatted (i.e. line length adjusted to the width of the
> terminal), the latter having fixed-width:
>
>        Generation Data Overflow (ID: {G, D, O, 2 }) [Optional]
>            •   This list of 8-byte values stores the corrected commit date offsets for commits with corrected commit date offsets that cannot be stored within 31 bits.
>
>            •   Generation Data Overflow chunk is present only when Generation Data chunk is present and atleast one corrected commit date offset cannot be stored within 31 bits.
>
>        Extra Edge List (ID: {E, D, G, E}) [Optional]
>                This list of 4-byte values store the second through nth parents for
>                all octopus merges. The second parent value in the commit data stores
>                an array position within this list along with the most-significant bit
>                on. Starting at that array position, iterate through this list of commit
>                positions for the parents until reaching a value with the most-significant
>                bit on. The other bits correspond to the position of the last parent.
>
> There are similar formating issues in 'gitformat-index' and
> 'gitformat-pack' as well.  I can see these both with AsciiDoc and
> Asciidoctor.
Yeah, they look pretty bad.
Show 8 quoted lines
>> and are these cases where the formatting
>> was different before the move from Documentation/technical/*
>> 
>> I'm aware of e.g. gitformat-commit-graph(5) being somewhat funny, and
>> may have missed some cases, but I think that was also the case before...
>
> I'm not sure about "before", because 'make man' never built and
> installed these gitformat-* manpages before this series.
In the case of "gitformat-commit-graph" there was never a "html" version
of it before c0f6dd49f19 (Merge branch 'ab/tech-docs-to-help',
2022-08-14). But if you check out c0f6dd49f19^1 and:
	
	diff --git a/Documentation/Makefile b/Documentation/Makefile
	index 4f801f4e4c9..d7a066a68d0 100644
	--- a/Documentation/Makefile
	+++ b/Documentation/Makefile
	@@ -96,6 +96,7 @@ TECH_DOCS += SubmittingPatches
	 TECH_DOCS += ToolsForGit
	 TECH_DOCS += technical/bitmap-format
	 TECH_DOCS += technical/bundle-format
	+TECH_DOCS += technical/commit-graph-format
	 TECH_DOCS += technical/cruft-packs
	 TECH_DOCS += technical/hash-function-transition
	 TECH_DOCS += technical/http-protoco

Then "make html" you'll see what the formatting was like before. Here's generated versions of those & git-scm.com's version for comparison:

	https://vm.nix.is/~avar/noindex/2022-11-09-gitdocs/commit-graph-format.html
	https://git-scm.com/docs/gitformat-commit-graph
        https://vm.nix.is/~avar/noindex/2022-11-09-gitdocs/index-format.html
	https://git-scm.com/docs/gitformat-index
        https://vm.nix.is/~avar/noindex/2022-11-09-gitdocs/pack-format.html
        https://git-scm.com/docs/gitformat-pack

They should obviously be fixed, but I left that out of scope of that series. If it was a fix-syntax-nits-while-at-it it would have been a lot longer, and some of it's in some pseudo-syntax that was never quite valid markdown. E.g. commit-graph-format.txt tried to use link:* syntax in block-quoted text.

What I found *mostly* worked was to use "==" for sections, which e.g. for gitformat-commit-graph ends up formatting it nicely as long as it's followed by a bullet-point list, but as you show with "This lits of 4-byte..." that doesn't do the trick when it's not a list, instead it uses the literal formatting (which almost the entire body of the text used before).

I think the most minimal way of fixing it is to de-indent the opening
line of those sections, e.g.:
	
	diff --git a/Documentation/gitformat-commit-graph.txt b/Documentation/gitformat-commit-graph.txt
	index 31cad585e23..84df4a3ed03 100644
	--- a/Documentation/gitformat-commit-graph.txt
	+++ b/Documentation/gitformat-commit-graph.txt
	@@ -67,17 +67,17 @@ All multi-byte numbers are in network byte order.
	 
	 === CHUNK LOOKUP:
	 
	-  (C + 1) * 12 bytes listing the table of contents for the chunks:
	+(C + 1) * 12 bytes listing the table of contents for the chunks:
	       First 4 bytes describe the chunk id. Value 0 is a terminating label.
	       Other 8 bytes provide the byte-offset in current file for chunk to
	       start. (Chunks are ordered contiguously in the file, so you can infer
	       the length using the next chunk position if necessary.) Each chunk
	       ID appears at most once.
	 
	-  The CHUNK LOOKUP matches the table of contents from
	+The CHUNK LOOKUP matches the table of contents from
	   the chunk-based file format, see linkgit:gitformat-chunk[5]
	 
	-  The remaining data in the body is described one chunk at a time, and
	+The remaining data in the body is described one chunk at a time, and
	   these chunks may be given in any order. Chunks are required unless
	   otherwise specified.
	 
	@@ -126,7 +126,7 @@ All multi-byte numbers are in network byte order.
	       be stored within 31 bits.
	 
	 ==== Extra Edge List (ID: {'E', 'D', 'G', 'E'}) [Optional]
	-      This list of 4-byte values store the second through nth parents for
	+This list of 4-byte values store the second through nth parents for
	       all octopus merges. The second parent value in the commit data stores
	       an array position within this list along with the most-significant bit
	       on. Starting at that array position, iterate through this list of commit
	
Seems to fix those "flow" issues for me, i.e. it's now a normal
paragraph, instead of a block-quoted fixed-width text.
Previous: SZEDER GáborNext: Ævar Arnfjörð Bjarmason
Message 97 of 112 in “git(1) doc + "git help": split-out user & git format docs”
  1. 0/2 git(1) doc + "git help": split-out user & git format docsÆvar Arnfjörð Bjarmason, Oct 15, 2021
  2. 1/2 git(1) docs: split "User-facing file formats" off from "Guides"Ævar Arnfjörð Bjarmason, Oct 15, 2021
  3. 2/2 git(1) docs: create a "Git file and wire formats" sectionÆvar Arnfjörð Bjarmason, Oct 15, 2021
  4. 0/5 git doc + "git help": move "format" docs from technical/*Ævar Arnfjörð Bjarmason, Dec 12, 2021
  5. 1/5 git docs: split "User-facing file formats" off from "Guides"Ævar Arnfjörð Bjarmason, Dec 12, 2021
  6. 2/5 git docs: create a "Git file and wire formats" sectionÆvar Arnfjörð Bjarmason, Dec 12, 2021
  7. Eric SunshineDec 12, 2021
  8. Ævar Arnfjörð BjarmasonDec 13, 2021
  9. 3/5 docs: move commit-graph format docs to man section 5Ævar Arnfjörð Bjarmason, Dec 12, 2021
  10. 4/5 docs: move protocol-related docs to man section 5Ævar Arnfjörð Bjarmason, Dec 12, 2021
  11. 5/5 docs: move {index,signature,bitmap,chunk}-format docs to man section 5Ævar Arnfjörð Bjarmason, Dec 12, 2021
  12. 0/7 git doc + "git help": move "format" docs from technical/*Ævar Arnfjörð Bjarmason, Jul 12, 2022
  13. 1/7 git docs: split "User-facing file formats" off from "Guides"Ævar Arnfjörð Bjarmason, Jul 12, 2022
  14. Ævar Arnfjörð BjarmasonJul 13, 2022
  15. 2/7 git docs: create a "Git file formats and protocols" sectionÆvar Arnfjörð Bjarmason, Jul 12, 2022
  16. 3/7 docs: move commit-graph format docs to man section 5Ævar Arnfjörð Bjarmason, Jul 12, 2022
  17. 4/7 docs: move protocol-related docs to man section 5Ævar Arnfjörð Bjarmason, Jul 12, 2022
  18. 5/7 docs: move pack format docs to man section 5Ævar Arnfjörð Bjarmason, Jul 12, 2022
  19. 6/7 docs: move http-protocol docs to man section 5Ævar Arnfjörð Bjarmason, Jul 12, 2022
  20. 7/7 docs: move multi-pack-index docs to man section 5Ævar Arnfjörð Bjarmason, Jul 12, 2022
  21. 0/8 git doc + "git help": move "format" docs from technical/*Ævar Arnfjörð Bjarmason, Jul 18, 2022
  22. 1/8 help.c: BUG() out if "help --guides" can't remove "git" prefixesÆvar Arnfjörð Bjarmason, Jul 18, 2022
  23. Junio C HamanoJul 18, 2022
  24. 2/8 git docs: split "User-facing file formats" off from "Guides"Ævar Arnfjörð Bjarmason, Jul 18, 2022
  25. Junio C HamanoJul 18, 2022
  26. Ævar Arnfjörð BjarmasonJul 18, 2022
  27. Junio C HamanoJul 19, 2022
  28. Ævar Arnfjörð BjarmasonJul 21, 2022
  29. 3/8 git docs: create a "Git file formats and protocols" sectionÆvar Arnfjörð Bjarmason, Jul 18, 2022
  30. 4/8 docs: move commit-graph format docs to man section 5Ævar Arnfjörð Bjarmason, Jul 18, 2022
  31. 5/8 docs: move protocol-related docs to man section 5Ævar Arnfjörð Bjarmason, Jul 18, 2022
  32. 7/8 docs: move http-protocol docs to man section 5Ævar Arnfjörð Bjarmason, Jul 18, 2022
  33. 8/8 docs: move multi-pack-index docs to man section 5Ævar Arnfjörð Bjarmason, Jul 18, 2022
  34. 6/8 docs: move pack format docs to man section 5Ævar Arnfjörð Bjarmason, Jul 18, 2022
  35. Junio C HamanoJul 18, 2022
  36. Ævar Arnfjörð BjarmasonJul 18, 2022
  37. Ævar Arnfjörð BjarmasonJul 21, 2022
  38. 0/9 docs: create & use "(user|developer) interfaces" categoriesÆvar Arnfjörð Bjarmason, Jul 21, 2022
  39. 1/9 help.c: BUG() out if "help --guides" can't remove "git" prefixesÆvar Arnfjörð Bjarmason, Jul 21, 2022
  40. 2/9 git help doc: use "<doc>" instead of "<guide>"Ævar Arnfjörð Bjarmason, Jul 21, 2022
  41. 3/9 git docs: add a category for user-facing file, repo and command UXÆvar Arnfjörð Bjarmason, Jul 21, 2022
  42. 4/9 git docs: add a category for file formats, protocols and interfacesÆvar Arnfjörð Bjarmason, Jul 21, 2022
  43. Eric SunshineJul 21, 2022
  44. 5/9 docs: move commit-graph format docs to man section 5Ævar Arnfjörð Bjarmason, Jul 21, 2022
  45. 6/9 docs: move protocol-related docs to man section 5Ævar Arnfjörð Bjarmason, Jul 21, 2022
  46. 7/9 docs: move pack format docs to man section 5Ævar Arnfjörð Bjarmason, Jul 21, 2022
  47. 8/9 docs: move http-protocol docs to man section 5Ævar Arnfjörð Bjarmason, Jul 21, 2022
  48. 9/9 docs: move multi-pack-index docs to man section 5Ævar Arnfjörð Bjarmason, Jul 21, 2022
  49. Junio C HamanoJul 21, 2022
  50. 0/9 docs: create & use "(user|developer) interfaces" categoriesÆvar Arnfjörð Bjarmason, Jul 28, 2022
  51. 1/9 help.c: BUG() out if "help --guides" can't remove "git" prefixesÆvar Arnfjörð Bjarmason, Jul 28, 2022
  52. Junio C HamanoJul 30, 2022
  53. Ævar Arnfjörð BjarmasonAug 1, 2022
  54. Junio C HamanoAug 1, 2022
  55. 2/9 git help doc: use "<doc>" instead of "<guide>"Ævar Arnfjörð Bjarmason, Jul 28, 2022
  56. 3/9 git docs: add a category for user-facing file, repo and command UXÆvar Arnfjörð Bjarmason, Jul 28, 2022
  57. 4/9 git docs: add a category for file formats, protocols and interfacesÆvar Arnfjörð Bjarmason, Jul 28, 2022
  58. 5/9 docs: move commit-graph format docs to man section 5Ævar Arnfjörð Bjarmason, Jul 28, 2022
  59. 6/9 docs: move protocol-related docs to man section 5Ævar Arnfjörð Bjarmason, Jul 28, 2022
  60. 7/9 docs: move pack format docs to man section 5Ævar Arnfjörð Bjarmason, Jul 28, 2022
  61. 8/9 docs: move http-protocol docs to man section 5Ævar Arnfjörð Bjarmason, Jul 28, 2022
  62. 9/9 docs: move multi-pack-index docs to man section 5Ævar Arnfjörð Bjarmason, Jul 28, 2022
  63. Junio C HamanoJul 28, 2022
  64. 00/10 docs: create & use "(user|developer) interfaces" categoriesÆvar Arnfjörð Bjarmason, Aug 2, 2022
  65. 01/10 help.c: refactor drop_prefix() to use a "switch" statement"Ævar Arnfjörð Bjarmason, Aug 2, 2022
  66. Junio C HamanoAug 2, 2022
  67. 02/10 help.c: remove common category behavior from drop_prefix() behaviorÆvar Arnfjörð Bjarmason, Aug 2, 2022
  68. 03/10 git help doc: use "<doc>" instead of "<guide>"Ævar Arnfjörð Bjarmason, Aug 2, 2022
  69. 04/10 git docs: add a category for user-facing file, repo and command UXÆvar Arnfjörð Bjarmason, Aug 2, 2022
  70. 05/10 git docs: add a category for file formats, protocols and interfacesÆvar Arnfjörð Bjarmason, Aug 2, 2022
  71. Junio C HamanoAug 2, 2022
  72. 06/10 docs: move commit-graph format docs to man section 5Ævar Arnfjörð Bjarmason, Aug 2, 2022
  73. Junio C HamanoAug 3, 2022
  74. 07/10 docs: move protocol-related docs to man section 5Ævar Arnfjörð Bjarmason, Aug 2, 2022
  75. Junio C HamanoAug 3, 2022
  76. Ævar Arnfjörð BjarmasonAug 4, 2022
  77. Junio C HamanoAug 4, 2022
  78. Ævar Arnfjörð BjarmasonAug 5, 2022
  79. 09/10 docs: move http-protocol docs to man section 5Ævar Arnfjörð Bjarmason, Aug 2, 2022
  80. Junio C HamanoAug 3, 2022
  81. 08/10 docs: move pack format docs to man section 5Ævar Arnfjörð Bjarmason, Aug 2, 2022
  82. Junio C HamanoAug 3, 2022
  83. 10/10 docs: move multi-pack-index docs to man section 5Ævar Arnfjörð Bjarmason, Aug 2, 2022
  84. Junio C HamanoAug 3, 2022
  85. 00/12 docs: create & use "(user|developer) interfaces" categoriesÆvar Arnfjörð Bjarmason, Aug 4, 2022
  86. 01/12 help.c: refactor drop_prefix() to use a "switch" statement"Ævar Arnfjörð Bjarmason, Aug 4, 2022
  87. Junio C HamanoAug 4, 2022
  88. 02/12 help.c: remove common category behavior from drop_prefix() behaviorÆvar Arnfjörð Bjarmason, Aug 4, 2022
  89. 03/12 git help doc: use "<doc>" instead of "<guide>"Ævar Arnfjörð Bjarmason, Aug 4, 2022
  90. 04/12 git docs: add a category for user-facing file, repo and command UXÆvar Arnfjörð Bjarmason, Aug 4, 2022
  91. 05/12 git docs: add a category for file formats, protocols and interfacesÆvar Arnfjörð Bjarmason, Aug 4, 2022
  92. 06/12 docs: move commit-graph format docs to man section 5Ævar Arnfjörð Bjarmason, Aug 4, 2022
  93. Junio C HamanoAug 4, 2022
  94. SZEDER GáborNov 8, 2022
  95. Ævar Arnfjörð BjarmasonNov 8, 2022
  96. SZEDER GáborNov 8, 2022
  97. Ævar Arnfjörð BjarmasonNov 9, 2022
  98. docs: de-indent first paragraph of gitformat-* to flow the textÆvar Arnfjörð Bjarmason, Nov 21, 2022
  99. Jeff KingNov 21, 2022
  100. Junio C HamanoNov 22, 2022
  101. 08/12 docs: move index format docs to man section 5Ævar Arnfjörð Bjarmason, Aug 4, 2022
  102. Junio C HamanoAug 4, 2022
  103. 09/12 docs: move signature docs to man section 5Ævar Arnfjörð Bjarmason, Aug 4, 2022
  104. Junio C HamanoAug 4, 2022
  105. 07/12 docs: move protocol-related docs to man section 5Ævar Arnfjörð Bjarmason, Aug 4, 2022
  106. 10/12 docs: move pack format docs to man section 5Ævar Arnfjörð Bjarmason, Aug 4, 2022
  107. 11/12 docs: move cruft pack docs to gitformat-packÆvar Arnfjörð Bjarmason, Aug 4, 2022
  108. Junio C HamanoAug 4, 2022
  109. Ævar Arnfjörð BjarmasonAug 5, 2022
  110. Junio C HamanoAug 5, 2022
  111. 12/12 docs: move http-protocol docs to man section 5Ævar Arnfjörð Bjarmason, Aug 4, 2022
  112. Junio C HamanoAug 4, 2022

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.