scmbreeze / scm_breeze

Adds numbered shortcuts to the output git status, and much more

Home Page:https://madebynathan.com/2011/10/19/git-shortcuts-like-youve-never-seen-before/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Git status shortcuts broken edge case: filename with spaces

LeZuse opened this issue · comments

To reproduce simply create a file with spaces in its name. Git will show this:

$ git status
# On branch: master  |  [*] => $e
#
➤ Untracked files
#
#      untracked: [1] "my todo.txt"
#

$e1 now contains invalid filename:

$ echo $e1
/Users/zuse/Projects/pb-frontend/"my todo.txt"
$ cat $e1
cat: /Users/zuse/Projects/pb-frontend/"my: No such file or directory
cat: todo.txt": No such file or directory
$ cat "$e1"
cat: /Users/zuse/Projects/pb-frontend/"my todo.txt": No such file or directory
$ git --version
git version 2.10.2
$ cd ~/.scm_breeze/
$ git show --oneline
8a326c2 Merge pull request #262 from ghthor/refactor_of_git_status

Related to #267

I fixing this by reverting for now. We need better test coverage to handle a major change like the refactorization that was merged in #262

@ghthor I believe the offending commit is: 750697e.

In shell variables, the filenames should be literal (without quoting).

The filenames are preserved intact by quoting only at usage time:

cat "$e1"

Would you be willing to make a branch without this commit?

Oh, I see it's larger than that... Eg #267.

Yep, It's still my lack of ruby knowledge that is holding me back from hacking this back out over a weekend.