2 # bash completion support for core Git.
4 # Copyright (C) 2006,2007 Shawn O. Pearce <spearce@spearce.org>
5 # Conceptually based on gitcompletion (http://gitweb.hawaga.org.uk/).
6 # Distributed under the GNU General Public License, version 2.0.
8 # The contained completion routines provide support for completing:
10 # *) local and remote branch names
11 # *) local and remote tag names
12 # *) .git/remotes file names
13 # *) git 'subcommands'
14 # *) tree paths within 'ref:path/to/file' expressions
15 # *) common --long-options
17 # To use these routines:
19 # 1) Copy this file to somewhere (e.g. ~/.git-completion.sh).
20 # 2) Added the following line to your .bashrc:
21 # source ~/.git-completion.sh
23 # 3) You may want to make sure the git executable is available
24 # in your PATH before this script is sourced, as some caching
25 # is performed while the script loads. If git isn't found
26 # at source time then all lookups will be done on demand,
27 # which may be slightly slower.
29 # 4) Consider changing your PS1 to also show the current branch:
30 # PS1='[\u@\h \W$(__git_ps1 " (%s)")]\$ '
32 # The argument to __git_ps1 will be displayed only if you
33 # are currently in a git repository. The %s token will be
34 # the name of the current branch.
38 # *) Read Documentation/SubmittingPatches
39 # *) Send all patches to the current maintainer:
41 # "Shawn O. Pearce" <spearce@spearce.org>
43 # *) Always CC the Git mailing list:
51 if [ -n "$__git_dir" ]; then
53 elif [ -d .git
]; then
56 git rev-parse
--git-dir 2>/dev
/null
58 elif [ -d "$1/.git" ]; then
67 local g
="$(git rev-parse --git-dir 2>/dev/null)"
71 if [ -d "$g/../.dotest" ]
73 if test -f "$g/../.dotest/rebasing"
76 elif test -f "$g/../.dotest/applying"
82 b
="$(git symbolic-ref HEAD 2>/dev/null)"
83 elif [ -f "$g/.dotest-merge/interactive" ]
86 b
="$(cat "$g/.dotest-merge
/head-name
")"
87 elif [ -d "$g/.dotest-merge" ]
90 b
="$(cat "$g/.dotest-merge
/head-name
")"
91 elif [ -f "$g/MERGE_HEAD" ]
94 b
="$(git symbolic-ref HEAD 2>/dev/null)"
96 if [ -f "$g/BISECT_LOG" ]
100 if ! b
="$(git symbolic-ref HEAD 2>/dev/null)"
102 if ! b
="$(git describe --exact-match HEAD 2>/dev/null)"
104 b
="$(cut -c1-7 "$g/HEAD
")..."
110 printf "$1" "${b##refs/heads/}$r"
112 printf " (%s)" "${b##refs/heads/}$r"
119 local c IFS
=' '$
'\t'$
'\n'
122 --*=*) printf %s$
'\n' "$c$2" ;;
123 *.
) printf %s$
'\n' "$c$2" ;;
124 *) printf %s$
'\n' "$c$2 " ;;
131 local cur
="${COMP_WORDS[COMP_CWORD]}"
132 if [ $# -gt 2 ]; then
141 COMPREPLY
=($
(compgen
-P "$2" \
142 -W "$(__gitcomp_1 "$1" "$4")" \
150 local cmd i is_hash
=y dir
="$(__gitdir "$1")"
151 if [ -d "$dir" ]; then
152 for i
in $
(git
--git-dir="$dir" \
153 for-each-ref
--format='%(refname)' \
155 echo "${i#refs/heads/}"
159 for i
in $
(git ls-remote
"$1" 2>/dev
/null
); do
160 case "$is_hash,$i" in
163 n
,refs
/heads
/*) is_hash
=y
; echo "${i#refs/heads/}" ;;
164 n
,*) is_hash
=y
; echo "$i" ;;
171 local cmd i is_hash
=y dir
="$(__gitdir "$1")"
172 if [ -d "$dir" ]; then
173 for i
in $
(git
--git-dir="$dir" \
174 for-each-ref
--format='%(refname)' \
176 echo "${i#refs/tags/}"
180 for i
in $
(git ls-remote
"$1" 2>/dev
/null
); do
181 case "$is_hash,$i" in
184 n
,refs
/tags
/*) is_hash
=y
; echo "${i#refs/tags/}" ;;
185 n
,*) is_hash
=y
; echo "$i" ;;
192 local cmd i is_hash
=y dir
="$(__gitdir "$1")"
193 if [ -d "$dir" ]; then
194 if [ -e "$dir/HEAD" ]; then echo HEAD
; fi
195 for i
in $
(git
--git-dir="$dir" \
196 for-each-ref
--format='%(refname)' \
197 refs
/tags refs
/heads refs
/remotes
); do
199 refs
/tags
/*) echo "${i#refs/tags/}" ;;
200 refs
/heads
/*) echo "${i#refs/heads/}" ;;
201 refs
/remotes
/*) echo "${i#refs/remotes/}" ;;
207 for i
in $
(git ls-remote
"$dir" 2>/dev
/null
); do
208 case "$is_hash,$i" in
211 n
,refs
/tags
/*) is_hash
=y
; echo "${i#refs/tags/}" ;;
212 n
,refs
/heads
/*) is_hash
=y
; echo "${i#refs/heads/}" ;;
213 n
,refs
/remotes
/*) is_hash
=y
; echo "${i#refs/remotes/}" ;;
214 n
,*) is_hash
=y
; echo "$i" ;;
222 for i
in $
(__git_refs
"$1"); do
227 __git_refs_remotes
()
229 local cmd i is_hash
=y
230 for i
in $
(git ls-remote
"$1" 2>/dev
/null
); do
231 case "$is_hash,$i" in
234 echo "$i:refs/remotes/$1/${i#refs/heads/}"
238 n
,refs
/tags
/*) is_hash
=y
;;
246 local i ngoff IFS
=$
'\n' d
="$(__gitdir)"
247 shopt -q nullglob || ngoff
=1
249 for i
in "$d/remotes"/*; do
250 echo ${i#$d/remotes/}
252 [ "$ngoff" ] && shopt -u nullglob
253 for i
in $
(git
--git-dir="$d" config
--list); do
263 __git_merge_strategies
()
265 if [ -n "$__git_merge_strategylist" ]; then
266 echo "$__git_merge_strategylist"
269 sed -n "/^all_strategies='/{
270 s/^all_strategies='//
274 }" "$(git --exec-path)/git-merge"
276 __git_merge_strategylist
=
277 __git_merge_strategylist
="$(__git_merge_strategies 2>/dev/null)"
279 __git_complete_file
()
281 local pfx
ls ref cur
="${COMP_WORDS[COMP_CWORD]}"
297 COMPREPLY
=($
(compgen
-P "$pfx" \
298 -W "$(git --git-dir="$
(__gitdir
)" ls-tree "$ls" \
299 | sed '/^100... blob /s,^.* ,,
308 __gitcomp
"$(__git_refs)"
313 __git_complete_revlist
()
315 local pfx cur
="${COMP_WORDS[COMP_CWORD]}"
320 __gitcomp
"$(__git_refs)" "$pfx" "$cur"
325 __gitcomp
"$(__git_refs)" "$pfx" "$cur"
328 __gitcomp
"$(__git_refs)"
335 if [ -n "$__git_commandlist" ]; then
336 echo "$__git_commandlist"
340 for i
in $
(git
help -a|
egrep '^ ')
343 *--*) : helper pattern
;;
344 applymbox
) : ask gittus
;;
345 applypatch
) : ask gittus
;;
346 archimport
) : import
;;
347 cat-file
) : plumbing
;;
348 check-attr
) : plumbing
;;
349 check-ref-format
) : plumbing
;;
350 commit-tree
) : plumbing
;;
351 cvsexportcommit
) : export;;
352 cvsimport
) : import
;;
353 cvsserver
) : daemon
;;
355 diff-files
) : plumbing
;;
356 diff-index
) : plumbing
;;
357 diff-tree
) : plumbing
;;
358 fast-import
) : import
;;
359 fsck-objects
) : plumbing
;;
360 fetch-pack
) : plumbing
;;
361 fmt-merge-msg
) : plumbing
;;
362 for-each-ref
) : plumbing
;;
363 hash-object
) : plumbing
;;
364 http-
*) : transport
;;
365 index-pack
) : plumbing
;;
366 init-db
) : deprecated
;;
367 local-fetch
) : plumbing
;;
368 mailinfo
) : plumbing
;;
369 mailsplit
) : plumbing
;;
370 merge-
*) : plumbing
;;
373 pack-objects
) : plumbing
;;
374 pack-redundant
) : plumbing
;;
375 pack-refs
) : plumbing
;;
376 parse-remote
) : plumbing
;;
377 patch-id
) : plumbing
;;
378 peek-remote
) : plumbing
;;
380 prune-packed
) : plumbing
;;
381 quiltimport
) : import
;;
382 read-tree
) : plumbing
;;
383 receive-pack
) : plumbing
;;
385 repo-config
) : deprecated
;;
387 rev-list
) : plumbing
;;
388 rev-parse
) : plumbing
;;
389 runstatus
) : plumbing
;;
390 sh-setup
) : internal
;;
392 send-pack
) : plumbing
;;
393 show-index
) : plumbing
;;
395 stripspace
) : plumbing
;;
396 symbolic-ref
) : plumbing
;;
397 tar-tree
) : deprecated
;;
398 unpack-file
) : plumbing
;;
399 unpack-objects
) : plumbing
;;
400 update-index
) : plumbing
;;
401 update-ref
) : plumbing
;;
402 update-server-info
) : daemon
;;
403 upload-archive
) : plumbing
;;
404 upload-pack
) : plumbing
;;
405 write-tree
) : plumbing
;;
406 verify-tag
) : plumbing
;;
412 __git_commandlist
="$(__git_commands 2>/dev/null)"
417 for i
in $
(git
--git-dir="$(__gitdir)" config
--list); do
427 __git_aliased_command
()
429 local word cmdline
=$
(git
--git-dir="$(__gitdir)" \
430 config
--get "alias.$1")
431 for word
in $cmdline; do
432 if [ "${word##-*}" ]; then
439 __git_find_subcommand
()
441 local word subcommand c
=1
443 while [ $c -lt $COMP_CWORD ]; do
444 word
="${COMP_WORDS[c]}"
445 for subcommand
in $1; do
446 if [ "$subcommand" = "$word" ]; then
455 __git_has_doubledash
()
458 while [ $c -lt $COMP_CWORD ]; do
459 if [ "--" = "${COMP_WORDS[c]}" ]; then
467 __git_whitespacelist
="nowarn warn error error-all strip"
471 local cur
="${COMP_WORDS[COMP_CWORD]}"
472 if [ -d .dotest
]; then
473 __gitcomp
"--skip --resolved"
478 __gitcomp
"$__git_whitespacelist" "" "${cur##--whitespace=}"
483 --signoff --utf8 --binary --3way --interactive
493 local cur
="${COMP_WORDS[COMP_CWORD]}"
496 __gitcomp
"$__git_whitespacelist" "" "${cur##--whitespace=}"
501 --stat --numstat --summary --check --index
502 --cached --index-info --reverse --reject --unidiff-zero
503 --apply --no-add --exclude=
504 --whitespace= --inaccurate-eof --verbose
513 __git_has_doubledash
&& return
515 local cur
="${COMP_WORDS[COMP_CWORD]}"
519 --interactive --refresh --patch --update --dry-run
529 __git_has_doubledash
&& return
531 local subcommands
="start bad good skip reset visualize replay log run"
532 local subcommand
="$(__git_find_subcommand "$subcommands")"
533 if [ -z "$subcommand" ]; then
534 __gitcomp
"$subcommands"
538 case "$subcommand" in
540 __gitcomp
"$(__git_refs)"
550 local i c
=1 only_local_ref
="n" has_r
="n"
552 while [ $c -lt $COMP_CWORD ]; do
555 -d|
-m) only_local_ref
="y" ;;
561 case "${COMP_WORDS[COMP_CWORD]}" in
562 --*=*) COMPREPLY
=() ;;
565 --color --no-color --verbose --abbrev= --no-abbrev
566 --track --no-track --contains --merged --no-merged
570 if [ $only_local_ref = "y" -a $has_r = "n" ]; then
571 __gitcomp
"$(__git_heads)"
573 __gitcomp
"$(__git_refs)"
581 local mycword
="$COMP_CWORD"
582 case "${COMP_WORDS[0]}" in
584 local cmd
="${COMP_WORDS[2]}"
585 mycword
="$((mycword-1))"
588 local cmd
="${COMP_WORDS[1]}"
593 __gitcomp
"create list-heads verify unbundle"
601 __git_complete_revlist
610 __gitcomp
"$(__git_refs)"
615 __gitcomp
"$(__git_refs)"
620 local cur
="${COMP_WORDS[COMP_CWORD]}"
623 __gitcomp
"--edit --no-commit"
626 __gitcomp
"$(__git_refs)"
633 __git_has_doubledash
&& return
635 local cur
="${COMP_WORDS[COMP_CWORD]}"
639 --all --author= --signoff --verify --no-verify
640 --edit --amend --include --only
649 __gitcomp
"$(__git_refs)"
654 __git_has_doubledash
&& return
656 local cur
="${COMP_WORDS[COMP_CWORD]}"
659 __gitcomp
"--cached --stat --numstat --shortstat --summary
660 --patch-with-stat --name-only --name-status --color
661 --no-color --color-words --no-renames --check
662 --full-index --binary --abbrev --diff-filter
663 --find-copies-harder --pickaxe-all --pickaxe-regex
664 --text --ignore-space-at-eol --ignore-space-change
665 --ignore-all-space --exit-code --quiet --ext-diff
667 --no-prefix --src-prefix= --dst-prefix=
668 --base --ours --theirs
678 __gitcomp
"$(__git_refs)"
683 local cur
="${COMP_WORDS[COMP_CWORD]}"
685 case "${COMP_WORDS[0]},$COMP_CWORD" in
687 __gitcomp
"$(__git_remotes)"
690 __gitcomp
"$(__git_remotes)"
695 __gitcomp
"$(__git_refs)" "" "${cur#*:}"
699 case "${COMP_WORDS[0]}" in
700 git-fetch
) remote
="${COMP_WORDS[1]}" ;;
701 git
) remote
="${COMP_WORDS[2]}" ;;
703 __gitcomp
"$(__git_refs2 "$remote")"
712 local cur
="${COMP_WORDS[COMP_CWORD]}"
716 --stdout --attach --thread
718 --numbered --start-number
723 --full-index --binary
726 --no-prefix --src-prefix= --dst-prefix=
731 __git_complete_revlist
736 local cur
="${COMP_WORDS[COMP_CWORD]}"
739 __gitcomp
"--prune --aggressive"
748 __gitcomp
"$(__git_remotes)"
758 __git_has_doubledash
&& return
760 local cur
="${COMP_WORDS[COMP_CWORD]}"
764 oneline short medium full fuller email raw
765 " "" "${cur##--pretty=}"
770 relative iso8601 rfc2822 short local default
771 " "" "${cur##--date=}"
776 --max-count= --max-age= --since= --after=
777 --min-age= --before= --until=
778 --root --topo-order --date-order --reverse
780 --abbrev-commit --abbrev=
781 --relative-date --date=
782 --author= --committer= --grep=
784 --pretty= --name-status --name-only --raw
786 --left-right --cherry-pick
788 --stat --numstat --shortstat
789 --decorate --diff-filter=
790 --color-words --walk-reflogs
795 __git_complete_revlist
800 local cur
="${COMP_WORDS[COMP_CWORD]}"
801 case "${COMP_WORDS[COMP_CWORD-1]}" in
803 __gitcomp
"$(__git_merge_strategies)"
808 __gitcomp
"$(__git_merge_strategies)" "" "${cur##--strategy=}"
813 --no-commit --no-stat --log --no-log --squash --strategy
817 __gitcomp
"$(__git_refs)"
822 __gitcomp
"$(__git_refs)"
827 __gitcomp
"--tags --all --stdin"
832 local cur
="${COMP_WORDS[COMP_CWORD]}"
834 case "${COMP_WORDS[0]},$COMP_CWORD" in
836 __gitcomp
"$(__git_remotes)"
839 __gitcomp
"$(__git_remotes)"
843 case "${COMP_WORDS[0]}" in
844 git-pull
) remote
="${COMP_WORDS[1]}" ;;
845 git
) remote
="${COMP_WORDS[2]}" ;;
847 __gitcomp
"$(__git_refs "$remote")"
854 local cur
="${COMP_WORDS[COMP_CWORD]}"
856 case "${COMP_WORDS[0]},$COMP_CWORD" in
858 __gitcomp
"$(__git_remotes)"
861 __gitcomp
"$(__git_remotes)"
867 case "${COMP_WORDS[0]}" in
868 git-push
) remote
="${COMP_WORDS[1]}" ;;
869 git
) remote
="${COMP_WORDS[2]}" ;;
871 __gitcomp
"$(__git_refs "$remote")" "" "${cur#*:}"
874 __gitcomp
"$(__git_refs)" + "${cur#+}"
877 __gitcomp
"$(__git_refs)"
886 local cur
="${COMP_WORDS[COMP_CWORD]}" dir
="$(__gitdir)"
887 if [ -d .dotest
] ||
[ -d "$dir"/.dotest-merge
]; then
888 __gitcomp
"--continue --skip --abort"
891 case "${COMP_WORDS[COMP_CWORD-1]}" in
893 __gitcomp
"$(__git_merge_strategies)"
898 __gitcomp
"$(__git_merge_strategies)" "" "${cur##--strategy=}"
902 __gitcomp
"--onto --merge --strategy --interactive"
905 __gitcomp
"$(__git_refs)"
910 local cur
="${COMP_WORDS[COMP_CWORD]}"
911 local prv
="${COMP_WORDS[COMP_CWORD-1]}"
914 __gitcomp
"$(__git_remotes)"
918 __gitcomp
"$(__git_refs)"
922 local remote
="${prv#remote.}"
923 remote
="${remote%.fetch}"
924 __gitcomp
"$(__git_refs_remotes "$remote")"
928 local remote
="${prv#remote.}"
929 remote
="${remote%.push}"
930 __gitcomp
"$(git --git-dir="$
(__gitdir
)" \
931 for-each-ref --format='%(refname):%(refname)' \
935 pull.twohead|pull.octopus
)
936 __gitcomp
"$(__git_merge_strategies)"
939 color.branch|color.
diff|color.status
)
940 __gitcomp
"always never auto"
945 black red green yellow blue magenta cyan white
946 bold dim ul blink reverse
958 --global --system --file=
960 --get --get-all --get-regexp
961 --add --unset --unset-all
962 --remove-section --rename-section
967 local pfx
="${cur%.*}."
969 __gitcomp
"remote merge" "$pfx" "$cur"
973 local pfx
="${cur%.*}."
975 __gitcomp
"$(__git_heads)" "$pfx" "$cur" "."
979 local pfx
="${cur%.*}."
982 url fetch push skipDefaultUpdate
983 receivepack uploadpack tagopt
988 local pfx
="${cur%.*}."
990 __gitcomp
"$(__git_remotes)" "$pfx" "$cur" "."
999 core.preferSymlinkRefs
1000 core.logAllRefUpdates
1001 core.loosecompression
1002 core.repositoryFormatVersion
1003 core.sharedRepository
1004 core.warnAmbiguousRefs
1006 core.packedGitWindowSize
1010 color.branch.current
1021 color.diff.whitespace
1026 color.status.changed
1027 color.status.untracked
1032 format.subjectprefix
1036 gitcvs.dbname gitcvs.dbdriver gitcvs.dbuser gitcvs.dbpass
1037 gitcvs.dbtablenameprefix
1040 gc.reflogexpireunreachable
1053 i18n.logOutputEncoding
1063 pack.deltaCacheLimit
1066 repack.useDeltaBaseOffset
1069 transfer.unpackLimit
1071 receive.denyNonFastForwards
1081 local subcommands
="add rm show prune update"
1082 local subcommand
="$(__git_find_subcommand "$subcommands")"
1083 if [ -z "$subcommand" ]; then
1084 __gitcomp
"$subcommands"
1088 case "$subcommand" in
1090 __gitcomp
"$(__git_remotes)"
1093 local i c
='' IFS
=$
'\n'
1094 for i
in $
(git
--git-dir="$(__gitdir)" config
--list); do
1112 __git_has_doubledash
&& return
1114 local cur
="${COMP_WORDS[COMP_CWORD]}"
1117 __gitcomp
"--mixed --hard --soft"
1121 __gitcomp
"$(__git_refs)"
1126 __git_has_doubledash
&& return
1128 local cur
="${COMP_WORDS[COMP_CWORD]}"
1132 --max-count= --max-age= --since= --after=
1133 --min-age= --before= --until=
1135 --author= --committer= --grep=
1138 --numbered --summary
1143 __git_complete_revlist
1148 local cur
="${COMP_WORDS[COMP_CWORD]}"
1152 oneline short medium full fuller email raw
1153 " "" "${cur##--pretty=}"
1157 __gitcomp
"--pretty="
1166 local subcommands
='save list show apply clear drop pop create'
1167 local subcommand
="$(__git_find_subcommand "$subcommands")"
1168 if [ -z "$subcommand" ]; then
1169 __gitcomp
"$subcommands"
1171 local cur
="${COMP_WORDS[COMP_CWORD]}"
1172 case "$subcommand,$cur" in
1174 __gitcomp
"--keep-index"
1185 __git_has_doubledash
&& return
1187 local subcommands
="add status init update"
1188 if [ -z "$(__git_find_subcommand "$subcommands")" ]; then
1189 local cur
="${COMP_WORDS[COMP_CWORD]}"
1192 __gitcomp
"--quiet --cached"
1195 __gitcomp
"$subcommands"
1205 init fetch clone rebase dcommit log find-rev
1206 set-tree commit-diff info create-ignore propget
1207 proplist show-ignore show-externals
1209 local subcommand
="$(__git_find_subcommand "$subcommands")"
1210 if [ -z "$subcommand" ]; then
1211 __gitcomp
"$subcommands"
1213 local remote_opts
="--username= --config-dir= --no-auth-cache"
1215 --follow-parent --authors-file= --repack=
1216 --no-metadata --use-svm-props --use-svnsync-props
1217 --log-window-size= --no-checkout --quiet
1218 --repack-flags --user-log-author $remote_opts
1221 --template= --shared= --trunk= --tags=
1222 --branches= --stdlayout --minimize-url
1223 --no-metadata --use-svm-props --use-svnsync-props
1224 --rewrite-root= $remote_opts
1227 --edit --rmdir --find-copies-harder --copy-similarity=
1230 local cur
="${COMP_WORDS[COMP_CWORD]}"
1231 case "$subcommand,$cur" in
1233 __gitcomp
"--revision= --fetch-all $fc_opts"
1236 __gitcomp
"--revision= $fc_opts $init_opts"
1239 __gitcomp
"$init_opts"
1243 --merge --strategy= --verbose --dry-run
1244 --fetch-all --no-rebase $cmt_opts $fc_opts
1248 __gitcomp
"--stdin $cmt_opts $fc_opts"
1250 create-ignore
,--*|propget
,--*|proplist
,--*|show-ignore
,--*|\
1252 __gitcomp
"--revision="
1256 --limit= --revision= --verbose --incremental
1257 --oneline --show-commit --non-recursive
1263 --merge --verbose --strategy= --local
1264 --fetch-all $fc_opts
1268 __gitcomp
"--message= --file= --revision= $cmt_opts"
1283 while [ $c -lt $COMP_CWORD ]; do
1284 i
="${COMP_WORDS[c]}"
1287 __gitcomp
"$(__git_tags)"
1297 case "${COMP_WORDS[COMP_CWORD-1]}" in
1303 __gitcomp
"$(__git_tags)"
1309 __gitcomp
"$(__git_refs)"
1316 local i c
=1 command __git_dir
1318 while [ $c -lt $COMP_CWORD ]; do
1319 i
="${COMP_WORDS[c]}"
1321 --git-dir=*) __git_dir
="${i#--git-dir=}" ;;
1322 --bare) __git_dir
="." ;;
1323 --version|
--help|
-p|
--paginate) ;;
1324 *) command="$i"; break ;;
1329 if [ -z "$command" ]; then
1330 case "${COMP_WORDS[COMP_CWORD]}" in
1331 --*=*) COMPREPLY
=() ;;
1343 *) __gitcomp
"$(__git_commands) $(__git_aliases)" ;;
1348 local expansion
=$
(__git_aliased_command
"$command")
1349 [ "$expansion" ] && command="$expansion"
1354 apply
) _git_apply
;;
1355 bisect
) _git_bisect
;;
1356 bundle
) _git_bundle
;;
1357 branch
) _git_branch
;;
1358 checkout
) _git_checkout
;;
1359 cherry
) _git_cherry
;;
1360 cherry-pick
) _git_cherry_pick
;;
1361 commit
) _git_commit
;;
1362 config
) _git_config
;;
1363 describe
) _git_describe
;;
1365 fetch
) _git_fetch
;;
1366 format-patch
) _git_format_patch
;;
1369 ls-remote
) _git_ls_remote
;;
1370 ls-tree
) _git_ls_tree
;;
1372 merge-base
) _git_merge_base
;;
1373 name-rev
) _git_name_rev
;;
1376 rebase
) _git_rebase
;;
1377 remote
) _git_remote
;;
1378 reset) _git_reset
;;
1379 shortlog
) _git_shortlog
;;
1381 show-branch
) _git_log
;;
1382 stash
) _git_stash
;;
1383 submodule
) _git_submodule
;;
1386 whatchanged
) _git_log
;;
1393 __git_has_doubledash
&& return
1395 local cur
="${COMP_WORDS[COMP_CWORD]}"
1396 local g
="$(git rev-parse --git-dir 2>/dev/null)"
1398 if [ -f $g/MERGE_HEAD
]; then
1403 __gitcomp
"--not --all $merge"
1407 __git_complete_revlist
1410 complete
-o default
-o nospace
-F _git git
1411 complete
-o default
-o nospace
-F _gitk gitk
1412 complete
-o default
-o nospace
-F _git_am git-am
1413 complete
-o default
-o nospace
-F _git_apply git-apply
1414 complete
-o default
-o nospace
-F _git_bisect git-bisect
1415 complete
-o default
-o nospace
-F _git_branch git-branch
1416 complete
-o default
-o nospace
-F _git_bundle git-bundle
1417 complete
-o default
-o nospace
-F _git_checkout git-checkout
1418 complete
-o default
-o nospace
-F _git_cherry git-cherry
1419 complete
-o default
-o nospace
-F _git_cherry_pick git-cherry-pick
1420 complete
-o default
-o nospace
-F _git_commit git-commit
1421 complete
-o default
-o nospace
-F _git_describe git-describe
1422 complete
-o default
-o nospace
-F _git_diff git-diff
1423 complete
-o default
-o nospace
-F _git_fetch git-fetch
1424 complete
-o default
-o nospace
-F _git_format_patch git-format-patch
1425 complete
-o default
-o nospace
-F _git_gc git-gc
1426 complete
-o default
-o nospace
-F _git_log git-log
1427 complete
-o default
-o nospace
-F _git_ls_remote git-ls-remote
1428 complete
-o default
-o nospace
-F _git_ls_tree git-ls-tree
1429 complete
-o default
-o nospace
-F _git_merge git-merge
1430 complete
-o default
-o nospace
-F _git_merge_base git-merge-base
1431 complete
-o default
-o nospace
-F _git_name_rev git-name-rev
1432 complete
-o default
-o nospace
-F _git_pull git-pull
1433 complete
-o default
-o nospace
-F _git_push git-push
1434 complete
-o default
-o nospace
-F _git_rebase git-rebase
1435 complete
-o default
-o nospace
-F _git_config git-config
1436 complete
-o default
-o nospace
-F _git_remote git-remote
1437 complete
-o default
-o nospace
-F _git_reset git-reset
1438 complete
-o default
-o nospace
-F _git_shortlog git-shortlog
1439 complete
-o default
-o nospace
-F _git_show git-show
1440 complete
-o default
-o nospace
-F _git_stash git-stash
1441 complete
-o default
-o nospace
-F _git_submodule git-submodule
1442 complete
-o default
-o nospace
-F _git_svn git-svn
1443 complete
-o default
-o nospace
-F _git_log git-show-branch
1444 complete
-o default
-o nospace
-F _git_tag git-tag
1445 complete
-o default
-o nospace
-F _git_log git-whatchanged
1447 # The following are necessary only for Cygwin, and only are needed
1448 # when the user has tab-completed the executable name and consequently
1449 # included the '.exe' suffix.
1451 if [ Cygwin
= "$(uname -o 2>/dev/null)" ]; then
1452 complete
-o default
-o nospace
-F _git_add git-add.exe
1453 complete
-o default
-o nospace
-F _git_apply git-apply.exe
1454 complete
-o default
-o nospace
-F _git git.exe
1455 complete
-o default
-o nospace
-F _git_branch git-branch.exe
1456 complete
-o default
-o nospace
-F _git_bundle git-bundle.exe
1457 complete
-o default
-o nospace
-F _git_cherry git-cherry.exe
1458 complete
-o default
-o nospace
-F _git_describe git-describe.exe
1459 complete
-o default
-o nospace
-F _git_diff git-diff.exe
1460 complete
-o default
-o nospace
-F _git_format_patch git-format-patch.exe
1461 complete
-o default
-o nospace
-F _git_log git-log.exe
1462 complete
-o default
-o nospace
-F _git_ls_tree git-ls-tree.exe
1463 complete
-o default
-o nospace
-F _git_merge_base git-merge-base.exe
1464 complete
-o default
-o nospace
-F _git_name_rev git-name-rev.exe
1465 complete
-o default
-o nospace
-F _git_push git-push.exe
1466 complete
-o default
-o nospace
-F _git_config git-config
1467 complete
-o default
-o nospace
-F _git_shortlog git-shortlog.exe
1468 complete
-o default
-o nospace
-F _git_show git-show.exe
1469 complete
-o default
-o nospace
-F _git_log git-show-branch.exe
1470 complete
-o default
-o nospace
-F _git_tag git-tag.exe
1471 complete
-o default
-o nospace
-F _git_log git-whatchanged.exe