[PATCH v3 0/2] completion: handle paths with spaces correctly

2019-01-01 Thread Chayoung You
I found more issues with completion for git show ref:path, so here I add one more patch. Chayoung You (2): zsh: complete unquoted paths with spaces correctly completion: treat results of git ls-tree as file paths contrib/completion/git-completion.bash | 35

[PATCH v3 1/2] zsh: complete unquoted paths with spaces correctly

2019-01-01 Thread Chayoung You
The main cause of this behavior is __gitcomp_file_direct(). The both implementions of bash and zsh are called with an argument 'foo bar.txt', but only bash adds a backslash before a space on command line. [1]: http://zsh.sourceforge.net/Doc/Release/Completion-Widgets.html Signe

[PATCH v3 2/2] completion: treat results of git ls-tree as file paths

2019-01-01 Thread Chayoung You
ad. - The trailing slash of tree in __git ls-tree | sed. It makes the completion results on zsh become: git show HEAD:abc\ def/ So that the last space on command like should be removed on zsh to complete filenames under 'abc def/'. Signed-off-by: Chayoung You ---

[PATCH v2] zsh: complete unquoted paths with spaces correctly

2018-12-29 Thread Chayoung You
The main cause of this behavior is __gitcomp_file_direct(). The both implementions of bash and zsh are called with an argument 'foo bar.txt', but only bash adds a backslash before a space on command line. [1]: http://zsh.sourceforge.net/Doc/Release/Completion-Widgets.html Signe

[PATCH v2] completion: fix typo in git-completion.bash

2018-12-26 Thread Chayoung You
Signed-off-by: Chayoung You --- contrib/completion/git-completion.bash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash index 9e8ec95c3..86a9719a5 100644 --- a/contrib/completion/git

[PATCH] completion: fix typo in git-completion.bash

2018-12-26 Thread Chayoung You
--- contrib/completion/git-completion.bash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash index 9e8ec95c3..86a9719a5 100644 --- a/contrib/completion/git-completion.bash +++ b/contrib/completion/gi

[PATCH] completion: escape metacharacters when completing paths

2018-12-26 Thread Chayoung You
dd 'foo bar.txt' git add "foo bar.txt" The main cause of this behavior is __gitcomp_file_direct(). The both implementions of bash and zsh are called with an argument 'foo bar.txt', but only bash adds a backslash before a space on command line. [1]: http://zsh.