git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Felipe Contreras <felipe.contreras@gmail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: "brian m. carlson" <sandals@crustytoothpaste.net>,
	git@vger.kernel.org, "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>,
	"SZEDER Gábor" <szeder.dev@gmail.com>,
	"Eric Sunshine" <sunshine@sunshineco.com>
Subject: Re: [PATCH 0/6] test: make the test suite work with zsh
Date: Fri, 31 Mar 2023 20:39:06 -0600	[thread overview]
Message-ID: <CAMP44s0eQqvDTevs_tNqnc4Z_ZaOb4PoEXdSFmXxJn9Nyd5Emg@mail.gmail.com> (raw)
In-Reply-To: <xmqqv8igbd8e.fsf@gitster.g>

On Fri, Mar 31, 2023 at 7:30 PM Junio C Hamano <gitster@pobox.com> wrote:
>
> Felipe Contreras <felipe.contreras@gmail.com> writes:
>
> >> The criteria is more about what our developers are expected to be
> >> familiar with, and what is reasonable to force our developers to
> >> become sufficiently familiar with.
> >
> > That is not true.
>
> We probably should agree to disagree.

You can decide to disagree with a fact, but it's still a fact.

It is a fact that portability fixes have been merged to the code with
zero consideration to what "our developers" would have to be
"sufficiently familiar with" (which is very little, if anything).

I provided dozens of examples, and in this particular response chose
to only pick two.

>Let me respond by picking the first example from your message and then stop.

Sure, but that's just *one* example of many that prove what I'm saying
is a fact, and I explain below it doesn't apply.

> > This patch 77e572653b (t0050: fix printf format strings for
> > portability, 2010-12-21) fixed a problem that was specific with dash.
> > Did our developers have to learn the details of such issue? No.
>
> The code before that change was feeding "\xc3\xa4" to printf,
> expecting that it would be an acceptable way to spell hexadecimal
> byte values, which was wrong.  The commit improved portability by
> rewriting them to spell the same byte values in octal.
>
> Yes, our developers have to learn to avoid hexadecimal byte values
> and the commit serves as a reminder for them to learn from.

Even if that were true (which it isn't), that has *absolutely nothing*
to do with the patch in question.

Developers would have to avoid that practice because it breaks dash,
not because you picked the patch.

This is a red herring: merging or not merging the patch makes no
difference to the practice.

And this is a prescriptive claim from you. *You* say that our
developers have to learn that practice, and that's your opinion of
what our developers should do. But that doesn't mean that our
developers did actually learn that.

> When a developer writes printf format with '\xCC' hexadecimal,
> reviewers would need to catch it as a mistake, and that commit makes a
> good reference why we insist on such a rule.

Yes, according to you, and regardless of whether or not you merge the patch.

> But still, it *is* forcing our developers to learn one more rule.

Not true. The fact that such code breaks dash is what is forcing our
developers to learn that rule, not you merging the patch.

Most developers would not even notice that you merged the patch. And
such practice would not be shared in a memo, notes from the
maintainer, or update of the CodingGuidelines.

You may be expecting such practice from developers after you merge
such patch, but that's very different from developers actually knowing
that they have to adopt this practice.

> There is a trade off: is it worth supporting dash by forcing our
> developers to stick to the rule to write octal and not hex?  dash is
> used as the default for some distros and considered one of the
> standard ones, and is worth supporting even if we need to stay away
> from some stuff people may have picked up from other shells like
> bash.

zsh is the default in macOS.

Is macOS less important than some distros?

> In any case, once we declare that "we aim for our scripts and tests
> to work with dash and bash and these other shells", our developers
> are forced to stick to intersection of these supported ones.

Once again: red herring. Merging a patch has absolutely nothing to do
with you declaring such an aim.

And if that were true, there would be a declaration of "Git now
supports dash in its test suite".

When did such a declaration take place?

Moreover, the declaration has nothing to do with the patch.

> It takes a judgement call.  And "don't write literals you feed
> printf in hex, instead do so in octal, because printf built into
> some shells do not like it" is something reasonable to force our
> developers to stick to (as it allows "dash" to be thrown into the
> set of supported shells).

Nothing to do with the patch.

> I however do not see "don't use path or status or options or 0 as
> shell variable names" falls into the same category

Another red herring: because this is not something that anybody is
suggesting to actually do.

---

The fact is that $0 is used nowhere in the tests.

You can decide to disagree with what `git grep '$0' t/t????-*.sh`
shows, but it's an unobjectionable fact.

Not that it matters, because I just sent another patch with `emulate
sh -o POSIX_ARGZERO`, which doesn't require changing $0, so you'll
need another rationale to not support zsh.

Cheers.

-- 
Felipe Contreras

  reply	other threads:[~2023-04-01  2:39 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-28 17:39 [PATCH 0/6] test: make the test suite work with zsh Felipe Contreras
2023-03-28 17:39 ` [PATCH 1/6] test: fix build for zsh Felipe Contreras
2023-03-28 17:39 ` [PATCH 2/6] test: avoid `stat` variable Felipe Contreras
2023-03-29  9:48   ` Ævar Arnfjörð Bjarmason
2023-04-01  0:05   ` Taylor Blau
2023-04-01  0:25     ` Felipe Contreras
2023-03-28 17:39 ` [PATCH 3/6] test: avoid `options` variable Felipe Contreras
2023-03-28 17:39 ` [PATCH 4/6] test: avoid `path` variable Felipe Contreras
2023-03-28 17:39 ` [PATCH 5/6] test: hack for zsh Felipe Contreras
2023-03-30  8:15   ` Felipe Contreras
2023-03-28 17:39 ` [PATCH 6/6] mergetools: vimdiff: check for empty fields Felipe Contreras
2023-03-29  0:57 ` [PATCH 0/6] test: make the test suite work with zsh brian m. carlson
2023-03-29  1:57   ` Felipe Contreras
2023-03-29  9:51     ` Ævar Arnfjörð Bjarmason
2023-03-29 11:19       ` Felipe Contreras
2023-03-30 13:00         ` Felipe Contreras
2023-03-29 15:34   ` Junio C Hamano
2023-03-29 21:54     ` Felipe Contreras
2023-03-30 10:15       ` Junio C Hamano
2023-03-30 14:19         ` Felipe Contreras
2023-04-01  0:04           ` Taylor Blau
2023-04-01  0:59             ` Felipe Contreras
2023-04-01  1:30           ` Junio C Hamano
2023-04-01  2:39             ` Felipe Contreras [this message]
2023-04-01  0:00         ` Taylor Blau
2023-04-01  0:50           ` Felipe Contreras
2023-03-29 22:14     ` brian m. carlson
2023-03-30  3:15       ` Junio C Hamano
2023-03-30  7:47         ` 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:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to=CAMP44s0eQqvDTevs_tNqnc4Z_ZaOb4PoEXdSFmXxJn9Nyd5Emg@mail.gmail.com \
    --to=felipe.contreras@gmail.com \
    --cc=avarab@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=sandals@crustytoothpaste.net \
    --cc=sunshine@sunshineco.com \
    --cc=szeder.dev@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* 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

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