File: git-rev-parse

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 (94 lines) | stat: -rw-r--r-- 4,276 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
# (C) 2016-2025 magicant

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

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

function completion/git::rev-parse:arg {

        OPTIONS=( #>#
        "--abbrev-ref::; print in short object names"
        "--absolute-git-dir; print the absolute path of the repository"
        "--after: --since:; convert the specified date to --max-age timestamp"
        "--before: --until:; convert the specified date to --mim-age timestamp"
        "--default; specify a default argument"
        "--disambiguate:; show all SHA-1 values that start with the specified prefix"
        "--end-of-options"
        "--exclude-hidden:; apply hideRefs to exclude refs"
        "--flags; print options only"
        "--git-common-dir; print the main repository path"
        "--git-dir; print the repository path"
        "--git-path; resolve a path inside the repository"
        "--is-bare-repository; test if the repository is bare"
        "--is-inside-git-dir; test if the current directory is inside a repository"
        "--is-inside-work-tree; test if the current directory is inside a working tree"
        "--is-shallow-repository; test if the repository is shallow"
        "--keep-dashdash"
        "--local-env-vars; print repository-local environment variables"
        "--no-flags; print operands only"
        "--no-revs; ignore arguments meant for rev-list"
        "--not; negate printed object names"
        "--output-object-format:; convert object IDs to the specified format"
        "--parseopt; enable option parsing mode"
        "--path-format:"
        "--prefix; specify a directory to operate in"
        "q --quiet; don't print any error message (with --verify)"
        "--show-ref-format; print the ref format used in the current repository"
        "--resolve-git-dir; test if the operand is a repository path"
        "--revs-only; ignore arguments not meant for rev-list"
        "--shared-index-path; print the shared index file path"
        "--short::; abbreviate printed SHA-1 values"
        "--show-cdup; print a relative path to the top-level directory"
        "--show-object-format:; print the object format used in the current repository"
        "--show-prefix; print a relative path from the top-level directory"
        "--show-superproject-working-tree; print the path to the superproject working tree"
        "--show-toplevel; print the absolute path of the top-level directory"
        "--sq; print with shell-friendly quotation"
        "--sq-quote; enable shell quoting mode"
        "--stop-at-non-option"
        "--stuck-long"
        "--symbolic; keep operands symbolic"
        "--symbolic-full-name; convert refs into full names"
        "--verify; verify if the operand names a valid object"
        ) #<#
        command -f completion/git::getrefselectopts

        command -f completion//parseoptions -n
        case $ARGOPT in
                (-)
                        command -f completion//completeoptions
                        ;;
                (--disambiguate)
                        ;;
                (--abbrev-ref) #>>#
                        complete -P "$PREFIX" -D "allow ambiguous names" loose
                        complete -P "$PREFIX" -D "ensure unambiguous names" strict
                        ;; #<<#
                (--exclude-hidden)
                        command -f completion/git::--exclude-hidden:arg
                        ;;
                (--output-object-format) #>>#
                        complete -P "$PREFIX" sha1 sha256 storage
                        ;; #<<#
                (--path-format) #>>#
                        complete -P "$PREFIX" absolute relative
                        ;; #<<#
                (--show-object-format) #>>#
                        complete -P "$PREFIX" storage input output
                        ;; #<<#
                ('')
                        command -f completion/git::completerefpath range=true
                        ;;
                (*)
                        command -f completion/git::completerefselectopts
                        ;;
        esac

}


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