1
1
# shellcheck shell=bash
2
2
# bash completion support for git-extras.
3
3
4
+ _git_authors (){
5
+ __gitcomp " -l --list --no-email"
6
+ }
7
+
8
+ _git_browse (){
9
+ __git_complete_remote_or_refspec
10
+ }
11
+
12
+ _git_browse_ci (){
13
+ __git_complete_remote_or_refspec
14
+ }
15
+
16
+ _git_brv (){
17
+ __gitcomp " -r --reverse"
18
+ }
19
+
4
20
_git_changelog (){
5
21
local s_opts=( ' -a' ' -l' ' -t' ' -f' ' -s' ' -n' ' -p' ' -x' ' -h' ' ?' )
6
22
local l_opts=(
@@ -22,14 +38,6 @@ _git_changelog(){
22
38
__gitcomp " $merged_opts_str "
23
39
}
24
40
25
- _git_authors (){
26
- __gitcomp " -l --list --no-email"
27
- }
28
-
29
- _git_brv (){
30
- __gitcomp " -r --reverse"
31
- }
32
-
33
41
_git_coauthor (){
34
42
local oldIfs=$IFS
35
43
IFS=$' \n '
@@ -136,6 +144,10 @@ _git_ignore(){
136
144
esac
137
145
}
138
146
147
+ _git_info (){
148
+ __gitcomp " --color -c --no-config"
149
+ }
150
+
139
151
_git_missing (){
140
152
# Suggest all known refs
141
153
__gitcomp " $( git for-each-ref --format=' %(refname:short)' ) "
@@ -158,38 +170,40 @@ _git_reauthor(){
158
170
__gitcomp " ${comp} "
159
171
}
160
172
161
- _git_scp (){
162
- __git_complete_remote_or_refspec
173
+ __git_extras_rename (){
174
+ if (( COMP_CWORD == 2 || COMP_CWORD == 3 )) ; then
175
+ __gitcomp " $1 "
176
+ fi
163
177
}
164
178
165
- _git_stamp (){
166
- __gitcomp ' --replace -r '
179
+ _git_rename_branch (){
180
+ __git_extras_rename " $( __git_heads ) "
167
181
}
168
182
169
- _git_rscp (){
170
- __git_complete_remote_or_refspec
183
+ _git_rename_remote (){
184
+ __git_extras_rename " $( __git_remotes ) "
171
185
}
172
186
173
- _git_squash (){
174
- __gitcomp " $( __git_heads ) "
187
+ _git_rename_tag (){
188
+ __git_extras_rename " $( __git_tags ) "
175
189
}
176
190
177
- _git_undo (){
178
- __gitcomp " --hard --soft -h -s "
191
+ _git_rscp (){
192
+ __git_complete_remote_or_refspec
179
193
}
180
194
181
- _git_info (){
182
- __gitcomp " --color -c --no-config "
195
+ _git_scp (){
196
+ __git_complete_remote_or_refspec
183
197
}
184
198
185
- _git_browse (){
186
- __git_complete_remote_or_refspec
199
+ _git_squash (){
200
+ __gitcomp " $( __git_heads ) "
187
201
}
188
202
189
- _git_browse_ci (){
190
- __git_complete_remote_or_refspec
203
+ _git_stamp (){
204
+ __gitcomp ' --replace -r '
191
205
}
192
206
193
- _git_rename_file () {
194
- __gitcomp " -h --help "
207
+ _git_undo () {
208
+ __gitcomp " --hard --soft -h -s "
195
209
}
0 commit comments