gitbash keeps expanding a directory

719 views
Skip to first unread message

Luis Peregrina

unread,
Mar 10, 2021, 10:13:22 AM3/10/21
to git-for-windows
[CMD]
>> kubectl -n dev exec *** -- ls /
bin
boot
dev
etc
home
lib
lib64
logs
lost+found
media
mnt
opt
proc
root
run
sbin
service-bind
src
srv
sys
tmp
usr
var

[gitbash]
>> kubectl -n dev exec *** -- ls /
ls: cannot access 'C:/Program Files/Git/': No such file or directory
command terminated with exit code 2
>> kubectl -n dev exec vcd-mgmt-job-647bd477d4-ncd56 -- 'ls /'
error: Internal error occurred: error executing command in container: failed to exec in container: failed t
o start exec "9b472bacf626314a32332c1fcaf4c094f94db78b25f00ee5dcd50e3f8e149a77": OCI runtime exec failed: e
xec failed: container_linux.go:349: starting container process caused "exec: \"ls /\": stat ls /: no such f
ile or directory": unknown

Johannes Schindelin

unread,
Mar 19, 2021, 12:09:31 PM3/19/21
to Luis Peregrina, git-for-windows
Hi Luis,
Most likely, this will be helpful:
https://github.com/git-for-windows/build-extra/blob/main/ReleaseNotes.md#known-issues

In particular, this part:

If you specify command-line options starting with a slash,
POSIX-to-Windows path conversion will kick in converting e.g.
"/usr/bin/bash.exe" to "C:\Program Files\Git\usr\bin\bash.exe". When that
is not desired -- e.g. "--upload-pack=/opt/git/bin/git-upload-pack" or
"-L/regex/" -- you need to set the environment variable MSYS_NO_PATHCONV
temporarily, like so:

MSYS_NO_PATHCONV=1 git blame -L/pathconv/ msys2_path_conv.cc

Alternatively, you can double the first slash to avoid POSIX-to-Windows
path conversion, e.g. "//usr/bin/bash.exe".

Ciao,
Johannes
Reply all
Reply to author
Forward
Message has been deleted
0 new messages