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

Git status shortcuts broken edge case: filename with spaces #268

Open
LeZuse opened this issue Sep 3, 2018 · 4 comments
Open

Git status shortcuts broken edge case: filename with spaces #268

LeZuse opened this issue Sep 3, 2018 · 4 comments

Comments

@LeZuse
Copy link

LeZuse commented Sep 3, 2018

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

@ghthor
Copy link
Member

ghthor commented Sep 5, 2018

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

@HaleTom
Copy link
Collaborator

HaleTom commented Sep 22, 2018

@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?

@HaleTom
Copy link
Collaborator

HaleTom commented Sep 22, 2018

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

@ghthor
Copy link
Member

ghthor commented Oct 18, 2018

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

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

No branches or pull requests

3 participants