{"thread":{"id":"52315","subject":"Report of use of \"local\" per t0000-basic.sh","startedAt":"2019-11-22T19:04:30Z","lastAt":"2019-11-25T15:41:51Z","messageCount":4,"participants":["Randall S. Becker","brian m. carlson","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"386858","messageId":"03ad01d5a167$a834e580$f89eb080$@nexbridge.com","threadId":"52315","inReplyTo":null,"subject":"Report of use of \"local\" per t0000-basic.sh","fromName":"Randall S. Becker","fromEmail":"rsbecker@nexbridge.com","sentAt":"2019-11-22T19:04:19Z","receivedAt":"2019-11-22T19:04:30Z","isPatch":false,"sender":{"key":"randall.becker@nexbridge.ca","avatar":"https://avatars.githubusercontent.com/u/28956764?v=4"},"body":"Hi All,\n\nBased on the note in t0000-basic.sh below, I am just letting you know that I\nhave encountered a lack of support for the \"local\" on the z/OS 2.3 USS\nplatform except within a function. I thought you might want to know.\n\nThere are a other things that do not work, particularly preservation of the\nvalue of $? across { } so test_eval_ does not work properly - I had to patch\nit for the tests to catch non-zero completion codes. I had to move to bash\nto get much of the test infrastructure. The other item that does not work is\nthe negative lazy prerequisites, so no tests that depend on that.\n\nI am not contemplating submitting any patches for this situation at this\ntime because of other pretty significant encoding issues on the platform,\nbut thought the group might want to know about this.\n\nCheers,\nRandall\n\n-- Brief whoami:\n NonStop developer since approximately 211288444200000000\n UNIX developer since approximately 421664400\n-- In my real life, I talk too much.\n\n\n# This test is an experiment to check whether any Git users are using\n# Shells that don't support the \"local\" keyword. \"local\" is not\n# POSIX-standard, but it is very widely supported by POSIX-compliant\n# shells, and if it doesn't cause problems for people, we would like\n# to be able to use it in Git code.\n#\n# For now, this is the only test that requires \"local\". If your shell\n# fails this test, you can ignore the failure, but please report the\n# problem to the Git mailing list <git@vger.kernel.org>, as it might\n# convince us to continue avoiding the use of \"local\".\ntest_expect_success 'verify that the running shell supports \"local\"' '\n\tx=\"notlocal\" &&\n\techo \"local\" >expected1 &&\n\ttry_local_x >actual1 &&\n\ttest_cmp expected1 actual1 &&\n\techo \"notlocal\" >expected2 &&\n\techo \"$x\" >actual2 &&\n\ttest_cmp expected2 actual2\n'\n\n"},{"id":"386893","messageId":"20191123041616.GD6430@camp.crustytoothpaste.net","threadId":"52315","inReplyTo":"03ad01d5a167$a834e580$f89eb080$@nexbridge.com","subject":"Re: Report of use of \"local\" per t0000-basic.sh","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2019-11-23T04:16:16Z","receivedAt":"2019-11-23T04:16:26Z","isPatch":false,"sender":{"key":"sandals@crustytoothpaste.net","avatar":"https://avatars.githubusercontent.com/u/497054?v=4"},"body":"On 2019-11-22 at 19:04:19, Randall S. Becker wrote:\n> Hi All,\n> \n> Based on the note in t0000-basic.sh below, I am just letting you know that I\n> have encountered a lack of support for the \"local\" on the z/OS 2.3 USS\n> platform except within a function. I thought you might want to know.\n\nI think it's fine that we restrict the use of local to within a\nfunction.  In fact, dash (Debian and Ubuntu's default /bin/sh) exits\nunsuccessfully if you use local outside of a function.\n\nIs there some place in particular that you've found we're using it\noutside of a function?  I don't know about others, but I'm certainly\ninterested in fixing these.  It looks like we do use it in a function in\nt0000 itself, though.\n-- \nbrian m. carlson: Houston, Texas, US\nOpenPGP: https://keybase.io/bk2204\n"},{"id":"386927","messageId":"xmqqwobp2961.fsf@gitster-ct.c.googlers.com","threadId":"52315","inReplyTo":"20191123041616.GD6430@camp.crustytoothpaste.net","subject":"Re: Report of use of \"local\" per t0000-basic.sh","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2019-11-24T04:24:54Z","receivedAt":"2019-11-24T04:25:00Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"brian m. carlson\" <sandals@crustytoothpaste.net> writes:\n\n> I think it's fine that we restrict the use of local to within a\n> function.  In fact, dash (Debian and Ubuntu's default /bin/sh) exits\n> unsuccessfully if you use local outside of a function.\n\nAll of the above sounds quite sensible.\n\n> Is there some place in particular that you've found we're using it\n> outside of a function?  I don't know about others, but I'm certainly\n> interested in fixing these.  It looks like we do use it in a function in\n> t0000 itself, though.\n\nYup, we definitely should fix it if there is a use of \"local\" at the\ntop-level outside a function that does not make sense.  The one in\nthe t0000 that tests if \"local\" behaves the way we expect it to\nlooks OK to me.\n"},{"id":"387003","messageId":"000d01d5a3a6$d454e610$7cfeb230$@nexbridge.com","threadId":"52315","inReplyTo":"20191123041616.GD6430@camp.crustytoothpaste.net","subject":"RE: Report of use of \"local\" per t0000-basic.sh","fromName":"Randall S. Becker","fromEmail":"rsbecker@nexbridge.com","sentAt":"2019-11-25T15:41:33Z","receivedAt":"2019-11-25T15:41:51Z","isPatch":false,"sender":{"key":"randall.becker@nexbridge.ca","avatar":"https://avatars.githubusercontent.com/u/28956764?v=4"},"body":"On November 22, 2019 11:16 PM, brian m. carlson wrote:\n> Is there some place in particular that you've found we're using it outside of a\n> function?  I don't know about others, but I'm certainly interested in fixing\n> these.  It looks like we do use it in a function in\n> t0000 itself, though.\n\nI 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.\n\n\n\n"}]}