git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
To: git@vger.kernel.org
Cc: "Junio C Hamano" <gitster@pobox.com>, "Jeff King" <peff@peff.net>,
	"Benoit Lecocq" <benoit@openbsd.org>,
	kn@openbsd.org, "Eric Sunshine" <sunshine@sunshineco.com>,
	"Derrick Stolee" <stolee@gmail.com>,
	"Jeff Hostetler" <jeffhost@microsoft.com>,
	"Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
Subject: [PATCH v4 4/6] tests: use shorter here-docs in chainlint.sed for AIX sed
Date: Fri, 24 Aug 2018 15:20:14 +0000	[thread overview]
Message-ID: <20180824152016.20286-5-avarab@gmail.com> (raw)
In-Reply-To: <CAPig+cS4yeHNbc1Anq1DtLPEEGLpGeGEV74JHZrYft2wRmZAPQ@mail.gmail.com>

Improve the portability of chainlint by using shorter here-docs. On
AIX sed will complain about:

    sed: 0602-417 The label :hereslurp is greater than eight
    characters

This, in combination with the previous fix to this file makes
GIT_TEST_CHAIN_LINT=1 (which is the default) working again on AIX
without issues, and the "gmake check-chainlint" test also passes.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 t/chainlint.sed | 56 ++++++++++++++++++++++++-------------------------
 1 file changed, 28 insertions(+), 28 deletions(-)

diff --git a/t/chainlint.sed b/t/chainlint.sed
index dcb4b333ed..c80d2fad7a 100644
--- a/t/chainlint.sed
+++ b/t/chainlint.sed
@@ -97,11 +97,11 @@
 /<<[ 	]*[-\\']*[A-Za-z0-9_]/ {
 	s/^\(.*\)<<[ 	]*[-\\']*\([A-Za-z0-9_][A-Za-z0-9_]*\)'*/<\2>\1<</
 	s/[ 	]*<<//
-	:hereslurp
+	:hered
 	N
 	/^<\([^>]*\)>.*\n[ 	]*\1[ 	]*$/!{
 		s/\n.*$//
-		bhereslurp
+		bhered
 	}
 	s/^<[^>]*>//
 	s/\n.*$//
@@ -149,7 +149,7 @@ s/.*\n//
 
 :slurp
 # incomplete line "...\"
-/\\$/bincomplete
+/\\$/bicmplte
 # multi-line quoted string "...\n..."?
 /"/bdqstring
 # multi-line quoted string '...\n...'? (but not contraction in string "it's")
@@ -171,7 +171,7 @@ s/.*\n//
 	/"[^"]*#[^"]*"/!s/[ 	]#.*$//
 }
 # one-liner "case ... esac"
-/^[ 	]*case[ 	]*..*esac/bcheckchain
+/^[ 	]*case[ 	]*..*esac/bchkchn
 # multi-line "case ... esac"
 /^[ 	]*case[ 	]..*[ 	]in/bcase
 # multi-line "for ... done" or "while ... done"
@@ -200,32 +200,32 @@ s/.*\n//
 /^[ 	]*fi[ 	]*[<>|]/bdone
 /^[ 	]*fi[ 	]*)/bdone
 # nested one-liner "(...) &&"
-/^[ 	]*(.*)[ 	]*&&[ 	]*$/bcheckchain
+/^[ 	]*(.*)[ 	]*&&[ 	]*$/bchkchn
 # nested one-liner "(...)"
-/^[ 	]*(.*)[ 	]*$/bcheckchain
+/^[ 	]*(.*)[ 	]*$/bchkchn
 # nested one-liner "(...) >x" (or "2>x" or "<x" or "|x")
-/^[ 	]*(.*)[ 	]*[0-9]*[<>|]/bcheckchain
+/^[ 	]*(.*)[ 	]*[0-9]*[<>|]/bchkchn
 # nested multi-line "(...\n...)"
 /^[ 	]*(/bnest
 # multi-line "{...\n...}"
 /^[ 	]*{/bblock
 # closing ")" on own line -- exit subshell
-/^[ 	]*)/bclosesolo
+/^[ 	]*)/bclssolo
 # "$((...))" -- arithmetic expansion; not closing ")"
-/\$(([^)][^)]*))[^)]*$/bcheckchain
+/\$(([^)][^)]*))[^)]*$/bchkchn
 # "$(...)" -- command substitution; not closing ")"
-/\$([^)][^)]*)[^)]*$/bcheckchain
+/\$([^)][^)]*)[^)]*$/bchkchn
 # multi-line "$(...\n...)" -- command substitution; treat as nested subshell
 /\$([^)]*$/bnest
 # "=(...)" -- Bash array assignment; not closing ")"
-/=(/bcheckchain
+/=(/bchkchn
 # closing "...) &&"
 /)[ 	]*&&[ 	]*$/bclose
 # closing "...)"
 /)[ 	]*$/bclose
 # closing "...) >x" (or "2>x" or "<x" or "|x")
 /)[ 	]*[<>|]/bclose
-:checkchain
+:chkchn
 # mark suspect if line uses ";" internally rather than "&&" (but not ";" in a
 # string and not ";;" in one-liner "case...esac")
 /;/{
@@ -244,7 +244,7 @@ n
 bslurp
 
 # found incomplete line "...\" -- slurp up next line
-:incomplete
+:icmplte
 N
 s/\\\n//
 bslurp
@@ -282,11 +282,11 @@ bfolded
 :heredoc
 s/^\(.*\)<<[ 	]*[-\\']*\([A-Za-z0-9_][A-Za-z0-9_]*\)'*/<\2>\1<</
 s/[ 	]*<<//
-:hereslurpsub
+:heredsub
 N
 /^<\([^>]*\)>.*\n[ 	]*\1[ 	]*$/!{
 	s/\n.*$//
-	bhereslurpsub
+	bheredsub
 }
 s/^<[^>]*>//
 s/\n.*$//
@@ -316,43 +316,43 @@ x
 # is 'done' or 'fi' cuddled with ")" to close subshell?
 /done.*)/bclose
 /fi.*)/bclose
-bcheckchain
+bchkchn
 
 # found nested multi-line "(...\n...)" -- pass through untouched
 :nest
 x
-:nestslurp
+:nstslurp
 n
 # closing ")" on own line -- stop nested slurp
-/^[ 	]*)/bnestclose
+/^[ 	]*)/bnstclose
 # comment -- not closing ")" if in comment
-/^[ 	]*#/bnestcontinue
+/^[ 	]*#/bnstcnt
 # "$((...))" -- arithmetic expansion; not closing ")"
-/\$(([^)][^)]*))[^)]*$/bnestcontinue
+/\$(([^)][^)]*))[^)]*$/bnstcnt
 # "$(...)" -- command substitution; not closing ")"
-/\$([^)][^)]*)[^)]*$/bnestcontinue
+/\$([^)][^)]*)[^)]*$/bnstcnt
 # closing "...)" -- stop nested slurp
-/)/bnestclose
-:nestcontinue
+/)/bnstclose
+:nstcnt
 x
-bnestslurp
-:nestclose
+bnstslurp
+:nstclose
 s/^/>>/
 # is it "))" which closes nested and parent subshells?
 /)[ 	]*)/bslurp
-bcheckchain
+bchkchn
 
 # found multi-line "{...\n...}" block -- pass through untouched
 :block
 x
 n
 # closing "}" -- stop block slurp
-/}/bcheckchain
+/}/bchkchn
 bblock
 
 # found closing ")" on own line -- drop "suspect" from final line of subshell
 # since that line legitimately lacks "&&" and exit subshell loop
-:closesolo
+:clssolo
 x
 s/?!AMP?!//
 p
-- 
2.18.0.865.gffc8e1a3cd6


  parent reply	other threads:[~2018-08-24 15:20 UTC|newest]

Thread overview: 52+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-23  9:14 [PATCH] tests: fix and add lint for non-portable head -c N Ævar Arnfjörð Bjarmason
2018-08-23  9:56 ` Test failures on OpenBSD Ævar Arnfjörð Bjarmason
2018-08-23 15:53   ` Junio C Hamano
2018-08-23 15:25 ` [PATCH v2 1/2] tests: fix and add lint for non-portable head -c N Ævar Arnfjörð Bjarmason
2018-08-23 16:11   ` Jeff King
2018-08-23 15:25 ` [PATCH v2 2/2] tests: fix and add lint for non-portable seq Ævar Arnfjörð Bjarmason
2018-08-23 16:08   ` Junio C Hamano
2018-08-23 17:20     ` Ævar Arnfjörð Bjarmason
2018-08-23 20:35   ` [PATCH v3 0/5] OpenBSD & AIX etc. portability fixes Ævar Arnfjörð Bjarmason
2018-08-23 20:36   ` [PATCH v3 1/5] tests: fix and add lint for non-portable head -c N Ævar Arnfjörð Bjarmason
2018-08-23 20:36   ` [PATCH v3 2/5] tests: fix and add lint for non-portable seq Ævar Arnfjörð Bjarmason
2018-08-23 20:36   ` [PATCH v3 3/5] tests: use shorter here-docs in chainlint.sed for AIX sed Ævar Arnfjörð Bjarmason
2018-08-23 20:42     ` Junio C Hamano
2018-08-23 20:56     ` Eric Sunshine
2018-08-24 15:20       ` [PATCH v4 0/6] OpenBSD & AIX etc. portability fixes Ævar Arnfjörð Bjarmason
2018-08-24 15:20       ` [PATCH v4 1/6] tests: fix and add lint for non-portable head -c N Ævar Arnfjörð Bjarmason
2018-08-24 15:20       ` [PATCH v4 2/6] tests: fix and add lint for non-portable seq Ævar Arnfjörð Bjarmason
2018-08-24 15:20       ` [PATCH v4 3/6] tests: fix comment syntax in chainlint.sed for AIX sed Ævar Arnfjörð Bjarmason
2018-08-24 20:52         ` Eric Sunshine
2018-08-24 15:20       ` Ævar Arnfjörð Bjarmason [this message]
2018-08-24 21:29         ` [PATCH v4 4/6] tests: use shorter here-docs " Eric Sunshine
2018-08-28 20:14           ` Ævar Arnfjörð Bjarmason
2018-08-28 20:17             ` Eric Sunshine
2018-08-27 19:36         ` Junio C Hamano
2018-09-04 22:36         ` What's cooking in git.git (Sep 2018, #01; Tue, 4) Junio C Hamano
2018-09-05  9:14           ` Eric Sunshine
2018-09-05 17:45             ` Junio C Hamano
2018-09-05 18:44             ` Eric Sunshine
2018-09-05  9:50           ` Eric Sunshine
2018-09-05 20:31             ` Jeff King
2018-09-05 21:56               ` Junio C Hamano
2018-09-05 13:38           ` jc/rebase-in-c-9-fixes, was " Johannes Schindelin
2018-09-05 16:41             ` Junio C Hamano
     [not found]           ` <xmqqbm9b6gxs.fsf@gitster-ct.c.googlers.com>
2018-09-05 16:48             ` Duy Nguyen
2018-09-05 18:18               ` SZEDER Gábor
2018-09-05  8:29         ` Ævar Arnfjörð Bjarmason
2018-09-05  8:59           ` Eric Sunshine
2018-09-05 11:07             ` Ævar Arnfjörð Bjarmason
2018-11-24 19:33               ` Ævar Arnfjörð Bjarmason
2018-11-25  4:28                 ` Torsten Bögershausen
2018-11-25  8:21                   ` Torsten Bögershausen
2018-11-25 14:14                     ` Ævar Arnfjörð Bjarmason
2018-09-05 16:45             ` Junio C Hamano
2018-08-24 15:20       ` [PATCH v4 5/6] tests: fix version-specific portability issue in Perl JSON Ævar Arnfjörð Bjarmason
2018-08-24 20:41         ` Eric Sunshine
2018-08-24 15:20       ` [PATCH v4 6/6] tests: fix and add lint for non-portable grep --file Ævar Arnfjörð Bjarmason
2018-08-23 20:36   ` [PATCH v3 4/5] tests: fix version-specific portability issue in Perl JSON Ævar Arnfjörð Bjarmason
2018-08-23 20:36   ` [PATCH v3 5/5] tests: fix and add lint for non-portable grep --file Ævar Arnfjörð Bjarmason
2018-08-23 20:44     ` Junio C Hamano
2018-08-24 13:49       ` Derrick Stolee
2018-08-23 15:42 ` [PATCH] tests: fix and add lint for non-portable head -c N Junio C Hamano
2018-08-23 17:24   ` Ævar Arnfjörð Bjarmason

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=20180824152016.20286-5-avarab@gmail.com \
    --to=avarab@gmail.com \
    --cc=benoit@openbsd.org \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=jeffhost@microsoft.com \
    --cc=kn@openbsd.org \
    --cc=peff@peff.net \
    --cc=stolee@gmail.com \
    --cc=sunshine@sunshineco.com \
    /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).