Skip to content

Commit

Permalink
bash completion: only show 'log --merge' if merging
Browse files Browse the repository at this point in the history
The gitk completion only shows --merge if MERGE_HEAD is present.
Do it the same way for git-log completion.

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Acked-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Thomas Rast authored and Junio C Hamano committed Mar 30, 2009
1 parent abfd5fa commit 67f1fe5
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 @@ -937,6 +937,11 @@ _git_log ()
__git_has_doubledash && return

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
--pretty=*)
__gitcomp "
Expand Down Expand Up @@ -968,7 +973,7 @@ _git_log ()
--decorate --diff-filter=
--color-words --walk-reflogs
--parents --children --full-history
--merge
$merge
"
return
;;
Expand Down

0 comments on commit 67f1fe5

Please sign in to comment.