bash: add 'git svn' subcommands and options
Signed-off-by: SZEDER Gábor <szeder@ira.uka.de> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
SZEDER Gábor committed
Mar 10, 2008 at 16:02 UTC
47f6ee283891b757069c82922a88d1393be25dac
1 file changed
+80
-1
contrib/completion/git-completion.bash
+80
-1
@@ -384,7 +384,6 @@ __git_commands ()
384
show-index) : plumbing;;
385
ssh-*) : transport;;
386
stripspace) : plumbing;;
387
- svn) : import export;;
387
symbolic-ref) : plumbing;;
388
tar-tree) : deprecated;;
389
unpack-file) : plumbing;;
@@ -1142,6 +1141,84 @@ _git_submodule ()
1141
fi
1142
}
1143
1144
+_git_svn ()
1145
+{
1146
+ local subcommands="
1147
+ init fetch clone rebase dcommit log find-rev
1148
+ set-tree commit-diff info create-ignore propget
1149
+ proplist show-ignore show-externals
1150
+ "
1151
+ local subcommand="$(__git_find_subcommand "$subcommands")"
1152
+ if [ -z "$subcommand" ]; then
1153
+ __gitcomp "$subcommands"
1154
+ else
1155
+ local remote_opts="--username= --config-dir= --no-auth-cache"
1156
+ local fc_opts="
1157
+ --follow-parent --authors-file= --repack=
1158
+ --no-metadata --use-svm-props --use-svnsync-props
1159
+ --log-window-size= --no-checkout --quiet
1160
+ --repack-flags --user-log-author $remote_opts
1161
+ "
1162
+ local init_opts="
1163
+ --template= --shared= --trunk= --tags=
1164
+ --branches= --stdlayout --minimize-url
1165
+ --no-metadata --use-svm-props --use-svnsync-props
1166
+ --rewrite-root= $remote_opts
1167
+ "
1168
+ local cmt_opts="
1169
+ --edit --rmdir --find-copies-harder --copy-similarity=
1170
+ "
1171
+
1172
+ local cur="${COMP_WORDS[COMP_CWORD]}"
1173
+ case "$subcommand,$cur" in
1174
+ fetch,--*)
1175
+ __gitcomp "--revision= --fetch-all $fc_opts"
1176
+ ;;
1177
+ clone,--*)
1178
+ __gitcomp "--revision= $fc_opts $init_opts"
1179
+ ;;
1180
+ init,--*)
1181
+ __gitcomp "$init_opts"
1182
+ ;;
1183
+ dcommit,--*)
1184
+ __gitcomp "
1185
+ --merge --strategy= --verbose --dry-run
1186
+ --fetch-all --no-rebase $cmt_opts $fc_opts
1187
+ "
1188
+ ;;
1189
+ set-tree,--*)
1190
+ __gitcomp "--stdin $cmt_opts $fc_opts"
1191
+ ;;
1192
+ create-ignore,--*|propget,--*|proplist,--*|show-ignore,--*|\
1193
+ show-externals,--*)
1194
+ __gitcomp "--revision="
1195
+ ;;
1196
+ log,--*)
1197
+ __gitcomp "
1198
+ --limit= --revision= --verbose --incremental
1199
+ --oneline --show-commit --non-recursive
1200
+ --authors-file=
1201
+ "
1202
+ ;;
1203
+ rebase,--*)
1204
+ __gitcomp "
1205
+ --merge --verbose --strategy= --local
1206
+ --fetch-all $fc_opts
1207
+ "
1208
+ ;;
1209
+ commit-diff,--*)
1210
+ __gitcomp "--message= --file= --revision= $cmt_opts"
1211
+ ;;
1212
+ info,--*)
1213
+ __gitcomp "--url"
1214
+ ;;
1215
+ *)
1216
+ COMPREPLY=()
1217
+ ;;
1218
+ esac
1219
+ fi
1220
+}
1221
+
1222
_git_tag ()
1223
{
1224
local i c=1 f=0
@@ -1243,6 +1320,7 @@ _git ()
1320
show-branch) _git_log ;;
1321
stash) _git_stash ;;
1322
submodule) _git_submodule ;;
1323
+ svn) _git_svn ;;
1324
tag) _git_tag ;;
1325
whatchanged) _git_log ;;
1326
*) COMPREPLY=() ;;
@@ -1293,6 +1371,7 @@ complete -o default -o nospace -F _git_shortlog git-shortlog
1371
complete -o default -o nospace -F _git_show git-show
1372
complete -o default -o nospace -F _git_stash git-stash
1373
complete -o default -o nospace -F _git_submodule git-submodule
1374
+complete -o default -o nospace -F _git_svn git-svn
1375
complete -o default -o nospace -F _git_log git-show-branch
1376
complete -o default -o nospace -F _git_tag git-tag
1377
complete -o default -o nospace -F _git_log git-whatchanged