From f53f133d8d456559daa5d06e1e7ddb09b1cc0ae5 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jean-No=C3=ABl=20Avila?= Date: Sat, 20 Dec 2025 19:16:23 +0000 Subject: [PATCH] doc: fix t0450-txt-doc-vs-help to select only first synopsis block MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit In case there are multiple synopsis blocks (declared with [synopsis] or [verse] style) in the same file, the previous implementation was incorrectly picking up text from all the blocks until the first empty line. This commit modifies the sed command to stop processing upon encountering the first empty line after the first block declaration, thereby ensuring that only the intended block is captured. Signed-off-by: Jean-Noël Avila Signed-off-by: Junio C Hamano --- 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 e12e18f97f..822b0d55a5 100755 --- a/t/t0450-txt-doc-vs-help.sh +++ b/t/t0450-txt-doc-vs-help.sh @@ -56,7 +56,7 @@ adoc_to_synopsis () { b2t="$(builtin_to_adoc "$builtin")" && sed -n \ -E '/^\[(verse|synopsis)\]$/,/^$/ { - /^$/d; + /^$/q; /^\[(verse|synopsis)\]$/d; s/\{litdd\}/--/g; s/'\''(git[ a-z-]*)'\''/\1/g; -- 2.47.3