From: Thomas Rast Date: Mon, 16 Feb 2009 16:34:57 +0000 (+0100) Subject: bash completion: only show 'log --merge' if merging X-Git-Tag: v1.6.2.2~7^2~1^2~1 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=67f1fe5f08d3f6146cf13f8a65ceeab1509581a8;p=git.git bash completion: only show 'log --merge' if merging 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 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 554a03ff4..0bb74c05e 100755 --- a/contrib/completion/git-completion.bash +++ b/contrib/completion/git-completion.bash @@ -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 " @@ -968,7 +973,7 @@ _git_log () --decorate --diff-filter= --color-words --walk-reflogs --parents --children --full-history - --merge + $merge " return ;;