Re: [PATCH v4 4/6] tests: use shorter here-docs in chainlint.sed for AIX sed
On Tue, Aug 28, 2018 at 4:14 PM Ævar Arnfjörð Bjarmason wrote: > On Fri, Aug 24 2018, Eric Sunshine wrote: > > Shortening the names makes them ugly and often unreadable. That's not > > a complaint with this patch; just a general observation regarding > > 8-byte limitation with this platform's "sed" (and POSIX). See a few > > suggested improvements below, but probably not worth a re-roll. > >> +:clssolo > > ":endsolo" > > I was meaning to get to this with a re-roll, but since this is already > in next & these label renames seem cosmetic, it seems better to do this > after 2.19, i.e. the compiler doesn't care about the specific names, but > shortening them to <=8 fixes the bug. Sounds fine. There's no rush. Thanks.
Re: [PATCH v4 4/6] tests: use shorter here-docs in chainlint.sed for AIX sed
On Fri, Aug 24 2018, Eric Sunshine wrote: > On Fri, Aug 24, 2018 at 11:20 AM Ævar Arnfjörð Bjarmason > wrote: >> 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 > > Shortening the names makes them ugly and often unreadable. That's not > a complaint with this patch; just a general observation regarding > 8-byte limitation with this platform's "sed" (and POSIX). See a few > suggested improvements below, but probably not worth a re-roll. > >> 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 > > FWIW, > Acked-by: Eric Sunshine > >> diff --git a/t/chainlint.sed b/t/chainlint.sed >> -:checkchain >> +:chkchn > > ":chkchain" > >> # found incomplete line "...\" -- slurp up next line >> -:incomplete >> +:icmplte > > ":fold" (for "fold out NL") > >> # found nested multi-line "(...\n...)" -- pass through untouched >> -:nestslurp >> +:nstslurp > > ":nesteat" > >> -:nestcontinue >> +:nstcnt > > ":nestcont" > >> -:nestclose >> +:nstclose > > ":nestend" or ":endnest" > >> # found closing ")" on own line -- drop "suspect" from final line of >> subshell >> # since that line legitimately lacks "&&" and exit subshell loop >> -:closesolo >> +:clssolo > > ":endsolo" I was meaning to get to this with a re-roll, but since this is already in next & these label renames seem cosmetic, it seems better to do this after 2.19, i.e. the compiler doesn't care about the specific names, but shortening them to <=8 fixes the bug.
Re: [PATCH v4 4/6] tests: use shorter here-docs in chainlint.sed for AIX sed
Ævar Arnfjörð Bjarmason writes: > 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 Remind me again not to forget doing s/here-doc/label/ on this patch before queueing. Other than that, looks good, together with 3/6 for the the indented comment issue.
Re: [PATCH v4 4/6] tests: use shorter here-docs in chainlint.sed for AIX sed
On Fri, Aug 24, 2018 at 11:20 AM Ævar Arnfjörð Bjarmason wrote: > 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 Shortening the names makes them ugly and often unreadable. That's not a complaint with this patch; just a general observation regarding 8-byte limitation with this platform's "sed" (and POSIX). See a few suggested improvements below, but probably not worth a re-roll. > 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 FWIW, Acked-by: Eric Sunshine > diff --git a/t/chainlint.sed b/t/chainlint.sed > -:checkchain > +:chkchn ":chkchain" > # found incomplete line "...\" -- slurp up next line > -:incomplete > +:icmplte ":fold" (for "fold out NL") > # found nested multi-line "(...\n...)" -- pass through untouched > -:nestslurp > +:nstslurp ":nesteat" > -:nestcontinue > +:nstcnt ":nestcont" > -:nestclose > +:nstclose ":nestend" or ":endnest" > # found closing ")" on own line -- drop "suspect" from final line of subshell > # since that line legitimately lacks "&&" and exit subshell loop > -:closesolo > +:clssolo ":endsolo"
[PATCH v4 4/6] tests: use shorter here-docs in chainlint.sed for AIX sed
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 --- 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<]*\)>.*\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 "|]/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 "|]/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<]*\)>.*\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