Skip to content

Commit

Permalink
bash: Add completion for gitk --merge
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Richard Quirk authored and Junio C Hamano committed Apr 28, 2008
1 parent 75ecfce commit 07ba53f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion contrib/completion/git-completion.bash
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 07ba53f

Please sign in to comment.