Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

path-conversion: introduce ability to switch off conversion. #181

Merged
merged 1 commit into from
Dec 18, 2023

Conversation

dscho
Copy link
Collaborator

@dscho dscho commented Dec 17, 2023

When calling windows native apps from MSYS2, the runtime tries to convert commandline arguments by a specific set of rules. This idea was inherited from the MSys/MinGW project (which is now seemingly stale, yet must be credited with championing this useful feature, see MinGW wiki https://web.archive.org/web/20201112005258/http://www.mingw.org/wiki/Posix_path_conversion).

If the user does not want that behavior on a big scale, e.g. inside a Bash script, with the changes introduced in this commit, the user can now set the the environment variable MSYS_NO_PATHCONV when calling native windows commands.

This is a feature that has been introduced in Git for Windows already in 2015 (read: a loooong time ago) via git-for-windows/msys2-runtime#11 and it predates support for the MSYS2_ENV_CONV_EXCL and MSYS2_ARG_CONV_EXCL environment variables in the MSYS2 runtime; Many users find the simplicity of MSYS_NO_PATHCONV appealing.

Git for Windows users have grown accustomed to the convenience of setting MSYS_NO_PATHCONV, and MSYS2 users are likely to enjoy it, too, so let's teach MSYS2 proper this simple trick that still allows using the sophisticated MSYS2_*_CONV_EXCL facilities but also offers a convenient catch-all "just don't convert anything" knob.

This PR is part of the effort described in msys2/MINGW-packages#16383.

When calling windows native apps from MSYS2, the runtime tries to
convert commandline arguments by a specific set of rules. This idea was
inherited from the MSys/MinGW project (which is now seemingly stale, yet
must be credited with championing this useful feature, see MinGW wiki
https://web.archive.org/web/20201112005258/http://www.mingw.org/wiki/Posix_path_conversion).

If the user does not want that behavior on a big scale, e.g. inside a
Bash script, with the changes introduced in this commit, the user can
now set the the environment variable `MSYS_NO_PATHCONV` when calling
native windows commands.

This is a feature that has been introduced in Git for Windows via
git-for-windows/msys2-runtime#11 and it predates
support for the `MSYS2_ENV_CONV_EXCL` and `MSYS2_ARG_CONV_EXCL`
environment variables in the MSYS2 runtime; Many users find the
simplicity of `MSYS_NO_PATHCONV` appealing.

So let's teach MSYS2 proper this simple trick that still allows using
the sophisticated `MSYS2_*_CONV_EXCL` facilities but also offers a
convenient catch-all "just don't convert anything" knob.

Signed-off-by: 마누엘 <nalla@hamal.uberspace.de>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
@dscho dscho self-assigned this Dec 17, 2023
@dscho dscho marked this pull request as ready for review December 17, 2023 22:59
@lazka lazka merged commit 4f2214a into msys2:msys2-3.4.10 Dec 18, 2023
1 check passed
@lazka
Copy link
Member

lazka commented Dec 18, 2023

(oh, not sure I should have merged it myself)

@dscho dscho deleted the msys-no-pathconv branch December 18, 2023 23:35
@dscho
Copy link
Collaborator Author

dscho commented Dec 18, 2023

(oh, not sure I should have merged it myself)

Why not? 😃

dscho added a commit to dscho/MSYS2-packages that referenced this pull request Dec 19, 2023
This combines the patches introduced via
msys2/msys2-runtime#181 and
msys2/msys2-runtime#182.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants