prydonius / karn

Manage multiple Git identities
MIT License
304 stars 7 forks source link

When Using the Auto Check Identity Updates Before Git Commands Snippet, Git Commands with Files that Contains Spaces in the Names are Broken #9

Closed groomsy closed 9 years ago

groomsy commented 9 years ago

If I have if which karn > /dev/null; then eval "$(karn init)"; fi in my ~/.bash_profile, anytime I try to perform a git command on a file with a space in the name, the command fails.

prydonius commented 9 years ago

I can't seem to reproduce on my end, can you post the error you're receiving?

groomsy commented 9 years ago

Sure:

~/Developer $ mkdir test
~/Developer $ cd test
~/Developer/test $ git init
Not inside Git work tree
Initialized empty Git repository in /Users/toddgrooms/Developer/test/.git/
~/Developer/test $ touch test\ test.txt
~/Developer/test *$ git status
On branch master

Initial commit

Untracked files:
  (use "git add <file>..." to include in what will be committed)

    test test.txt

nothing added to commit but untracked files present (use "git add" to track)
~/Developer/test *$ git add test\ test.txt
fatal: pathspec 'test' did not match any files
~/Developer/test *$ git add "test test.txt"
fatal: pathspec 'test' did not match any files
~/Developer/test *$ git add 'test test.txt'
fatal: pathspec 'test' did not match any files
groomsy commented 9 years ago

Also, my ~/.bash_profile for reference:

# Go
export GOPATH=$HOME/Developer/go
export GOROOT=/usr/local/opt/go/libexec
export PATH=$PATH:$GOPATH/bin:$GOROOT/bin

# Karn - https://github.com/prydonius/karn
if which karn > /dev/null; then eval "$(karn init)"; fi
prydonius commented 9 years ago

Thanks for the info, turns out I couldn't reproduce it in zsh, but encountered the issue in bash. I just committed a fix that worked for me, could you try checking out the latest version to see if it fixes the issue?

Thanks!

groomsy commented 9 years ago

Absolutely. Will check out this weekend.

Thanks!

Todd Grooms todd(dot)grooms(at)gmail(dot)com

On May 29, 2015, at 5:40 PM, Adnan Abdulhussein notifications@github.com wrote:

Thanks for the info, turns out I couldn't reproduce it in zsh, but encountered the issue in bash. I just committed a fix that worked for me, could you try checking out the latest version to see if it fixes the issue?

Thanks!

— Reply to this email directly or view it on GitHub.

groomsy commented 9 years ago

Stupid problem: I've cloned the repo, checked out the commit. I have removed the old src from the go get command from the initial install and have placed the cloned repo there. When I run go install, I get nothing in the bin directory. Am I missing something here?

groomsy commented 9 years ago

Derp. Never mind, just saw the cmd/karn directory.

groomsy commented 9 years ago

This works for me! :+1:

Thank you for the quick turnaround!

prydonius commented 9 years ago

Great! Thanks for reporting :)