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

Re: [PATCH] t0001: fix broken not-quite getcwd(3) test in bed67874e2

From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Date
Jun 7, 2021, 11:29 UTC
Message-ID
<87y2bl52v4.fsf@evledraar.gmail.com>
In-Reply-To
<xmqq4kehs2nt.fsf@gitster.g>
On Wed, Jun 02 2021, Junio C Hamano wrote:
Show 27 quoted lines
> René Scharfe <l.s.r@web.de> writes:
>
>>> On AIX under both bash and ksh this test breaks because "pwd -P" will
>>> happily display the current working directory, but getcwd(3) called by
>>> the "git init" we're testing here will fail to get it.
>>>
>>> I checked whether clobbering the $PWD environment variable would
>>> affect it, and it didn't. Presumably these shells keep track of their
>>> working directory internally.
>>>
>>> Let's change the test to a new "test-tool getcwd".
>>
>> Makes sense.
>>
>> If /bin/pwd can figure out the path to the current working directory
>> without read permissions to parent directories then it might be possible
>> to teach strbuf_getcwd() the same trick, though.  How does it do it?
>> ...
>> If strbuf_getcwd() were to learn any of these tricks, then so would
>> "test-tool getcwd", via its xgetcwd() call.  At that point we'd better
>> rename GETCWD_IGNORES_PERMS to XGETCWD_IGNORES_PERMS.
>>
>> But I guess we need none of that because we never got a request from
>> an AIX user to support a /home directory without read permissions,
>> right?
>
> Nice "thinking aloud".

I see (well, rc/release period and all) that you didn't pick this up. I think per my just-sent http://lore.kernel.org/git/871r9d6hhy.fsf@evledraar.gmail.com that it makes sense to just leave this at s/pwd(1)/getcwd(3)/ as this patch does.

Previous: Junio C HamanoNext: Ævar Arnfjörð Bjarmason
Message 9 of 17 in “tests: don't give unportable ">" to "test" built-in, use -gt”
  1. tests: don't give unportable ">" to "test" built-in, use -gtÆvar Arnfjörð Bjarmason, Aug 6, 2017
  2. brian m. carlsonAug 7, 2017
  3. René ScharfeAug 7, 2017
  4. Ævar Arnfjörð BjarmasonAug 7, 2017
  5. t0001: skip test with restrictive permissions if getpwd(3) respects themRené Scharfe, Aug 7, 2017
  6. t0001: fix broken not-quite getcwd(3) test in bed67874e2Ævar Arnfjörð Bjarmason, Jun 1, 2021
  7. René ScharfeJun 1, 2021
  8. Junio C HamanoJun 1, 2021
  9. Ævar Arnfjörð BjarmasonJun 7, 2021
  10. Ævar Arnfjörð BjarmasonJun 7, 2021
  11. René ScharfeJun 7, 2021
  12. Ævar Arnfjörð BjarmasonJun 7, 2021
  13. t0001: fix broken not-quite getcwd(3) test in bed67874e2Ævar Arnfjörð Bjarmason, Jul 30, 2021
  14. Junio C HamanoJul 30, 2021
  15. Junio C HamanoAug 7, 2017
  16. Junio C HamanoAug 7, 2017
  17. Andreas SchwabAug 7, 2017

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.