mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: "Ævar Arnfjörð Bjarmason" <>
To: Junio C Hamano <>
Cc: Git List <>,
	Eric Sunshine <>,
	"brian m. carlson" <>
Subject: Re: [PATCH v2] CodingGuidelines: explicitly allow "local" for test scripts
Date: Tue, 04 May 2021 14:27:24 +0200	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <xmqqpmy76w31.fsf@gitster.g>

On Tue, May 04 2021, Junio C Hamano wrote:

> Ævar Arnfjörð Bjarmason <> writes:
>> Is there any portability reason to avoid "local" in the porcelains? I
>> don't have any plans for using it, but I don't see why we'd explicitly
>> forbid it.
> Things that are not even in POSIX are forbidden unless explicitly
> allowed.
> In general, he way we encouraged people to think has been "don't use
> it, it is not even in POSIX" and "even if it is in POSIX, we know
> the support by platform/implementation X is broken, so let's not use
> it".  It has been successfully helped us to stay out of portability
> troubles.
> There may be a few tiny cases where we said "practically everybody
> we care about has it, even though it is not in POSIX, and it makes
> our life so vastly be better" to explicitly allow some feature,
> though.
> And "local"?  Not absolutely essential, unless you are doing a
> library that you want to avoid stepping on users' toes.  Besides, we
> are no longer adding scripted Porcelains left and right---rather,
> people are actively rewriting them.

[You mailed me off-list with "Did I forget to say it is not even
POSIX?", I had this reply to that, also applicable here]:


I'm aware that it's not in POSIX. What I'm getting at is that anyone who
doesn't support this must have been failing since
01d3a526ad9 (t0000: check whether the shell supports the "local"
keyword, 2017-10-26), released with v2.16.0.

And all tests of any kind since 78dc08875cd (test-lib: allow short
options to be bundled, 2020-03-22), perhaps earlier, I didn't trace the
full includes, but that's the first use in itself. Released
with v2.27.0.

From my own cross-platform testing and us not having any reports about
this I very much suspect that this is one of those not-in-POSIX but in
practice supported everywhere, or at least anywhere Git has been ported

So just saying it's OK to use unconditionally of "in t/?" should be
fine, like e.g. some of the C89-plus-XYZ features.


Afterwards it occurred to me that your stance on in-tree *.sh goes
against e.g. brian's opinion on it expressed in reply to [1], i.e. that
we might justify future new *.sh built-ins.

In any case, as noted above I really don't care much about using "local"
in any *.sh built-in. I just don't think this "We do not use it in
scripted Porcelains[...]" clause is needed at all.

It's effectively synonymous with saying "we still want to support git on
platforms that are so broken they can't even run a single test in our
test suite".


  reply	other threads:[~2021-05-04 12:33 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-03  4:10 [PATCH] CodingGuidelines: explicitly allow "local" for test scripts Junio C Hamano
2021-05-03  4:21 ` Eric Sunshine
2021-05-03  5:21   ` Junio C Hamano
2021-05-03  5:23     ` [PATCH v2] " Junio C Hamano
2021-05-03  9:01       ` Ævar Arnfjörð Bjarmason
2021-05-04  3:01         ` Junio C Hamano
2021-05-04 12:27           ` Ævar Arnfjörð Bjarmason [this message]
2021-05-04 12:50             ` Junio C Hamano
2021-05-04 15:09               ` Ævar Arnfjörð Bjarmason
2021-05-04 20:22                 ` Felipe Contreras
2021-05-04 23:17                 ` brian m. carlson
2021-05-04 23:55                   ` Junio C Hamano
2021-05-05  0:08                   ` Felipe Contreras
2021-05-05  1:58                     ` brian m. carlson
2021-05-05  3:59                       ` Felipe Contreras
2021-05-05 14:16                         ` Jeff King
2021-05-05 17:18                           ` Felipe Contreras

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:

  List information:

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

  git send-email \ \ \ \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

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