scmpuff
scmpuff copied to clipboard
File path separator gets removed
Installed with cmder running as git bash.
SL-Administrator@SL-ADMINIST2CD2 MINGW64 ~/code/test (master)
$ gs
# On branch: master | [*] => $e*
#
➤ Changes to be committed
#
# new file: [1] dir\readme.md
#
SL-Administrator@SL-ADMINIST2CD2 MINGW64 ~/code/test (master)
$ git add 1
fatal: C:UsersSL-Administratorcodetestdirreadme.md: 'C:UsersSL-Administratorcodetestdirreadme.md' is outside repository
Thanks! We definitely haven't done as much testing under Windows. This gives me something to get started on for that.
Here's the workaround I'm using for MinGW / MSYS (Git Bash). Note that it doesn't work with Cmder's bash, it looks like it just infinitely forks bash processes.
function git() {
case $1 in
commit|blame|log|rebase|merge)
eval "$SCMPUFF_GIT_CMD" "$(cygpath -u -- $(scmpuff expand -- "$@") | tr '\n' ' ')";;
checkout|diff|rm|reset)
eval "$SCMPUFF_GIT_CMD" "$(cygpath -u -- $(scmpuff expand --relative -- "$@") | tr '\n' ' ')";;
add)
eval "$SCMPUFF_GIT_CMD" "$(cygpath -u -- $(scmpuff expand -- "$@") | tr '\n' ' ')"
scmpuff_status;;
*)
"$SCMPUFF_GIT_CMD" "$@";;
esac
}
This needs to be sourced after the initial eval "$(scmpuff init -s)"
The workaround fails when using git commit -m "some message with spaces"
.