git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
Cc: "SZEDER Gábor" <szeder.dev@gmail.com>,
	git@vger.kernel.org, "Taylor Blau" <me@ttaylorr.com>,
	"Emily Shaffer" <emilyshaffer@google.com>
Subject: Re: What's cooking in git.git (Aug 2021, #02; Tue, 3)
Date: Wed, 04 Aug 2021 19:08:57 -0700	[thread overview]
Message-ID: <xmqq4kc4myme.fsf@gitster.g> (raw)
In-Reply-To: <87fsvon5xm.fsf@evledraar.gmail.com> ("Ævar Arnfjörð Bjarmason"'s message of "Thu, 05 Aug 2021 01:06:55 +0200")

Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:

> How would it be forgotten? If you introduce tests like the ones changed
> in 1/3 of the series and expect git to pay attention to COLUMNS you'll
> find that they won't work, because if you set COLUMNS=123 we won't take
> it over the GIT_TEST_COLUMNS=80 set in test-lib.sh.
> ...
> ...I'd be happy to remove the helper if Junio would take that version of
> the patch; :)

FWIW, I didn't *request* it; the resulting test scripts that set and
unset both the standard COLUMNS and another test-only environment
variable looked typo-prone and hard to read, and that is why I
suggested to hide that behind a helper.

If we do not have to add a test-only enviroment variable at all, I
do not see the reason why we need a helper.

> By narrowly targeting a fix at one specific shell's cleverness around
> COLUMNS we'll leave open a window where we'll fail on other shells if
> they introduce similar cleverness.
>
> It hardly seems like a stretch that once bash starts doing that sort of
> thing other shells might think to follow suit, and all have their own
> non-standard way to turn it off.

Hmph. Wouldn't the same argument apply to the much simpler single
liner "shopt -u" solution?  When writing new tests, there is nothing
to remember, and a new shell that needs a different trick to defeat
the auto-COLUMNS would be detected quickly by running the tests in a
terminal whose width is different from 80, no?

> You also didn't address the other rationale for it, namely that it's
> also future-proofing us for submarine breakages in non-git programs
> which'll understand the new COLUMNS=10, but not GIT_TEST_COLUMNS=80.

Isn't that another downside of the approach you are advocating?

If we make Git rely on GIT_TEST_COLUMNS, we may honor it while
everybody else ignores it.  If we only have to deal with COLUMNS
like everybody else does, Git and other tools that are used in our
tests will be affected the same way by overly-clever shells, no?

  reply	other threads:[~2021-08-05  2:09 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-04  7:03 What's cooking in git.git (Aug 2021, #02; Tue, 3) Junio C Hamano
2021-08-04 10:22 ` Ævar Arnfjörð Bjarmason
2021-08-04 17:57   ` Junio C Hamano
2021-08-04 20:06     ` Ævar Arnfjörð Bjarmason
2021-08-04 18:06   ` Junio C Hamano
2021-08-04 19:53     ` Ævar Arnfjörð Bjarmason
2021-08-04 20:10       ` Junio C Hamano
2021-08-04 21:28       ` SZEDER Gábor
2021-08-04 21:36         ` SZEDER Gábor
2021-08-04 23:06         ` Ævar Arnfjörð Bjarmason
2021-08-05  2:08           ` Junio C Hamano [this message]
2021-08-05  2:53             ` Ævar Arnfjörð Bjarmason
2021-08-30 21:03           ` SZEDER Gábor
2021-08-04 18:06   ` SZEDER Gábor
2021-08-04 14:22 ` Derrick Stolee
2021-08-04 21:03   ` Jeff King
2021-08-05  9:55   ` Phillip Wood
2021-08-05  1:37 ` Taylor Blau

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=xmqq4kc4myme.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=avarab@gmail.com \
    --cc=emilyshaffer@google.com \
    --cc=git@vger.kernel.org \
    --cc=me@ttaylorr.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).