From: Junio C Hamano <gitster@pobox.com>
To: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Cc: Johannes Schindelin via GitGitGadget <gitgitgadget@gmail.com>,
git@vger.kernel.org
Subject: Re: [PATCH 03/10] mingw: special-case `open(symlink, O_CREAT | O_EXCL)`
Date: Sat, 06 Dec 2025 11:17:55 +0900 [thread overview]
Message-ID: <xmqqbjkc5p64.fsf@gitster.g> (raw)
In-Reply-To: <4cf1c638-3b0b-a36a-ce35-41d55e9fae12@gmx.de> (Johannes Schindelin's message of "Mon, 1 Dec 2025 14:18:17 +0100 (CET)")
Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
> On Sat, 29 Nov 2025, Junio C Hamano wrote:
>
>> "Johannes Schindelin via GitGitGadget" <gitgitgadget@gmail.com>
>> writes:
>>
>> > From: Johannes Schindelin <johannes.schindelin@gmx.de>
>> >
>> > The `_wopen()` function would gladly follow a symbolic link to a
>> > non-existent file and create it when given above-mentioned flags.
>> >
>> > Git expects the `open()` call to fail, though. So let's add yet another
>> > work-around to pretend that Windows behaves like Linux.
>>
>> "like Linux" -> "as POSIX expects"?
>>
>> cf. https://pubs.opengroup.org/onlinepubs/007904875/functions/open.html#:~:text=If%20O_CREAT%20and%20O_EXCL%20are,set%2C%20the%20result%20is%20undefined.
>
> You are both correct and incorrect. The behavior I described indeed is not
> limited to Linux, insofar you are correct. The behavior I wanted to
> imitate is Linux', though, not POSIX.
Well, I do not think we require our open() to be so Linux specific
that other POSIX compliant systems (e.g., BSDs) would fail.
Here, Git expects open() to behave as POSIX specifies, so it is good
enough to emulate open() to be sufficiently POSIX, not Linux.
Making it like Linux is purely _your_ doing.
And it would not help future developers who finds this commit by
reading "git log" when they find the code that was changed by this
patch in "git blame" output, and they want to further tweak what is
left by this patch to fit their needs better while trying to avoid
breaking our intent. Our intention is never "open must work like
Linux, allowing the caller to rely on Linux-specific quirk that
other POSIX implementations may not have", but writing the log as if
"a work-around to make it work like Linux" was necessary will
mislead them.
next prev parent reply other threads:[~2025-12-06 2:17 UTC|newest]
Thread overview: 68+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-29 18:28 [PATCH 00/10] Prepare Git's test suite for symbolic link support on Windows Johannes Schindelin via GitGitGadget
2025-11-29 18:28 ` [PATCH 01/10] t9700: accommodate for Windows paths Johannes Schindelin via GitGitGadget
2025-11-29 18:28 ` [PATCH 02/10] apply: symbolic links lack a "trustable executable bit" Johannes Schindelin via GitGitGadget
2025-11-29 18:28 ` [PATCH 03/10] mingw: special-case `open(symlink, O_CREAT | O_EXCL)` Johannes Schindelin via GitGitGadget
2025-11-30 6:49 ` Junio C Hamano
2025-12-01 13:18 ` Johannes Schindelin
2025-12-06 2:17 ` Junio C Hamano [this message]
2025-11-29 18:28 ` [PATCH 04/10] t0001: handle `diff --no-index` gracefully Johannes Schindelin via GitGitGadget
2025-11-30 5:59 ` Junio C Hamano
2025-12-01 13:20 ` Johannes Schindelin
2025-12-02 8:15 ` Junio C Hamano
2025-11-29 18:28 ` [PATCH 05/10] t0301: another fix for Windows compatibility Johannes Schindelin via GitGitGadget
2025-11-30 6:09 ` Junio C Hamano
2025-12-01 13:25 ` Johannes Schindelin
2025-12-02 8:15 ` Junio C Hamano
2025-12-02 11:14 ` Johannes Schindelin
2025-12-06 1:05 ` Junio C Hamano
2025-11-29 18:28 ` [PATCH 06/10] t0600: fix incomplete prerequisite for a test case Johannes Schindelin via GitGitGadget
2025-12-01 9:46 ` Patrick Steinhardt
2025-12-01 13:27 ` Johannes Schindelin
2025-11-29 18:28 ` [PATCH 07/10] t1006: accommodate for symlink support in MSYS2 Johannes Schindelin via GitGitGadget
2025-12-01 9:47 ` Patrick Steinhardt
2025-12-01 13:29 ` Johannes Schindelin
2025-12-01 13:34 ` Patrick Steinhardt
2025-11-29 18:28 ` [PATCH 08/10] t1305: skip symlink tests that do not apply to Windows Johannes Schindelin via GitGitGadget
2025-11-29 18:28 ` [PATCH 09/10] t6423: introduce Windows-specific handling for symlinking to /dev/null Johannes Schindelin via GitGitGadget
2025-11-29 18:28 ` [PATCH 10/10] t7800: work around the MSYS path conversion on Windows Johannes Schindelin via GitGitGadget
2025-11-30 6:49 ` Junio C Hamano
2025-11-30 6:57 ` Eric Sunshine
2025-12-01 13:30 ` Johannes Schindelin
2025-12-05 15:02 ` [PATCH v2 00/10] Prepare Git's test suite for symbolic link support " Johannes Schindelin via GitGitGadget
2025-12-05 15:02 ` [PATCH v2 01/10] t9700: accommodate for Windows paths Johannes Schindelin via GitGitGadget
2025-12-05 15:02 ` [PATCH v2 02/10] apply: symbolic links lack a "trustable executable bit" Johannes Schindelin via GitGitGadget
2025-12-05 15:02 ` [PATCH v2 03/10] mingw: special-case `open(symlink, O_CREAT | O_EXCL)` Johannes Schindelin via GitGitGadget
2025-12-05 15:02 ` [PATCH v2 04/10] t0001: handle `diff --no-index` gracefully Johannes Schindelin via GitGitGadget
2025-12-05 15:02 ` [PATCH v2 05/10] t0301: another fix for Windows compatibility Johannes Schindelin via GitGitGadget
2025-12-05 15:02 ` [PATCH v2 06/10] t0600: fix incomplete prerequisite for a test case Johannes Schindelin via GitGitGadget
2025-12-05 15:02 ` [PATCH v2 07/10] t1006: accommodate for symlink support in MSYS2 Johannes Schindelin via GitGitGadget
2025-12-05 15:02 ` [PATCH v2 08/10] t1305: skip symlink tests that do not apply to Windows Johannes Schindelin via GitGitGadget
2025-12-05 15:02 ` [PATCH v2 09/10] t6423: introduce Windows-specific handling for symlinking to /dev/null Johannes Schindelin via GitGitGadget
2025-12-05 15:02 ` [PATCH v2 10/10] t7800: work around the MSYS path conversion on Windows Johannes Schindelin via GitGitGadget
2025-12-09 8:04 ` [PATCH v2 00/10] Prepare Git's test suite for symbolic link support " Patrick Steinhardt
2025-12-09 22:18 ` Junio C Hamano
2025-12-16 11:46 ` [PATCH v3 " Johannes Schindelin via GitGitGadget
2025-12-16 11:46 ` [PATCH v3 01/10] t9700: accommodate for Windows paths Johannes Schindelin via GitGitGadget
2025-12-16 11:46 ` [PATCH v3 02/10] apply: symbolic links lack a "trustable executable bit" Johannes Schindelin via GitGitGadget
2025-12-16 11:46 ` [PATCH v3 03/10] mingw: special-case `open(symlink, O_CREAT | O_EXCL)` Johannes Schindelin via GitGitGadget
2025-12-16 11:46 ` [PATCH v3 04/10] t0001: handle `diff --no-index` gracefully Johannes Schindelin via GitGitGadget
2025-12-16 11:46 ` [PATCH v3 05/10] t0301: another fix for Windows compatibility Johannes Schindelin via GitGitGadget
2025-12-16 11:46 ` [PATCH v3 07/10] t1006: accommodate for symlink support in MSYS2 Johannes Schindelin via GitGitGadget
2025-12-16 11:46 ` [PATCH v3 08/10] t1305: skip symlink tests that do not apply to Windows Johannes Schindelin via GitGitGadget
2025-12-16 11:46 ` [PATCH v3 09/10] t6423: introduce Windows-specific handling for symlinking to /dev/null Johannes Schindelin via GitGitGadget
2025-12-16 11:46 ` [PATCH v3 10/10] t7800: work around the MSYS path conversion on Windows Johannes Schindelin via GitGitGadget
2025-12-16 18:42 ` [PATCH v3 00/10] Prepare Git's test suite for symbolic link support " Junio C Hamano
2025-12-16 19:35 ` Johannes Schindelin
2025-12-17 4:31 ` Junio C Hamano
2025-12-17 14:18 ` [PATCH v4 " Johannes Schindelin via GitGitGadget
2025-12-17 14:18 ` [PATCH v4 01/10] t9700: accommodate for Windows paths Johannes Schindelin via GitGitGadget
2025-12-17 14:18 ` [PATCH v4 02/10] apply: symbolic links lack a "trustable executable bit" Johannes Schindelin via GitGitGadget
2025-12-17 14:18 ` [PATCH v4 03/10] mingw: special-case `open(symlink, O_CREAT | O_EXCL)` Johannes Schindelin via GitGitGadget
2025-12-17 14:18 ` [PATCH v4 04/10] t0001: handle `diff --no-index` gracefully Johannes Schindelin via GitGitGadget
2025-12-17 14:18 ` [PATCH v4 05/10] t0301: another fix for Windows compatibility Johannes Schindelin via GitGitGadget
2025-12-17 14:18 ` [PATCH v4 06/10] t0600: fix incomplete prerequisite for a test case Johannes Schindelin via GitGitGadget
2025-12-17 14:18 ` [PATCH v4 07/10] t1006: accommodate for symlink support in MSYS2 Johannes Schindelin via GitGitGadget
2025-12-17 14:18 ` [PATCH v4 08/10] t1305: skip symlink tests that do not apply to Windows Johannes Schindelin via GitGitGadget
2025-12-17 14:18 ` [PATCH v4 09/10] t6423: introduce Windows-specific handling for symlinking to /dev/null Johannes Schindelin via GitGitGadget
2025-12-17 14:18 ` [PATCH v4 10/10] t7800: work around the MSYS path conversion on Windows Johannes Schindelin via GitGitGadget
2025-12-17 23:19 ` [PATCH v4 00/10] Prepare Git's test suite for symbolic link support " Junio C Hamano
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xmqqbjkc5p64.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=Johannes.Schindelin@gmx.de \
--cc=git@vger.kernel.org \
--cc=gitgitgadget@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.
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 NNTP newsgroup(s).