From 776009d1b2bcfbd001767758fea0c2ff0e74383d Mon Sep 17 00:00:00 2001 From: John Keeping Date: Sat, 22 Jun 2013 12:25:17 +0100 Subject: completion: handle unstuck form of base git options MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Acked-by: SZEDER Gábor Signed-off-by: Junio C Hamano --- contrib/completion/git-completion.bash | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'contrib/completion') diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash index 6c3bafeea5..8fbf94103c 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 -- cgit v1.2.3 From 66fb37d0c62ef49c9d3506b10d2d7f5b33008484 Mon Sep 17 00:00:00 2001 From: John Keeping Date: Sat, 22 Jun 2013 12:25:18 +0100 Subject: completion: learn about --man-path MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: John Keeping Acked-by: SZEDER Gábor Signed-off-by: Junio C Hamano --- contrib/completion/git-completion.bash | 1 + 1 file changed, 1 insertion(+) (limited to 'contrib/completion') diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash index 8fbf94103c..b13c880e9a 100644 --- a/contrib/completion/git-completion.bash +++ b/contrib/completion/git-completion.bash @@ -2513,6 +2513,7 @@ __git_main () --exec-path --exec-path= --html-path + --man-path --info-path --work-tree= --namespace= -- cgit v1.2.3