提交 bf3c20f6 编写于 作者: T Thomas Rast 提交者: Junio C Hamano

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: NThomas Rast <trast@student.ethz.ch>
Acked-by: NShawn O. Pearce <spearce@spearce.org>
Signed-off-by: NJunio C Hamano <gitster@pobox.com>
上级 a393777e
......@@ -1003,6 +1003,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 "$__git_log_pretty_formats
......@@ -1030,7 +1035,7 @@ _git_log ()
--decorate
--walk-reflogs
--parents --children
--merge
$merge
$__git_diff_common_options
--pickaxe-all --pickaxe-regex
"
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册