git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Jeff King <peff@peff.net>
To: "Jean-Noël Avila via GitGitGadget" <gitgitgadget@gmail.com>
Cc: git@vger.kernel.org, "Jean-Noël Avila" <jn.avila@free.fr>
Subject: Re: [PATCH 2/4] doc: allow literal and emphasis format in doc vs help tests
Date: Thu, 28 Mar 2024 06:06:58 -0400	[thread overview]
Message-ID: <20240328100658.GA883510@coredump.intra.peff.net> (raw)
In-Reply-To: <202ed891463c134904b89a0d746d85bb62338d52.1711318739.git.gitgitgadget@gmail.com>

On Sun, Mar 24, 2024 at 10:18:57PM +0000, Jean-Noël Avila via GitGitGadget wrote:

> From: =?UTF-8?q?Jean-No=C3=ABl=20Avila?= <jn.avila@free.fr>
> 
> As the new formatting of literal and placeholders is introduced,
> the synopsis in the man pages can now hold additional markup with
> respect to the command help.
> 
> Signed-off-by: Jean-Noël Avila <jn.avila@free.fr>
> ---
>  t/t0450-txt-doc-vs-help.sh | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/t/t0450-txt-doc-vs-help.sh b/t/t0450-txt-doc-vs-help.sh
> index cd3969e852b..e47599cbf26 100755
> --- a/t/t0450-txt-doc-vs-help.sh
> +++ b/t/t0450-txt-doc-vs-help.sh
> @@ -59,7 +59,7 @@ txt_to_synopsis () {
>  		-e '/^\[verse\]$/,/^$/ {
>  			/^$/d;
>  			/^\[verse\]$/d;
> -
> +			s/{empty}\|_\|`//g;

It looks like this doesn't work in the macos CI jobs. E.g., this run:

  https://github.com/git/git/actions/runs/8460326247/job/23178326007

produced output from t0450 like:

  +++ diff -u txt help
  --- txt    2024-03-28 00:14:15
  +++ help   2024-03-28 00:14:15
  @@ -1,5 +1,5 @@
  -`git init` [`-q` | `--quiet`] [`--bare`] [`--template=`{empty}__<template-directory>__]
  -         [`--separate-git-dir` _<git-dir>_] [`--object-format=`{empty}__<format>__]
  -         [`--ref-format=`{empty}__<format>__]
  -         [`-b` _<branch-name>_ | `--initial-branch=`{empty}__<branch-name>__]
  -         [`--shared`[`=`{empty}__<permissions>__]] [_<directory>_]
  +git init [-q | --quiet] [--bare] [--template=<template-directory>]
  +         [--separate-git-dir <git-dir>] [--object-format=<format>]
  +         [--ref-format=<format>]
  +         [-b <branch-name> | --initial-branch=<branch-name>]
  +         [--shared[=<permissions>]] [<directory>]

I think the issue is that "|" alternation is not portable. In GNU sed,
doing "\|" with BRE is enough, but in BSD sed you need to enable ERE
with "-E". I'm not sure how portable that is (we do seem to have at
least one instance in t6030, so maybe it's OK). The most basic
alternative is just splitting it like:

  s/{empty}//g;
  s/[_`]//g;

-Peff


  reply	other threads:[~2024-03-28 10:07 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-24 22:18 [PATCH 0/4] Doc new guidelines Jean-Noël Avila via GitGitGadget
2024-03-24 22:18 ` [PATCH 1/4] doc: rework CodingGuidelines with new formatting rules Jean-Noël Avila via GitGitGadget
2024-03-24 22:18 ` [PATCH 2/4] doc: allow literal and emphasis format in doc vs help tests Jean-Noël Avila via GitGitGadget
2024-03-28 10:06   ` Jeff King [this message]
2024-03-28 10:21     ` Eric Sunshine
2024-03-24 22:18 ` [PATCH 3/4] doc: git-init: apply new documentation formatting guidelines Jean-Noël Avila via GitGitGadget
2024-03-26 20:18   ` Martin Ågren
2024-03-26 20:26     ` Jean-Noël AVILA
2024-03-24 22:18 ` [PATCH 4/4] doc: git-clone: apply new documentation guidelines Jean-Noël Avila via GitGitGadget
2024-03-26 20:03   ` Martin Ågren
2024-03-26 20:20     ` Junio C Hamano
2024-03-26 20:49       ` Jean-Noël AVILA
2024-03-26 20:59         ` Junio C Hamano
2024-03-29 11:19 ` [PATCH v2 0/5] Doc new guidelines Jean-Noël Avila via GitGitGadget
2024-03-29 11:19   ` [PATCH v2 1/5] doc: rework CodingGuidelines with new formatting rules Jean-Noël Avila via GitGitGadget
2024-03-29 18:42     ` Eric Sunshine
2024-03-30 17:36       ` Jean-Noël AVILA
2024-03-29 11:19   ` [PATCH v2 2/5] doc: allow literal and emphasis format in doc vs help tests Jean-Noël Avila via GitGitGadget
2024-03-29 11:19   ` [PATCH v2 3/5] doc: git-init: apply new documentation formatting guidelines Jean-Noël Avila via GitGitGadget
2024-03-29 11:19   ` [PATCH v2 4/5] doc: git-clone: " Jean-Noël Avila via GitGitGadget
2024-03-29 11:19   ` [PATCH v2 5/5] doc: git-clone: do not autoreference the manpage in itself Jean-Noël Avila via GitGitGadget

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=20240328100658.GA883510@coredump.intra.peff.net \
    --to=peff@peff.net \
    --cc=git@vger.kernel.org \
    --cc=gitgitgadget@gmail.com \
    --cc=jn.avila@free.fr \
    /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).