From: Richard Quirk Date: Sun, 27 Apr 2008 15:35:10 +0000 (+0200) Subject: bash: Add completion for gitk --merge X-Git-Tag: v1.5.6-rc0~120 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=07ba53f724b95a817f957b8e943c9e4f545a0949;p=git.git bash: Add completion for gitk --merge Option is only completed when .git/MERGE_HEAD is present. Signed-off-by: Richard Quirk Acked-by: Shawn O. Pearce Signed-off-by: Junio C Hamano --- diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash index 665a895f5..23db664f4 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