summaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
authorRichard Quirk <richard.quirk@gmail.com>2008-04-27 17:35:10 +0200
committerJunio C Hamano <gitster@pobox.com>2008-04-27 21:38:22 -0700
commit07ba53f724b95a817f957b8e943c9e4f545a0949 (patch)
treee2aff2295122b87eb5878adf173b0e9c016f1063 /contrib
parent75ecfce39703e15a9f3d812faa4eb039935c8962 (diff)
downloadgit-07ba53f724b95a817f957b8e943c9e4f545a0949.tar.gz
bash: Add completion for gitk --merge
Option is only completed when .git/MERGE_HEAD is present. Signed-off-by: Richard Quirk <richard.quirk@gmail.com> Acked-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'contrib')
-rwxr-xr-xcontrib/completion/git-completion.bash7
1 files changed, 6 insertions, 1 deletions
diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index 665a895f5e..23db664f48 100755
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -1346,9 +1346,14 @@ _git ()
_gitk ()
{
local cur="${COMP_WORDS[COMP_CWORD]}"
+ local g="$(git rev-parse --git-dir 2>/dev/null)"
+ local merge=""
+ if [ -f $g/MERGE_HEAD ]; then
+ merge="--merge"
+ fi
case "$cur" in
--*)
- __gitcomp "--not --all"
+ __gitcomp "--not --all $merge"
return
;;
esac