summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShawn O. Pearce <spearce@spearce.org>2007-08-23 05:42:11 (GMT)
committerShawn O. Pearce <spearce@spearce.org>2007-08-23 05:42:11 (GMT)
commit217926c08cb634e3b5394ea15b3fe4520069260b (patch)
treefe14047db68f75b252443a9996b1ff0b112db35b
parent47e98eecf3721dca64e3d453fc96e3a02debe54f (diff)
downloadgit-217926c08cb634e3b5394ea15b3fe4520069260b.zip
git-217926c08cb634e3b5394ea15b3fe4520069260b.tar.gz
git-217926c08cb634e3b5394ea15b3fe4520069260b.tar.bz2
Teach bash to complete ref arguments to git-describe
I'm often finding that I need to run git-describe on very long remote tracking branch names, to find out what tagged revision the remote tracking branch is now at (or not at). Typing out the ref names is painful, so bash completion on them is a very useful feature. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
-rwxr-xr-xcontrib/completion/git-completion.bash8
1 files changed, 8 insertions, 0 deletions
diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index 8f27aa9..6ed6a51 100755
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -525,6 +525,11 @@ _git_commit ()
COMPREPLY=()
}
+_git_describe ()
+{
+ __gitcomp "$(__git_refs)"
+}
+
_git_diff ()
{
__git_complete_file
@@ -1065,6 +1070,7 @@ _git ()
cherry-pick) _git_cherry_pick ;;
commit) _git_commit ;;
config) _git_config ;;
+ describe) _git_describe ;;
diff) _git_diff ;;
fetch) _git_fetch ;;
format-patch) _git_format_patch ;;
@@ -1112,6 +1118,7 @@ complete -o default -o nospace -F _git_checkout git-checkout
complete -o default -o nospace -F _git_cherry git-cherry
complete -o default -o nospace -F _git_cherry_pick git-cherry-pick
complete -o default -o nospace -F _git_commit git-commit
+complete -o default -o nospace -F _git_describe git-describe
complete -o default -o nospace -F _git_diff git-diff
complete -o default -o nospace -F _git_fetch git-fetch
complete -o default -o nospace -F _git_format_patch git-format-patch
@@ -1145,6 +1152,7 @@ complete -o default -o nospace -F _git git.exe
complete -o default -o nospace -F _git_branch git-branch.exe
complete -o default -o nospace -F _git_bundle git-bundle.exe
complete -o default -o nospace -F _git_cherry git-cherry.exe
+complete -o default -o nospace -F _git_describe git-describe.exe
complete -o default -o nospace -F _git_diff git-diff.exe
complete -o default -o nospace -F _git_format_patch git-format-patch.exe
complete -o default -o nospace -F _git_log git-log.exe