@matheusbsbs / matheus-bagliano / commits / 67f1fe5f08
Fork 0

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>

Thomas Rast committed Feb 16, 2009 at 17:34 UTC 67f1fe5f08d3f6146cf13f8a65ceeab1509581a8
1 file changed +6 -1
contrib/completion/git-completion.bash
+6 -1
@@ -937,6 +937,11 @@ _git_log ()
937 __git_has_doubledash && return
938
939 local cur="${COMP_WORDS[COMP_CWORD]}"
940 + local g="$(git rev-parse --git-dir 2>/dev/null)"
941 + local merge=""
942 + if [ -f $g/MERGE_HEAD ]; then
943 + merge="--merge"
944 + fi
945 case "$cur" in
946 --pretty=*)
947 __gitcomp "
@@ -968,7 +973,7 @@ _git_log ()
973 --decorate --diff-filter=
974 --color-words --walk-reflogs
975 --parents --children --full-history
971 - --merge
976 + $merge
977 "
978 return
979 ;;