File: git-notes

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 (189 lines) | stat: -rw-r--r-- 6,000 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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
# (C) 2016-2025 magicant

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

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

function completion/git::notes:arg {

        OPTIONS=( #>#
        "--ref:; specify a note ref to operate on"
        ) #<#

        command -f completion//parseoptions -n
        case $ARGOPT in
                (-)
                        command -f completion//completeoptions
                        ;;
                (--ref)
                        command -f completion/git::completeref \
                                abbrprefixes='refs/ refs/notes/'
                        ;;
                ('')
                        command -f completion//getoperands
                        if [ ${WORDS[#]} -lt 1 ]; then
                                complete -P "$PREFIX" add append copy edit \
                                        get-ref list show merge prune remove
                        else
                                if command -vf "completion/git::notes:${WORDS[1]}:arg" >/dev/null 2>&1; then
                                        command -f "completion/git::notes:${WORDS[1]}:arg"
                                fi
                        fi
                        ;;
        esac

}

function completion/git::notes:add:arg {

        OPTIONS=( #>#
        "C: --reuse-message:; specify a blob used as the note message"
        "c: --reedit-message:; like -C, but reedit the message"
        "e --edit; edit the note message"
        "F: --file:; specify a file containing the note message"
        "f --force; overwrite existing note"
        "m: --message:; specify a note message"
        "--allow-empty; allow an empty note"
        "--no-separator; don't insert a separator"
        "--no-stripspace; leave leading and trailing spaces and blank lines"
        "--separator::; specify a inter-paragraph separator"
        "--stripspace; remove leading and trailing spaces and blank lines"
        ) #<#

        command -f completion//parseoptions
        case $ARGOPT in
                (-)
                        command -f completion//completeoptions
                        ;;
                ([Cc]|--reuse-message|--reedit-message|'')
                        command -f completion/git::completeref
                        ;;
                (F|--file)
                        complete -P "$PREFIX" -f
                        ;;
        esac

}

function completion/git::notes:append:arg {
        command -f completion/git::notes:add:arg "$@"
}

function completion/git::notes:copy:arg {

        OPTIONS=( #>#
        "f --force; overwrite existing note"
        "--stdin; read object names to remove notes from from standard input"
        ) #<#

        command -f completion//parseoptions
        case $ARGOPT in
                (-)
                        command -f completion//completeoptions
                        ;;
                ('')
                        command -f completion/git::completeref
                        ;;
        esac

}

function completion/git::notes:edit:arg {

        OPTIONS=( #>#
        "--allow-empty; allow an empty note"
        "--no-stripspace; leave leading and trailing spaces and blank lines"
        "--stripspace; remove leading and trailing spaces and blank lines"
        ) #<#

        command -f completion//parseoptions
        case $ARGOPT in
                (-)
                        command -f completion//completeoptions
                        ;;
                ('')
                        command -f completion/git::completeref
                        ;;
        esac

}

function completion/git::notes:list:arg {
        command -f completion/git::completeref
}

function completion/git::notes:merge:arg {

        OPTIONS=( #>#
        "--abort; abort the ongoing merge"
        "--commit; finalize the ongoing merge"
        "q --quiet; don't print informational messages"
        "s: --strategy:; specify a strategy to resolve conflict"
        "v --verbose; print detailed messages"
        ) #<#

        command -f completion//parseoptions
        case $ARGOPT in
                (-)
                        command -f completion//completeoptions
                        ;;
                (s|--strategy) #>>#
                        complete -P "$PREFIX" -D "catenate and sort note lines uniquely" cat_sort_uniq
                        complete -P "$PREFIX" -D "edit work tree" manual
                        complete -P "$PREFIX" -D "discard remote changes" ours
                        complete -P "$PREFIX" -D "discard local changes" theirs
                        complete -P "$PREFIX" -D "catenate notes" union
                        ;; #<<#
                ('')
                        command -f completion/git::completeref \
                                abbrprefixes='refs/ refs/notes/'
                        ;;
        esac

}

function completion/git::notes:prune:arg {

        OPTIONS=( #>#
        "n --dry-run; don't actually remove notes"
        "v --verbose; print detailed messages"
        ) #<#

        command -f completion//parseoptions
        case $ARGOPT in
                (-)
                        command -f completion//completeoptions
                        ;;
        esac

}

function completion/git::notes:remove:arg {

        OPTIONS=( #>#
        "--ignore-missing; ignore operands without notes"
        "--stdin; read object names to remove notes from from standard input"
        ) #<#

        command -f completion//parseoptions
        case $ARGOPT in
                (-)
                        command -f completion//completeoptions
                        ;;
                ('')
                        command -f completion/git::completeref
                        ;;
        esac

}

function completion/git::notes:show:arg {
        command -f completion/git::completeref
}


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