git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: What's cooking in git.git (Aug 2021, #02; Tue, 3)

From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Date
Aug 5, 2021, 02:53 UTC
Message-ID
<871r78mw6w.fsf@evledraar.gmail.com>
In-Reply-To
<xmqq4kc4myme.fsf@gitster.g>
On Wed, Aug 04 2021, Junio C Hamano wrote:
Show 15 quoted lines
> Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:
> [...]
>> 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?

It's different in the "bisecting" case I mentioned. I.e. "shopt -u" is a shell-specific solution, the approach I'm suggesting bypasses any sort of shell-specific solutions, both current and future ones.

Show 10 quoted lines
>> 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?

I think it's an upside. We know how git handles the combination of GIT_TEST_COLUMNS, COLUMNS and TIOCGWINSZ. We have no idea how any third-party program decides to behave.

So by intentionally spoiling COLUMNS=* and only having our tests pay attention to GIT_TEST_COLUMNS we pretty much guarantee that we won't grow some dependency on a non-git program's handling of COLUMNS, which e.g. could differ from platform to platform.

I don't know about any such case, and spoiling COLUMNS didn't reveal any. I just thought it was worthwhile to once-and-for-all get us away from any sort of shell or 3rd party code cleverness around COLUMNS, as opposed to a very narrow bugfix for just the issue we've spotted with bash recently.

Previous: Junio C HamanoNext: SZEDER Gábor
Message 12 of 18 in “What's cooking in git.git (Aug 2021, #02; Tue, 3)”
  1. Junio C HamanoAug 4, 2021
  2. Ævar Arnfjörð BjarmasonAug 4, 2021
  3. Junio C HamanoAug 4, 2021
  4. Ævar Arnfjörð BjarmasonAug 4, 2021
  5. Junio C HamanoAug 4, 2021
  6. Ævar Arnfjörð BjarmasonAug 4, 2021
  7. Junio C HamanoAug 4, 2021
  8. SZEDER GáborAug 4, 2021
  9. SZEDER GáborAug 4, 2021
  10. Ævar Arnfjörð BjarmasonAug 4, 2021
  11. Junio C HamanoAug 5, 2021
  12. Ævar Arnfjörð BjarmasonAug 5, 2021
  13. SZEDER GáborAug 30, 2021
  14. SZEDER GáborAug 4, 2021
  15. Derrick StoleeAug 4, 2021
  16. Jeff KingAug 4, 2021
  17. Phillip WoodAug 5, 2021
  18. Taylor BlauAug 5, 2021

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.