Re: [PATCH 1/4] test: Add target test-lint-shell-syntax
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jan 7, 2013, 18:07 UTC
- Message-ID
- <7vwqvoj293.fsf@alter.siamese.dyndns.org>
- In-Reply-To
- <50EB0928.3090901@web.de>
Torsten Bögershausen <tboegi@web.de> writes:
> Sorry for late answer, but there is a problem (both linux and Mac OS X) :-( > $ make test-lint does not do shel syntax check, neither > $ make test-lint-shell-syntax
In which directory?
$ make -C t test-lint-shell-syntax
... passes silently ...
$ ed t/t0000-basic.sh
/test_expect_success/
a
which sh
.
w
q
$ make -C t test-lint-shell-syntax
t0000-basic.sh:28: error: which is not portable (please use type): which sh
make: *** [test-lint-shell-syntax] Error 1If you edit out '@' (but nothing else) from this line:
> @'$(PERL_PATH_SQ)' check-non-portable-shell.pl $(T)
and run the above again, you would see that it is running this shell command:
'/usr/bin/perl' check-non-portable-shell.pl t0000-basic.sh t0001-init.sh ...
If you introduce a Perl syntax error to check-non-portable-shell.pl, like this, you will get:
$ make -C t test-lint-shell-syntax
syntax error at check-non-portable-shell.pl line 11, near "whoaSo... is your shell broken? The above seems to work for dash, bash, ksh and zsh.