Code

Merge branch 'sg/merge-options' (early part)
[git.git] / contrib / completion / git-completion.bash
index 8091d2deb7d01f79b15d31812dd733aca479f03b..16984632d984006e2f2867a26714086bf3045ca3 100755 (executable)
@@ -152,7 +152,7 @@ __git_heads ()
                done
                return
        fi
-       for i in $(git-ls-remote "$1" 2>/dev/null); do
+       for i in $(git ls-remote "$1" 2>/dev/null); do
                case "$is_hash,$i" in
                y,*) is_hash=n ;;
                n,*^{}) is_hash=y ;;
@@ -173,7 +173,7 @@ __git_tags ()
                done
                return
        fi
-       for i in $(git-ls-remote "$1" 2>/dev/null); do
+       for i in $(git ls-remote "$1" 2>/dev/null); do
                case "$is_hash,$i" in
                y,*) is_hash=n ;;
                n,*^{}) is_hash=y ;;
@@ -200,7 +200,7 @@ __git_refs ()
                done
                return
        fi
-       for i in $(git-ls-remote "$dir" 2>/dev/null); do
+       for i in $(git ls-remote "$dir" 2>/dev/null); do
                case "$is_hash,$i" in
                y,*) is_hash=n ;;
                n,*^{}) is_hash=y ;;
@@ -223,7 +223,7 @@ __git_refs2 ()
 __git_refs_remotes ()
 {
        local cmd i is_hash=y
-       for i in $(git-ls-remote "$1" 2>/dev/null); do
+       for i in $(git ls-remote "$1" 2>/dev/null); do
                case "$is_hash,$i" in
                n,refs/heads/*)
                        is_hash=y
@@ -641,6 +641,7 @@ _git_diff ()
                        --ignore-all-space --exit-code --quiet --ext-diff
                        --no-ext-diff
                        --no-prefix --src-prefix= --dst-prefix=
+                       --base --ours --theirs
                        "
                return
                ;;
@@ -1052,6 +1053,7 @@ _git_remote ()
        local subcommands="add rm show prune update"
        local subcommand="$(__git_find_subcommand "$subcommands")"
        if [ -z "$subcommand" ]; then
+               __gitcomp "$subcommands"
                return
        fi
 
@@ -1344,9 +1346,14 @@ _git ()
 _gitk ()
 {
        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
        --*)
-               __gitcomp "--not --all"
+               __gitcomp "--not --all $merge"
                return
                ;;
        esac