git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Felipe Contreras <felipe.contreras@gmail.com>
To: Junio C Hamano <gitster@pobox.com>, Jeff King <peff@peff.net>
Cc: Felipe Contreras <felipe.contreras@gmail.com>, git@vger.kernel.org
Subject: Re: [PATCH 1/2] doc: git-checkout: trivial callout cleanup
Date: Wed, 03 May 2023 07:46:06 -0600	[thread overview]
Message-ID: <6452659e704df_682294b6@chronos.notmuch> (raw)
In-Reply-To: <xmqqpm7ivtd0.fsf@gitster.g>

Junio C Hamano wrote:
> Jeff King <peff@peff.net> writes:
> 
> >> > Using just a blank line between the code block and the call-out list
> >> > (instead of the "+") works for asciidoc (it is happy to keep the two
> >> > together) but not asciidoctor (it ends the outer ordered list before
> >> > starting the callout list).
> >> ...
> >  $ git checkout hello.cgit checkout hello.c            <3>
> >  ------------
> > -+
> > +
> >  <1> switch branch
> >  <2> take a file out of another commit
> >  <3> restore `hello.c` from the index
> >
> > which asciidoc renders the same, but asciidoctor is not.
> 
> Yet another random annoying differences that explains why we wrote
> it that way in the first place X-<.

I don't think so. This is the sequence of events:

 1. 1e2ccd3abc (Documentation: more examples., 2005-12-12)
 2. 1be0659efc (checkout: merge local modifications while switching branches., 2006-01-12)
 3. 48aeecdcc1 (Fix up remaining man pages that use asciidoc "callouts"., 2006-04-28)

In 1 "callouts" were added inside the listing itself, so they were not actually
callouts, the space was added just for formatting. In 2 other examples were
added, which transformed the original example to a list element, and everything
was peppered with `+`. Finally in 3 the code was transformed to actual AsciiDoc
callouts, which meant that the original space that previously was protected
inside a listing block would not be protected anymore, so it could either be 1)
removed or 2) converted to `+`.

In the thread that added this `+` [1] I see no discussion about the
alternatives.

At no point did anyone consider using a newline inside a list element, because
spaces inside list elements don't work, so the actual two choices were:

A:

  ----
  line 1 <1>
  ----
  <1> callout 1

B:

  ----
  line 1 <1>
  ----
  +
  <1> callout 1

And there never was any actual reason given as to why B was "chosen".

I think the reality is most of the AsciiDoc code doesn't really have any
consideration as to what is the actual AsciiDoc syntax, it's there because it
seems to work, and that's it.

So I think the real reason is that a newline was there before, and newlines
stop list elements.

It couldn't have possibly been because a newline didn't work in asciidoctor,
because asciidoctor would not have been created for another 6 years.

> If it has been removed to make it not to matter, that was lucky of us ;-)

Only if following the actual syntax of a language is considered "luck", in the
same way that it's "lucky" that following the C specification makes C code work
on most C compilers.

[1] https://lore.kernel.org/git/BAYC1-PASMTP028F5C1C39F7EF6A6EEB95AEB20@CEZ.ICE/

-- 
Felipe Contreras

  reply	other threads:[~2023-05-03 13:46 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-18  7:00 [PATCH 0/2] doc: git-checkout: trivial style improvements Felipe Contreras
2023-04-18  7:00 ` [PATCH 1/2] doc: git-checkout: trivial callout cleanup Felipe Contreras
2023-04-19 19:37   ` Junio C Hamano
2023-04-24 13:28     ` Felipe Contreras
2023-04-25  0:02       ` Junio C Hamano
2023-04-25  6:10         ` Jeff King
2023-04-27 22:09           ` Felipe Contreras
2023-05-02 10:18             ` Jeff King
2023-05-02 16:05               ` Felipe Contreras
2023-05-03  6:09               ` Junio C Hamano
2023-05-03 13:46                 ` Felipe Contreras [this message]
2023-05-03 17:44           ` Junio C Hamano
2023-04-27 21:30         ` Felipe Contreras
2023-04-18  7:00 ` [PATCH 2/2] doc: git-checkout: reorganize examples Felipe Contreras
2023-04-19 19:37   ` 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

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6452659e704df_682294b6@chronos.notmuch \
    --to=felipe.contreras@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=peff@peff.net \
    /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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).