mroth / scmpuff

:1234: Numeric file shortcuts for common git commands
https://mroth.github.io/scmpuff/
MIT License
384 stars 22 forks source link

File path separator gets removed #10

Open dangler opened 9 years ago

dangler commented 9 years ago

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 commented 9 years ago

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

benwh commented 7 years ago

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 commented 5 years ago

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