Junio C Hamano [off-list ref] writes:
Steven Penny [off-list ref] writes:
quoted
Johannes Sixt wrote:
quoted
Are you saying that the new pwd function will also be used on Cygwin? That
would be a bug.
The linked patch should fix the problem for _MinGW_ users.
The problem will persist with _Cygwin_ users.
What does a full pathname, fed as a parameter when invoking Windows native
binaries like notepad, look like in a Cygwin environment? That is, if you
are writing a bash script that is meant to run in a Cygwin environment,
and if the script takes the name of a file in the current directory, but
it needs to chdir around for its own reasons before spawning notepad on
the file, i.e.
#!/bin/bash
file="$(pwd)/$1"
...
cd ..some..where..else..you..have..no..control..over
notepad "$file"
what is the right incantation to replace `pwd` in 'file="$(pwd)/$1"'
above?
Whatever that is, using that instead of `pwd` in git-sh-setup.sh here:
test -n "$GIT_DIR" && GIT_DIR=$(cd "$GIT_DIR" && pwd) || {
would be the solution.
Actually, the above is stated rather poorly. The path that ends up in
$file must be usable by both Windows native and Cygwin programs, as the
user may be using "vi" from Cygwin, or "notepad" like your example.
If there is no way to formulate $file to be acceptable for both, I do not
see any sane solution other than one side compromising for the rest,
perhaps by having
$ cat >notepad.sh <<\EOF
file=$(cygpath -m "$1") && exec notepad.exe "$file"
EOF
on the end-user side, or something like that.