File: git-pull

package info (click to toggle)
yash 2.60-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 6,152 kB
  • sloc: ansic: 34,578; makefile: 851; sh: 808; sed: 16
file content (76 lines) | stat: -rw-r--r-- 3,142 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# (C) 2011-2025 magicant

# Completion script for the "git-pull" command.
# Supports Git 2.48.1.

function completion/git-pull {
        WORDS=(git pull "${WORDS[2,-1]}")
        command -f completion//reexecute
}

function completion/git::pull:arg {

        OPTIONS=( #>#
        "--no-rebase; don't rebase but merge"
        "q --quiet; don't report progress"
        "r:: --rebase::; rebase the current branch instead of merging"
        "v --verbose" # TODO description
        ) #<#
        if command -vf completion/git::fetch:getopt >/dev/null 2>&1 ||
                        . -AL completion/git-fetch; then
                command -f completion/git::fetch:getopt
        fi
        if command -vf completion/git::merge:getopt >/dev/null 2>&1 ||
                        . -AL completion/git-merge; then
                command -f completion/git::merge:getopt
        fi

        command -f completion//parseoptions
        case $ARGOPT in
                (-)
                        command -f completion//completeoptions
                        ;;
                (--negotiation-tip|--recurse-submodules|--refmap| \
                        --shallow-exclude|--upload-pack)
                        command -f completion/git::$ARGOPT:arg
                        ;;
#               (--depth)
#                       ;;
                (r|--rebase) #>>#
                        complete -P "$PREFIX" -D "don't rebase but merge" false
                        complete -P "$PREFIX" -D "rebase" true
                        complete -P "$PREFIX" -D "rebase recreating merge commits" merges
                        complete -P "$PREFIX" -D "rebase interactively" interactive
                        ;; #<<#
                ('')
                        command -f completion//getoperands
                        if [ ${WORDS[#]} -eq 0 ]; then
                                #TODO complete remote URI
                                command -f completion/git::completeremote
                        elif [ "${WORDS[-1]}" = tag ]; then
                                command -f completion/git::completeref --tags
                        else
                                typeset word="${TARGETWORD#"$PREFIX"}"
                                word=${word#+}
                                case $word in
                                (*:*) # complete local refs
                                        word=${word#*:}
                                        PREFIX=${TARGETWORD%"$word"}
                                        command -f completion/git::completeref
                                        ;;
                                (*) # complete remote refs
                                        PREFIX=${TARGETWORD%"$word"}
                                        command -f completion/git::completeremoteref "${WORDS[1]}"
                                        ;;
                                esac
                        fi
                        ;;
                (*)
                        command -f completion/git::merge:compopt
                        ;;
        esac

}


# vim: set ft=sh ts=8 sts=8 sw=8 et: