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

File path separator gets removed #10

Open
dangler opened this issue Nov 13, 2015 · 3 comments
Open

File path separator gets removed #10

dangler opened this issue Nov 13, 2015 · 3 comments

Comments

@dangler
Copy link

dangler commented Nov 13, 2015

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
@mroth
Copy link
Owner

mroth commented Nov 16, 2015

Thanks! We definitely haven't done as much testing under Windows. This gives me something to get started on for that.

@benwh
Copy link

benwh commented Mar 2, 2017

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)"

@Aldian-fr
Copy link

The workaround fails when using git commit -m "some message with spaces".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants