summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Rast <trast@student.ethz.ch>2009-02-16 16:34:57 (GMT)
committerJunio C Hamano <gitster@pobox.com>2009-03-30 16:06:48 (GMT)
commit67f1fe5f08d3f6146cf13f8a65ceeab1509581a8 (patch)
treec58c0f46a91c8f58cab2f3bd58ab5a9ed2268d7b
parentabfd5fa8725ef1a0ffddb0d1a768cbbfbc74a972 (diff)
downloadgit-67f1fe5f08d3f6146cf13f8a65ceeab1509581a8.zip
git-67f1fe5f08d3f6146cf13f8a65ceeab1509581a8.tar.gz
git-67f1fe5f08d3f6146cf13f8a65ceeab1509581a8.tar.bz2
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 <trast@student.ethz.ch> Acked-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rwxr-xr-xcontrib/completion/git-completion.bash7
1 files changed, 6 insertions, 1 deletions
diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index 554a03f..0bb74c0 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
;;