Browse Source

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>
maint
Richard Quirk 17 years ago committed by Junio C Hamano
parent
commit
07ba53f724
  1. 7
      contrib/completion/git-completion.bash

7
contrib/completion/git-completion.bash

@ -1346,9 +1346,14 @@ _git () @@ -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

Loading…
Cancel
Save