Re: [PATCH v3 3/5] tests: use shorter here-docs in chainlint.sed for AIX sed
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Aug 23, 2018, 20:42 UTC
- Message-ID
- <xmqqa7pcizmn.fsf@gitster-ct.c.googlers.com>
- In-Reply-To
- <20180823203604.5564-4-avarab@gmail.com>
Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:
Show 18 quoted lines
> 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
>
> As noted in [1] there's still a remaining recently introduced
> portability issue also introduced in 878f988350 ("t/test-lib: teach
> --chain-lint to detect broken &&-chains in subshells", 2018-07-11), so
> under AIX the tests must be run with GIT_TEST_CHAIN_LINT=0.
>
> I don't know how to solve the other issue, and this gets us some of
> the way to GIT_TEST_CHAIN_LINT=1 working again on AIX.
>
> 1. https://public-inbox.org/git/871sapezba.fsf@evledraar.gmail.com/
>
> Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
> ---I'll globally do s/here-doc/label/ while queueing.
POSIX says "The implementation shall support label arguments recognized as unique up to at least 8 bytes", so replacing these labels to shorter strings makes perfect sense.
Will queue; thanks.
Show 35 quoted lines
> t/chainlint.sed | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/t/chainlint.sed b/t/chainlint.sed
> index 8544df38df..2333705b27 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.*$//
> @@ -283,11 +283,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.*$//