File: git-clone

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 (95 lines) | stat: -rw-r--r-- 4,238 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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
# (C) 2011-2025 magicant

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

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

function completion/git::clone:arg {

        OPTIONS=( #>#
        "--also-filter-submodules"
        "--bare; clone as a bare repository"
        "b: --branch:; specify a branch to be the new repository's HEAD"
        "--bundle-uri:; specify a bundle file to fetch objects from"
        "c: --config:; specify a config variable for the new repository"
        "--depth:; specify the max number of history to clone"
        "--dissociate; stop borrowing objects after cloning"
        "--filter:; specify a filter for initial transfer"
        "j: --jobs:; specify the number of submodules to fetch in parallel"
        "l --local; optimize local clone"
        "--mirror; clone as a mirror repository"
        "n --no-checkout; don't check out HEAD automatically"
        "--no-hardlinks; don't use hard links to spare disk space for local clone"
        "--no-reject-shallow; allow cloning a shallow repository"
        "--no-remote-submodules; checkout submodules to the commit recorded in the superproject"
        "--no-single-branch; clone all branches"
        "--no-shallow-submodules; fully clone submodules"
        "--no-tags; don't clone tags"
        "o: --origin:; specify a name for the source repository to set as a remote repository"
        "--progress; report progress"
        "q --quiet; don't report progress"
        "--recursive:: --recurse-submodules::; initialize submodules recursively"
        "--reference:; specify a reference repository to share objects (possibly dangerous operation)"
        "--reference-if-able:; specify a reference repository to share objects if possible"
        "--ref-format:; specify a ref storage format"
        "--reject-shallow; don't clone a shallow repository"
        "--remote-submodules; update submodules from the remote repository"
        "--separate-git-dir:; specify a directory where the new repository is located"
        "--server-option:; specify an option for the git server"
        "--shallow-exclude:; specify a revision to exclude from shallow cloning"
        "--shallow-since:; specify a date to start shallow cloning"
        "--shallow-submodules; initialize submodules in shallow cloning"
        "s --shared; share objects in repositories (possibly dangerous operation)"
        "--single-branch; clone only one branch"
        "--sparse; only checkout files in the root directory"
        "--template:; specify a directory that contains templates"
        "u: --upload-pack:; specify a path for git-upload-pack on the remote host"
        "v --verbose" # TODO description
        ) #<#

        command -f completion//parseoptions
        case $ARGOPT in
                (-)
                        command -f completion//completeoptions
                        ;;
                (--filter|--ref-format)
                        command -f "completion/git::$ARGOPT:arg"
                        ;;
#               (b|--branch)
#                       ;;
                (c|--config)
                        if command -vf completion//git::completeoptionname >/dev/null 2>&1 ||
                                        . -AL completion/git-config; then
                                command -f completion//git::completeoptionname =
                        fi
                        ;;
#               (--depth)
#                       ;;
#               (o|--origin)
#                       ;;
#               (--shallow-since)
#                       ;;
                (u|--reference|--reference-if-able|--template|--separate-git-dir|--upload-pack)
                        complete -P "$PREFIX" -S / -T -d
                        ;;
                ('')
                        command -f completion//getoperands
                        command -f completion/git::clone:opr
                        ;;
        esac

}

function completion/git::clone:opr {
        if [ ${WORDS[#]} -eq 0 ]; then
                #TODO complete remote URI
        fi
        complete -P "$PREFIX" -S / -T -d
}


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