git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* Report of use of "local" per t0000-basic.sh
@ 2019-11-22 19:04 Randall S. Becker
  2019-11-23  4:16 ` brian m. carlson
  0 siblings, 1 reply; 4+ messages in thread
From: Randall S. Becker @ 2019-11-22 19:04 UTC (permalink / raw)
  To: git

Hi All,

Based on the note in t0000-basic.sh below, I am just letting you know that I
have encountered a lack of support for the "local" on the z/OS 2.3 USS
platform except within a function. I thought you might want to know.

There are a other things that do not work, particularly preservation of the
value of $? across { } so test_eval_ does not work properly - I had to patch
it for the tests to catch non-zero completion codes. I had to move to bash
to get much of the test infrastructure. The other item that does not work is
the negative lazy prerequisites, so no tests that depend on that.

I am not contemplating submitting any patches for this situation at this
time because of other pretty significant encoding issues on the platform,
but thought the group might want to know about this.

Cheers,
Randall

-- Brief whoami:
 NonStop developer since approximately 211288444200000000
 UNIX developer since approximately 421664400
-- In my real life, I talk too much.


# This test is an experiment to check whether any Git users are using
# Shells that don't support the "local" keyword. "local" is not
# POSIX-standard, but it is very widely supported by POSIX-compliant
# shells, and if it doesn't cause problems for people, we would like
# to be able to use it in Git code.
#
# For now, this is the only test that requires "local". If your shell
# fails this test, you can ignore the failure, but please report the
# problem to the Git mailing list <git@vger.kernel.org>, as it might
# convince us to continue avoiding the use of "local".
test_expect_success 'verify that the running shell supports "local"' '
	x="notlocal" &&
	echo "local" >expected1 &&
	try_local_x >actual1 &&
	test_cmp expected1 actual1 &&
	echo "notlocal" >expected2 &&
	echo "$x" >actual2 &&
	test_cmp expected2 actual2
'


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Report of use of "local" per t0000-basic.sh
  2019-11-22 19:04 Report of use of "local" per t0000-basic.sh Randall S. Becker
@ 2019-11-23  4:16 ` brian m. carlson
  2019-11-24  4:24   ` Junio C Hamano
  2019-11-25 15:41   ` Randall S. Becker
  0 siblings, 2 replies; 4+ messages in thread
From: brian m. carlson @ 2019-11-23  4:16 UTC (permalink / raw)
  To: Randall S. Becker; +Cc: git

[-- Attachment #1: Type: text/plain, Size: 803 bytes --]

On 2019-11-22 at 19:04:19, Randall S. Becker wrote:
> Hi All,
> 
> Based on the note in t0000-basic.sh below, I am just letting you know that I
> have encountered a lack of support for the "local" on the z/OS 2.3 USS
> platform except within a function. I thought you might want to know.

I think it's fine that we restrict the use of local to within a
function.  In fact, dash (Debian and Ubuntu's default /bin/sh) exits
unsuccessfully if you use local outside of a function.

Is there some place in particular that you've found we're using it
outside of a function?  I don't know about others, but I'm certainly
interested in fixing these.  It looks like we do use it in a function in
t0000 itself, though.
-- 
brian m. carlson: Houston, Texas, US
OpenPGP: https://keybase.io/bk2204

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 868 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Report of use of "local" per t0000-basic.sh
  2019-11-23  4:16 ` brian m. carlson
@ 2019-11-24  4:24   ` Junio C Hamano
  2019-11-25 15:41   ` Randall S. Becker
  1 sibling, 0 replies; 4+ messages in thread
From: Junio C Hamano @ 2019-11-24  4:24 UTC (permalink / raw)
  To: brian m. carlson; +Cc: Randall S. Becker, git

"brian m. carlson" <sandals@crustytoothpaste.net> writes:

> I think it's fine that we restrict the use of local to within a
> function.  In fact, dash (Debian and Ubuntu's default /bin/sh) exits
> unsuccessfully if you use local outside of a function.

All of the above sounds quite sensible.

> Is there some place in particular that you've found we're using it
> outside of a function?  I don't know about others, but I'm certainly
> interested in fixing these.  It looks like we do use it in a function in
> t0000 itself, though.

Yup, we definitely should fix it if there is a use of "local" at the
top-level outside a function that does not make sense.  The one in
the t0000 that tests if "local" behaves the way we expect it to
looks OK to me.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: Report of use of "local" per t0000-basic.sh
  2019-11-23  4:16 ` brian m. carlson
  2019-11-24  4:24   ` Junio C Hamano
@ 2019-11-25 15:41   ` Randall S. Becker
  1 sibling, 0 replies; 4+ messages in thread
From: Randall S. Becker @ 2019-11-25 15:41 UTC (permalink / raw)
  To: 'brian m. carlson'; +Cc: git

On November 22, 2019 11:16 PM, brian m. carlson wrote:
> Is there some place in particular that you've found we're using it outside of a
> function?  I don't know about others, but I'm certainly interested in fixing
> these.  It looks like we do use it in a function in
> t0000 itself, though.

I have been checking more deeply into this. The "local" keyword is being interpreted as a program instead of a keyword on the default shell on z/OS V2R3 USS even in functions. There are two shells, something resembling ksh and another tcsh. Tests do not run at all in tcsh (no support for . file). The ksh does not implement "local", so no option there. There is a bash port available, which supports local, but subtest 43 (tests clean up even on failures) does not work, although subtest 1 does work. To make any of this work, I have had to modify the tests to explicitly tag created files as ISO8859-1 (touch file && chtag -c ISO8859-1) because by default IBM-1047 is used (filesystem configured default), and test_cmp simply does not like IBM-1047 format.




^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-11-25 15:41 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-22 19:04 Report of use of "local" per t0000-basic.sh Randall S. Becker
2019-11-23  4:16 ` brian m. carlson
2019-11-24  4:24   ` Junio C Hamano
2019-11-25 15:41   ` Randall S. Becker

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).