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

Re: [PATCH 1/2] doc: git-checkout: trivial callout cleanup

From
Felipe Contreras <felipe.contreras@gmail.com>
Date
Apr 24, 2023, 13:28 UTC
Message-ID
<644684018a766_aba29424@chronos.notmuch>
In-Reply-To
<xmqq8ren8xz1.fsf@gitster.g>
Junio C Hamano wrote:
Show 15 quoted lines
> Felipe Contreras <felipe.contreras@gmail.com> writes:
> 
> > The callouts are directly tied to the listing above, remove spaces to
> > make it clear they are one and the same.
> >
> > Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
> > ---
> >  Documentation/git-checkout.txt | 4 ----
> >  1 file changed, 4 deletions(-)
> 
> I tried to format git-checkout.1 and git-checkout.html from HEAD and
> HEAD^ after applying this step, with asciidoc and asciidoctor, and
> did not see any difference that came from this patch.  Am I correct
> to understand that this patch is done purely for the benefit of
> human readers, and not for formatting machinery?
No, it's for the formatting machinery.

The fact that both asciidoc and asciidoctor happen to understand our quircky formatting in this particualr situation doesn't mean it isn't quirky.

In this particular case the parsers do understand what we are trying to do, because we just just pepper list continuations (`+`) everywhere and it happens to work.

This works:
  1. item
  +
  ----
  line 1 <1>
  ----
  +
  <1> callout 1
But if we used an open block instead (which is more propper), this does not:
  1. item
  +
  --
  ----
  line 1 <1>
  ----
  +
  <1> callout 1
  --
This discrepancy confused Jeff in [1].
[1] https://lore.kernel.org/git/20230418061713.GA169940@coredump.intra.peff.net/
> It may be subjective for those who read the source if it is easier
> to read with or without inter-paragraph spaces, but in any case, the
> resulting source material now look the same way between two hunks,
> and consistency is good.
That is an added benefit.

It's simply a good practice to follow the format asciidoctor documentation: which doesn't contain spaces, doesn't require adding list continations, it's easier to interpret by the parsers, and works inside open blocks.

-- 
Felipe Contreras
Previous: Junio C HamanoNext: Junio C Hamano
Message 4 of 15 in “doc: git-checkout: trivial style improvements”
  1. 0/2 doc: git-checkout: trivial style improvementsFelipe Contreras, Apr 18, 2023
  2. 1/2 doc: git-checkout: trivial callout cleanupFelipe Contreras, Apr 18, 2023
  3. Junio C HamanoApr 19, 2023
  4. Felipe ContrerasApr 24, 2023
  5. Junio C HamanoApr 25, 2023
  6. Jeff KingApr 25, 2023
  7. Felipe ContrerasApr 27, 2023
  8. Jeff KingMay 2, 2023
  9. Felipe ContrerasMay 2, 2023
  10. Junio C HamanoMay 3, 2023
  11. Felipe ContrerasMay 3, 2023
  12. Junio C HamanoMay 3, 2023
  13. Felipe ContrerasApr 27, 2023
  14. 2/2 doc: git-checkout: reorganize examplesFelipe Contreras, Apr 18, 2023
  15. Junio C HamanoApr 19, 2023

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.