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

[BUG] The git in msys act different from git-for-windows's released git #2176

Open
lygstate opened this issue Oct 7, 2020 · 1 comment
Open

Comments

@lygstate
Copy link

lygstate commented Oct 7, 2020

Describe the bug

It's in the bash shell, and open a cmd
using /usr/bin/git,
the source code of test.c are

#include <stdio.h>

int _CRT_glob = 0;

int main(int argc, char** argv) {
    int i;
    for (i = 0; i < argc; i+= 1) {
        printf("%s\n", argv[i]);
    }
}

lygstate@DESKTOP-94PU0GB MINGW64 /c/work/xemu/qemu
$ cmd
Microsoft Windows [版本 10.0.19041.508]
(c) 2020 Microsoft Corporation. 保留所有权利。
C:\work\xemu\qemu>where git
where git
C:\CI-Tools\msys64\usr\bin\git.exe

C:\work\xemu\qemu>git --version
git version 2.27.0

C:\work\xemu\qemu>git describe --match v* --dirty --alway
fatal: --dirty 与提交号不兼容

C:\work\xemu\qemu>
C:\work\xemu\qemu>git describe --match "v*" --dirty --alway
v5.1.0-2015-ge3bf360cd2-dirty

C:\work\xemu\qemu>
C:\work\xemu\qemu>git describe --match 'v*' --dirty --alway
v5.1.0-2015-ge3bf360cd2-dirty

C:\work\xemu\qemu>
C:\work\xemu\qemu>test describe --match v* --dirty --alway
test
describe
--match
v*
--dirty
--alway

C:\work\xemu\qemu>
C:\work\xemu\qemu>test describe --match "v*" --dirty --alway
test
describe
--match
v*
--dirty
--alway

C:\work\xemu\qemu>
C:\work\xemu\qemu>test describe --match 'v*' --dirty --alway
test
describe
--match
'v*'
--dirty
--alway

C:\work\xemu\qemu>

The english error code are
die(_("--dirty is incompatible with commit-ishes"));

Commands running

where git
git --version
git describe --match v* --dirty --alway
git describe --match "v*" --dirty --alway
git describe --match 'v*' --dirty --alway
test describe --match v* --dirty --alway
test describe --match "v*" --dirty --alway
test describe --match 'v*' --dirty --alway

The running result of git-for-windows

C:\work\xemu\qemu>where git
C:\Program Files\Git\cmd\git.exe

C:\work\xemu\qemu>git --version
git version 2.28.0.windows.1

C:\work\xemu\qemu>git describe --match v* --dirty --alway
v5.1.0-2015-ge3bf360cd2-dirty

C:\work\xemu\qemu>git describe --match "v*" --dirty --alway
v5.1.0-2015-ge3bf360cd2-dirty

C:\work\xemu\qemu>git describe --match 'v*' --dirty --alway
e3bf360cd2-dirty

C:\work\xemu\qemu>test describe --match v* --dirty --alway
test
describe
--match
v*
--dirty
--alway

C:\work\xemu\qemu>test describe --match "v*" --dirty --alway
test
describe
--match
v*
--dirty
--alway

C:\work\xemu\qemu>test describe --match 'v*' --dirty --alway
test
describe
--match
'v*'
--dirty
--alway

C:\work\xemu\qemu>

Whe I compiling test.exe with msys2 gcc, not msys2/mingw gcc, the running result are:

C:\work\xemu\qemu>test describe --match v* --dirty --alway
test
describe
--match
version.rc
version.texi.in
--dirty
--alway

C:\work\xemu\qemu>
C:\work\xemu\qemu>test describe --match "v*" --dirty --alway
test
describe
--match
v*
--dirty
--alway

C:\work\xemu\qemu>
C:\work\xemu\qemu>test describe --match 'v*' --dirty --alway
test
describe
--match
v*
--dirty
--alway

C:\work\xemu\qemu>

So it's seems the real cause are comes from msys2 gcc compiled program that doesn't recognize _CRT_glob and respect Windows wildcard sematic and that's seems not necessary, because that's bash's job, on posix platform there is no such
feature at all

@lygstate
Copy link
Author

lygstate commented Oct 7, 2020

According to magit/magit#2246, So th solution are using
CYGWIN=noglob and MSYS=noglob in the environment variable

lygstate added a commit to lygstate/qemu that referenced this issue Jan 26, 2021
The sh script are harder to maintain for compatible different
xsh environment so convert it to python script
Also incorporate the fixes in
https://patchew.org/QEMU/[email protected]/

According to msys2/MSYS2-packages#2176
We need use CYGWIN=noglob and MSYS=noglob in the environment variable
for disable wildcard expanding in msys or cygwin git, and setting the shell=False

Signed-off-by: Yonggang Luo <[email protected]>
Message-Id: <[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
lygstate added a commit to lygstate/rust that referenced this issue Feb 17, 2021
Quotes the arg and not quotes the arg have different effect on Windows when the program called
are msys2/cygwin program.
Refer to msys2/MSYS2-packages#2176

Signed-off-by: Yonggang Luo <[email protected]>
Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this issue Feb 17, 2021
Expose force_quotes on Windows.

On Windows, the arg quotes and not quotes have different effect
for the program it called, if the program called are msys2/cygwin program.
Refer to
msys2/MSYS2-packages#2176

This also solve the issues comes from

https://internals.rust-lang.org/t/std-process-on-windows-is-escaping-raw-literals-which-causes-problems-with-chaining-commands/8163

Tracking issue:
rust-lang#82227
lygstate added a commit to lygstate/qemu that referenced this issue Mar 4, 2021
The sh script are harder to maintain for compatible different
xsh environment so convert it to python script
Also incorporate the fixes in
https://patchew.org/QEMU/[email protected]/

According to msys2/MSYS2-packages#2176
We need use CYGWIN=noglob and MSYS=noglob in the environment variable
for disable wildcard expanding in msys or cygwin git, and setting the shell=False

Signed-off-by: Yonggang Luo <[email protected]>
Message-Id: <[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
lygstate added a commit to lygstate/qemu that referenced this issue Mar 11, 2021
The sh script are harder to maintain for compatible different
xsh environment so convert it to python script
Also incorporate the fixes in
https://patchew.org/QEMU/[email protected]/

According to msys2/MSYS2-packages#2176
We need use CYGWIN=noglob and MSYS=noglob in the environment variable
for disable wildcard expanding in msys or cygwin git, and setting the shell=False

Signed-off-by: Yonggang Luo <[email protected]>
Message-Id: <[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
lygstate added a commit to lygstate/qemu that referenced this issue Mar 17, 2021
The sh script are harder to maintain for compatible different
xsh environment so convert it to python script
Also incorporate the fixes in
https://patchew.org/QEMU/[email protected]/

According to msys2/MSYS2-packages#2176
We need use CYGWIN=noglob and MSYS=noglob in the environment variable
for disable wildcard expanding in msys or cygwin git, and setting the shell=False

Signed-off-by: Yonggang Luo <[email protected]>
Message-Id: <[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
lygstate added a commit to lygstate/qemu that referenced this issue Mar 17, 2021
The sh script are harder to maintain for compatible different
xsh environment so convert it to python script
Also incorporate the fixes in
https://patchew.org/QEMU/[email protected]/

According to msys2/MSYS2-packages#2176
We need use CYGWIN=noglob and MSYS=noglob in the environment variable
for disable wildcard expanding in msys or cygwin git, and setting the shell=False

Signed-off-by: Yonggang Luo <[email protected]>
Message-Id: <[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
lygstate added a commit to lygstate/qemu that referenced this issue Mar 18, 2021
The sh script are harder to maintain for compatible different
xsh environment so convert it to python script
Also incorporate the fixes in
https://patchew.org/QEMU/[email protected]/

According to msys2/MSYS2-packages#2176
We need use CYGWIN=noglob and MSYS=noglob in the environment variable
for disable wildcard expanding in msys or cygwin git, and setting the shell=False

Signed-off-by: Yonggang Luo <[email protected]>
Message-Id: <[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
lygstate added a commit to lygstate/qemu that referenced this issue Mar 18, 2021
The sh script are harder to maintain for compatible different
xsh environment so convert it to python script
Also incorporate the fixes in
https://patchew.org/QEMU/[email protected]/

According to msys2/MSYS2-packages#2176
We need use CYGWIN=noglob and MSYS=noglob in the environment variable
for disable wildcard expanding in msys or cygwin git, and setting the shell=False

Signed-off-by: Yonggang Luo <[email protected]>
Message-Id: <[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
lygstate added a commit to lygstate/qemu that referenced this issue Mar 21, 2021
The sh script are harder to maintain for compatible different
xsh environment so convert it to python script
Also incorporate the fixes in
https://patchew.org/QEMU/[email protected]/

According to msys2/MSYS2-packages#2176
We need use CYGWIN=noglob and MSYS=noglob in the environment variable
for disable wildcard expanding in msys or cygwin git, and setting the shell=False

Signed-off-by: Yonggang Luo <[email protected]>
Message-Id: <[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
lygstate added a commit to lygstate/qemu that referenced this issue Mar 21, 2021
The sh script are harder to maintain for compatible different
xsh environment so convert it to python script
Also incorporate the fixes in
https://patchew.org/QEMU/[email protected]/

According to msys2/MSYS2-packages#2176
We need use CYGWIN=noglob and MSYS=noglob in the environment variable
for disable wildcard expanding in msys or cygwin git, and setting the shell=False

Signed-off-by: Yonggang Luo <[email protected]>
Message-Id: <[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
lygstate added a commit to lygstate/qemu that referenced this issue Mar 22, 2021
The sh script are harder to maintain for compatible different
xsh environment so convert it to python script
Also incorporate the fixes in
https://patchew.org/QEMU/[email protected]/

According to msys2/MSYS2-packages#2176
We need use CYGWIN=noglob and MSYS=noglob in the environment variable
for disable wildcard expanding in msys or cygwin git, and setting the shell=False

Signed-off-by: Yonggang Luo <[email protected]>
Message-Id: <[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
lygstate added a commit to lygstate/qemu that referenced this issue Nov 22, 2021
The sh script are harder to maintain for compatible different
xsh environment so convert it to python script
Also incorporate the fixes in
https://patchew.org/QEMU/[email protected]/

According to msys2/MSYS2-packages#2176
We need use CYGWIN=noglob and MSYS=noglob in the environment variable
for disable wildcard expanding in msys or cygwin git, and setting the shell=False

Signed-off-by: Yonggang Luo <[email protected]>
Message-Id: <[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
lygstate added a commit to lygstate/qemu that referenced this issue Nov 28, 2021
The sh script are harder to maintain for compatible different
xsh environment so convert it to python script
Also incorporate the fixes in
https://patchew.org/QEMU/[email protected]/

According to msys2/MSYS2-packages#2176
We need use CYGWIN=noglob and MSYS=noglob in the environment variable
for disable wildcard expanding in msys or cygwin git, and setting the shell=False

Signed-off-by: Yonggang Luo <[email protected]>
Message-Id: <[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
lygstate added a commit to lygstate/qemu that referenced this issue Nov 30, 2021
The sh script are harder to maintain for compatible different
xsh environment so convert it to python script
Also incorporate the fixes in
https://patchew.org/QEMU/[email protected]/

According to msys2/MSYS2-packages#2176
We need use CYGWIN=noglob and MSYS=noglob in the environment variable
for disable wildcard expanding in msys or cygwin git, and setting the shell=False

Signed-off-by: Yonggang Luo <[email protected]>
Message-Id: <[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
lygstate added a commit to lygstate/qemu that referenced this issue Dec 4, 2021
The sh script are harder to maintain for compatible different
xsh environment so convert it to python script
Also incorporate the fixes in
https://patchew.org/QEMU/[email protected]/

According to msys2/MSYS2-packages#2176
We need use CYGWIN=noglob and MSYS=noglob in the environment variable
for disable wildcard expanding in msys or cygwin git, and setting the shell=False

Signed-off-by: Yonggang Luo <[email protected]>
Message-Id: <[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
lygstate added a commit to lygstate/qemu that referenced this issue Mar 21, 2022
The sh script are harder to maintain for compatible different
xsh environment so convert it to python script
Also incorporate the fixes in
https://patchew.org/QEMU/[email protected]/

According to msys2/MSYS2-packages#2176
We need use CYGWIN=noglob and MSYS=noglob in the environment variable
for disable wildcard expanding in msys or cygwin git, and setting the shell=False

Signed-off-by: Yonggang Luo <[email protected]>
Message-Id: <[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
lygstate added a commit to lygstate/qemu that referenced this issue Mar 22, 2022
The sh script are harder to maintain for compatible different
xsh environment so convert it to python script
Also incorporate the fixes in
https://patchew.org/QEMU/[email protected]/

According to msys2/MSYS2-packages#2176
We need use CYGWIN=noglob and MSYS=noglob in the environment variable
for disable wildcard expanding in msys or cygwin git, and setting the shell=False

Signed-off-by: Yonggang Luo <[email protected]>
Message-Id: <[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
lygstate added a commit to lygstate/qemu that referenced this issue Jul 28, 2022
The sh script are harder to maintain for compatible different
xsh environment so convert it to python script
Also incorporate the fixes in
https://patchew.org/QEMU/[email protected]/

According to msys2/MSYS2-packages#2176
We need use CYGWIN=noglob and MSYS=noglob in the environment variable
for disable wildcard expanding in msys or cygwin git, and setting the shell=False

Signed-off-by: Yonggang Luo <[email protected]>
Message-Id: <[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
lygstate added a commit to lygstate/qemu that referenced this issue Jul 28, 2022
The sh script are harder to maintain for compatible different
xsh environment so convert it to python script
Also incorporate the fixes in
https://patchew.org/QEMU/[email protected]/

According to msys2/MSYS2-packages#2176
We need use CYGWIN=noglob and MSYS=noglob in the environment variable
for disable wildcard expanding in msys or cygwin git, and setting the shell=False

Signed-off-by: Yonggang Luo <[email protected]>
Message-Id: <[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
lygstate added a commit to lygstate/qemu that referenced this issue Oct 11, 2023
The sh script are harder to maintain for compatible different
xsh environment so convert it to python script
Also incorporate the fixes in
https://patchew.org/QEMU/[email protected]/

According to msys2/MSYS2-packages#2176
We need use CYGWIN=noglob and MSYS=noglob in the environment variable
for disable wildcard expanding in msys or cygwin git, and setting the shell=False

Signed-off-by: Yonggang Luo <[email protected]>
Message-Id: <[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
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

No branches or pull requests

2 participants