From: John Keeping Date: Sat, 22 Jun 2013 11:25:17 GMT Subject: [PATCH 1/2] completion: handle unstuck form of base git options Message-ID: git-completion.bash's parsing of the command name relies on everything preceding it starting with '-' unless it is the "-c" option. This allows users to use the stuck form of "--work-tree=" and "--namespace=" but not the unstuck forms "--work-tree " and "--namespace ". Fix this. Similarly, the completion only handles the stuck form "--git-dir=" and not "--git-dir ", so fix this as well. Signed-off-by: John Keeping --- contrib/completion/git-completion.bash | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash index 6c3bafe..8fbf941 100644 --- a/contrib/completion/git-completion.bash +++ b/contrib/completion/git-completion.bash @@ -2492,9 +2492,10 @@ __git_main () i="${words[c]}" case "$i" in --git-dir=*) __git_dir="${i#--git-dir=}" ;; + --git-dir) ((c++)) ; __git_dir="${words[c]}" ;; --bare) __git_dir="." ;; --help) command="help"; break ;; - -c) c=$((++c)) ;; + -c|--work-tree|--namespace) ((c++)) ;; -*) ;; *) command="$i"; break ;; esac -- 1.8.3.1.676.gaae6535