public inbox for git@vger.kernel.org 
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox•com>
To: Elia Pinto <gitter.spiros@gmail•com>
Cc: git@vger•kernel.org, tboegi@web•de, dak@gnu•org
Subject: Re: [PATCH v2] Get rid of the non portable shell export VAR=VALUE costruct
Date: Fri, 23 May 2014 11:39:25 -0700	[thread overview]
Message-ID: <xmqqegzkjq5e.fsf@gitster.dls.corp.google.com> (raw)
In-Reply-To: <xmqqmwe8jr44.fsf@gitster.dls.corp.google.com> (Junio C. Hamano's message of "Fri, 23 May 2014 11:18:35 -0700")

Junio C Hamano <gitster@pobox•com> writes:

> Elia Pinto <gitter.spiros@gmail•com> writes:
>
>> Found by check-non-portable-shell.pl
>
> Thanks.
>
> Makes me wonder why these two were missed, though.

Perhaps something like this?

I didn't check other rules, though, because I still have a feeling
that this "pretend to understand the shell syntax and point out
issues, without really parsing the script" is fundamentally an
error-prone approach and am hesitant to loosen the patterns too
much.

 t/check-non-portable-shell.pl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/t/check-non-portable-shell.pl b/t/check-non-portable-shell.pl
index 45971f4..24d7555 100755
--- a/t/check-non-portable-shell.pl
+++ b/t/check-non-portable-shell.pl
@@ -21,7 +21,7 @@ while (<>) {
 	/^\s*declare\s+/ and err 'arrays/declare not portable';
 	/^\s*[^#]\s*which\s/ and err 'which is not portable (please use type)';
 	/test\s+[^=]*==/ and err '"test a == b" is not portable (please use =)';
-	/^\s*export\s+[^=]*=/ and err '"export FOO=bar" is not portable (please use FOO=bar && export FOO)';
+	/(?:^|[^-a-zA-Z0-9_])export\s+[^=]*=/ and err '"export FOO=bar" is not portable (please use FOO=bar && export FOO)';
 	# this resets our $. for each file
 	close ARGV if eof;
 }

  reply	other threads:[~2014-05-23 18:39 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-23 10:15 [PATCH v2] Get rid of the non portable shell export VAR=VALUE costruct Elia Pinto
2014-05-23 16:18 ` Jonathan Nieder
2014-05-23 18:18 ` Junio C Hamano
2014-05-23 18:39   ` Junio C Hamano [this message]
2014-05-23 18:48     ` Jonathan Nieder
2014-05-23 18:44   ` Jonathan Nieder
2014-05-23 20:40     ` Torsten Bögershausen
2014-05-23 21:25       ` Junio C Hamano
2014-05-23 21:56     ` Junio C Hamano
2014-05-23 20:38 ` Eric Sunshine

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqqegzkjq5e.fsf@gitster.dls.corp.google.com \
    --to=gitster@pobox$(echo .)com \
    --cc=dak@gnu$(echo .)org \
    --cc=git@vger$(echo .)kernel.org \
    --cc=gitter.spiros@gmail$(echo .)com \
    --cc=tboegi@web$(echo .)de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox