author | Shawn O. Pearce <spearce@spearce.org> | |
Sun, 4 Feb 2007 07:38:27 +0000 (02:38 -0500) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Sun, 4 Feb 2007 08:18:41 +0000 (00:18 -0800) | ||
commit | 72e5e989b8c22dc6dd2b4f889d5d0dabf698b387 | |
tree | 52e57db95dff8d8f5a7bb8e798dcb02cb264d062 | tree | snapshot |
parent | 8435b548480a6b6d110fd2f59b3139f25ffb392e | commit | diff |
bash: Add space after unique command name is completed.
Because we use the nospace option for our completion function for
the main 'git' wrapper bash won't automatically add a space after a
unique completion has been made by the user. This has been pointed
out in the past by Linus Torvalds as an undesired behavior. I agree.
We have to use the nospace option to ensure path completion for
a command such as `git show` works properly, but that breaks the
common case of getting the space for a unique completion. So now we
set IFS=$'\n' (linefeed) and add a trailing space to every possible
completion option. This causes bash to insert the space when the
completion is unique.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Because we use the nospace option for our completion function for
the main 'git' wrapper bash won't automatically add a space after a
unique completion has been made by the user. This has been pointed
out in the past by Linus Torvalds as an undesired behavior. I agree.
We have to use the nospace option to ensure path completion for
a command such as `git show` works properly, but that breaks the
common case of getting the space for a unique completion. So now we
set IFS=$'\n' (linefeed) and add a trailing space to every possible
completion option. This causes bash to insert the space when the
completion is unique.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
contrib/completion/git-completion.bash | diff | blob | history |