summaryrefslogtreecommitdiff
path: root/contrib/completion
diff options
context:
space:
mode:
authorLibravatar Thomas Rast <trast@student.ethz.ch>2009-10-12 11:00:09 +0200
committerLibravatar Junio C Hamano <gitster@pobox.com>2009-10-12 16:13:19 -0700
commit17225c49d501a304a0ae9ff370ca5cc3ae4afe4d (patch)
tree539e36787a8667bc6d3beb47f488da8faf0ece8d /contrib/completion
parentdiff.c: stylefix (diff)
downloadtgif-17225c49d501a304a0ae9ff370ca5cc3ae4afe4d.tar.xz
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>
Diffstat (limited to 'contrib/completion')
-rwxr-xr-xcontrib/completion/git-completion.bash3
1 files changed, 2 insertions, 1 deletions
diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index 7cf8557468..d3fec32997 100755
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -1069,7 +1069,8 @@ _git_grep ()
return
;;
esac
- COMPREPLY=()
+
+ __gitcomp "$(__git_refs)"
}
_git_help ()