bash completion: complete refs for git-grep
Before the --, always attempt ref completion. This helps with entering the <treeish> arguments to git-grep. As a bonus, you can work around git-grep's current lack of --all by hitting M-*, ugly as the resulting command line may be. Strictly speaking, completing the regular expression argument (or option argument) makes no sense. However, we cannot prevent _all_ completion (it will fall back to filenames), so we dispense with any additional complication to detect whether the user still has to enter a regular expression. Signed-off-by: Thomas Rast <trast@student.ethz.ch> Acked-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Thomas Rast committed
Oct 12, 2009 at 11:00 UTC
17225c49d501a304a0ae9ff370ca5cc3ae4afe4d
1 file changed
+2
-1
contrib/completion/git-completion.bash
+2
-1
@@ -1069,7 +1069,8 @@ _git_grep ()
1069
return
1070
;;
1071
esac
1072
- COMPREPLY=()
1072
+
1073
+ __gitcomp "$(__git_refs)"
1074
}
1075
1076
_git_help ()