git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [PATCH] git-cat-file.txt: fix list continuations rendering literally
@ 2023-01-18  8:27 Martin Ågren
  2023-01-18 16:23 ` Junio C Hamano
  0 siblings, 1 reply; 4+ messages in thread
From: Martin Ågren @ 2023-01-18  8:27 UTC (permalink / raw)
  To: git; +Cc: Siddharth Asthana

With Asciidoctor, all of the '+' introduced in a797c0ea04 ("cat-file:
add mailmap support to --batch-check option", 2022-12-20) render
literally rather than functioning as list continuations. With asciidoc,
this renders just fine. It's not too surprising that there is room for
ambiguity and surprises here, since we have lists within lists.

Simply replacing all of these '+' with empty lines makes this render
fine using both tools. Except, in the third hunk, where after this inner
'*' list ends, we want to continue with more contents of the outer list
item (`--batch-command=<format>`). We can solve any ambiguity here and
make this clear to both tools by wrapping the inner list in an open
block (using "--").

For consistency, let's wrap all three of these inner lists from
a797c0ea04 in open blocks. This also future-proofs us a little -- if we
ever gain more contents after any of those first two lists, as we did
already in a797c0ea04 for the third list, we're prepared and should
render fine with both asciidoc and Asciidoctor from the start.

Signed-off-by: Martin Ågren <martin.agren@gmail.com>
---
 Documentation/git-cat-file.txt | 19 ++++++++++++-------
 1 file changed, 12 insertions(+), 7 deletions(-)

diff --git a/Documentation/git-cat-file.txt b/Documentation/git-cat-file.txt
index 830f0a2eff..411de2e27d 100644
--- a/Documentation/git-cat-file.txt
+++ b/Documentation/git-cat-file.txt
@@ -93,47 +93,52 @@ OPTIONS
 	Print object information and contents for each object provided
 	on stdin. May not be combined with any other options or arguments
 	except `--textconv`, `--filters`, or `--use-mailmap`.
-	+
++
+--
 	* When used with `--textconv` or `--filters`, the input lines
 	  must specify the path, separated by whitespace. See the section
 	  `BATCH OUTPUT` below for details.
-	+
+
 	* When used with `--use-mailmap`, for commit and tag objects, the
 	  contents part of the output shows the identities replaced using the
 	  mailmap mechanism, while the information part of the output shows
 	  the size of the object as if it actually recorded the replacement
 	  identities.
+--
 
 --batch-check::
 --batch-check=<format>::
 	Print object information for each object provided on stdin. May not be
 	combined with any other options or arguments except `--textconv`, `--filters`
 	or `--use-mailmap`.
-	+
++
+--
 	* When used with `--textconv` or `--filters`, the input lines must
 	 specify the path, separated by whitespace. See the section
 	 `BATCH OUTPUT` below for details.
-	+
+
 	* When used with `--use-mailmap`, for commit and tag objects, the
 	  printed object information shows the size of the object as if the
 	  identities recorded in it were replaced by the mailmap mechanism.
+--
 
 --batch-command::
 --batch-command=<format>::
 	Enter a command mode that reads commands and arguments from stdin. May
 	only be combined with `--buffer`, `--textconv`, `--use-mailmap` or
 	`--filters`.
-	+
++
+--
 	* When used with `--textconv` or `--filters`, the input lines must
 	  specify the path, separated by whitespace. See the section
 	  `BATCH OUTPUT` below for details.
-	+
+
 	* When used with `--use-mailmap`, for commit and tag objects, the
 	  `contents` command shows the identities replaced using the
 	  mailmap mechanism, while the `info` command shows the size
 	  of the object as if it actually recorded the replacement
 	  identities.
-
+--
 +
 `--batch-command` recognizes the following commands:
 +
-- 
2.39.0.348.g5efb778ab0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] git-cat-file.txt: fix list continuations rendering literally
  2023-01-18  8:27 [PATCH] git-cat-file.txt: fix list continuations rendering literally Martin Ågren
@ 2023-01-18 16:23 ` Junio C Hamano
  2023-01-19  8:04   ` Martin Ågren
  0 siblings, 1 reply; 4+ messages in thread
From: Junio C Hamano @ 2023-01-18 16:23 UTC (permalink / raw)
  To: Martin Ågren; +Cc: git, Siddharth Asthana

Martin Ågren <martin.agren@gmail.com> writes:

> With Asciidoctor, all of the '+' introduced in a797c0ea04 ("cat-file:
> add mailmap support to --batch-check option", 2022-12-20) render
> literally rather than functioning as list continuations. With asciidoc,
> this renders just fine.

Good to have somebody who is careful to notice these differences ;-)

> For consistency, let's wrap all three of these inner lists from
> a797c0ea04 in open blocks. This also future-proofs us a little -- if we
> ever gain more contents after any of those first two lists, as we did
> already in a797c0ea04 for the third list, we're prepared and should
> render fine with both asciidoc and Asciidoctor from the start.

Nice.

Are you comparing both roff output and html output, by the way?

Thanks.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] git-cat-file.txt: fix list continuations rendering literally
  2023-01-18 16:23 ` Junio C Hamano
@ 2023-01-19  8:04   ` Martin Ågren
  2023-01-19 16:24     ` Junio C Hamano
  0 siblings, 1 reply; 4+ messages in thread
From: Martin Ågren @ 2023-01-19  8:04 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git, Siddharth Asthana

On Wed, 18 Jan 2023 at 17:23, Junio C Hamano <gitster@pobox.com> wrote:
>
> Are you comparing both roff output and html output, by the way?

Yes, I'm trying to make sure all four of

  {asciidoc, asciidoctor} x {man, html}

agree and look good. For the manpages, I use our doc-diff script. (In
this case, I wanted an empty asciidoc diff (HEAD^ HEAD) and a good
Asciidoctor diff (s/+//-ish).) For the html, it's a bit more manual
labour, switching between files in a browser and convincing myself
everything is good, visually.

Luckily, once both tools agree on the manpages and they look good, in my
experience, the html is probably also ok.

Martin

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] git-cat-file.txt: fix list continuations rendering literally
  2023-01-19  8:04   ` Martin Ågren
@ 2023-01-19 16:24     ` Junio C Hamano
  0 siblings, 0 replies; 4+ messages in thread
From: Junio C Hamano @ 2023-01-19 16:24 UTC (permalink / raw)
  To: Martin Ågren; +Cc: git, Siddharth Asthana

Martin Ågren <martin.agren@gmail.com> writes:

> On Wed, 18 Jan 2023 at 17:23, Junio C Hamano <gitster@pobox.com> wrote:
>>
>> Are you comparing both roff output and html output, by the way?
>
> Yes, I'm trying to make sure all four of
>
>   {asciidoc, asciidoctor} x {man, html}
>
> agree and look good. For the manpages, I use our doc-diff script. (In
> this case, I wanted an empty asciidoc diff (HEAD^ HEAD) and a good
> Asciidoctor diff (s/+//-ish).) For the html, it's a bit more manual
> labour, switching between files in a browser and convincing myself
> everything is good, visually.
>
> Luckily, once both tools agree on the manpages and they look good, in my
> experience, the html is probably also ok.

Wonderful.  Thanks for your careful work, as always.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-01-19 16:24 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-18  8:27 [PATCH] git-cat-file.txt: fix list continuations rendering literally Martin Ågren
2023-01-18 16:23 ` Junio C Hamano
2023-01-19  8:04   ` Martin Ågren
2023-01-19 16:24     ` Junio C Hamano

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).