3 # bash/zsh completion support for core Git.
5 # Copyright (C) 2006,2007 Shawn O. Pearce <spearce@spearce.org>
6 # Conceptually based on gitcompletion (http://gitweb.hawaga.org.uk/).
7 # Distributed under the GNU General Public License, version 2.0.
9 # The contained completion routines provide support for completing:
11 # *) local and remote branch names
12 # *) local and remote tag names
13 # *) .git/remotes file names
14 # *) git 'subcommands'
15 # *) tree paths within 'ref:path/to/file' expressions
16 # *) file paths within current working directory and index
17 # *) common --long-options
19 # To use these routines:
21 # 1) Copy this file to somewhere (e.g. ~/.git-completion.sh).
22 # 2) Add the following line to your .bashrc/.zshrc:
23 # source ~/.git-completion.sh
24 # 3) Consider changing your PS1 to also show the current branch,
25 # see git-prompt.sh for details.
27 case "$COMP_WORDBREAKS" in
29 *) COMP_WORDBREAKS
="$COMP_WORDBREAKS:"
32 # __gitdir accepts 0 or 1 arguments (i.e., location)
33 # returns location of .git repo
36 # Note: this function is duplicated in git-prompt.sh
37 # When updating it, make sure you update the other one to match.
38 if [ -z "${1-}" ]; then
39 if [ -n "${__git_dir-}" ]; then
41 elif [ -n "${GIT_DIR-}" ]; then
42 test -d "${GIT_DIR-}" ||
return 1
44 elif [ -d .git
]; then
47 git rev-parse
--git-dir 2>/dev
/null
49 elif [ -d "$1/.git" ]; then
69 # The following function is based on code from:
71 # bash_completion - programmable completion functions for bash 3.2+
73 # Copyright © 2006-2008, Ian Macdonald <ian@caliban.org>
74 # © 2009-2010, Bash Completion Maintainers
75 # <bash-completion-devel@lists.alioth.debian.org>
77 # This program is free software; you can redistribute it and/or modify
78 # it under the terms of the GNU General Public License as published by
79 # the Free Software Foundation; either version 2, or (at your option)
82 # This program is distributed in the hope that it will be useful,
83 # but WITHOUT ANY WARRANTY; without even the implied warranty of
84 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
85 # GNU General Public License for more details.
87 # You should have received a copy of the GNU General Public License
88 # along with this program; if not, write to the Free Software Foundation,
89 # Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
91 # The latest version of this software can be obtained here:
93 # http://bash-completion.alioth.debian.org/
97 # This function can be used to access a tokenized list of words
98 # on the command line:
100 # __git_reassemble_comp_words_by_ref '=:'
101 # if test "${words_[cword_-1]}" = -w
106 # The argument should be a collection of characters from the list of
107 # word completion separators (COMP_WORDBREAKS) to treat as ordinary
110 # This is roughly equivalent to going back in time and setting
111 # COMP_WORDBREAKS to exclude those characters. The intent is to
112 # make option types like --date=<type> and <rev>:<path> easy to
113 # recognize by treating each shell word as a single token.
115 # It is best not to set COMP_WORDBREAKS directly because the value is
116 # shared with other completion scripts. By the time the completion
117 # function gets called, COMP_WORDS has already been populated so local
118 # changes to COMP_WORDBREAKS have no effect.
120 # Output: words_, cword_, cur_.
122 __git_reassemble_comp_words_by_ref
()
124 local exclude i j first
125 # Which word separators to exclude?
126 exclude
="${1//[^$COMP_WORDBREAKS]}"
128 if [ -z "$exclude" ]; then
129 words_
=("${COMP_WORDS[@]}")
132 # List of word completion separators has shrunk;
133 # re-assemble words to complete.
134 for ((i
=0, j
=0; i
< ${#COMP_WORDS[@]}; i
++, j
++)); do
135 # Append each nonempty word consisting of just
136 # word separator characters to the current word.
140 [ -n "${COMP_WORDS[$i]}" ] &&
141 # word consists of excluded word separators
142 [ "${COMP_WORDS[$i]//[^$exclude]}" = "${COMP_WORDS[$i]}" ]
144 # Attach to the previous token,
145 # unless the previous token is the command name.
146 if [ $j -ge 2 ] && [ -n "$first" ]; then
150 words_
[$j]=${words_[j]}${COMP_WORDS[i]}
151 if [ $i = $COMP_CWORD ]; then
154 if (($i < ${#COMP_WORDS[@]} - 1)); then
161 words_
[$j]=${words_[j]}${COMP_WORDS[i]}
162 if [ $i = $COMP_CWORD ]; then
168 if ! type _get_comp_words_by_ref
>/dev
/null
2>&1; then
169 _get_comp_words_by_ref
()
171 local exclude cur_ words_ cword_
172 if [ "$1" = "-n" ]; then
176 __git_reassemble_comp_words_by_ref
"$exclude"
177 cur_
=${words_[cword_]}
178 while [ $# -gt 0 ]; do
184 prev
=${words_[$cword_-1]}
187 words
=("${words_[@]}")
198 # Generates completion reply with compgen, appending a space to possible
199 # completion words, if necessary.
200 # It accepts 1 to 4 arguments:
201 # 1: List of possible completion words.
202 # 2: A prefix to be added to each possible completion word (optional).
203 # 3: Generate possible completion matches for this word (optional).
204 # 4: A suffix to be appended to each possible completion word (optional).
207 local cur_
="${3-$cur}"
215 COMPREPLY
=($
(compgen
-P "${2-}" \
216 -W "$(__gitcomp_1 "${1-}" "${4-}")" \
222 # Generates completion reply with compgen from newline-separated possible
223 # completion words by appending a space to all of them.
224 # It accepts 1 to 4 arguments:
225 # 1: List of possible completion words, separated by a single newline.
226 # 2: A prefix to be added to each possible completion word (optional).
227 # 3: Generate possible completion matches for this word (optional).
228 # 4: A suffix to be appended to each possible completion word instead of
229 # the default space (optional). If specified but empty, nothing is
234 COMPREPLY
=($
(compgen
-P "${2-}" -S "${4- }" -W "$1" -- "${3-$cur}"))
237 # Generates completion reply with compgen from newline-separated possible
238 # completion filenames.
239 # It accepts 1 to 3 arguments:
240 # 1: List of possible completion filenames, separated by a single newline.
241 # 2: A directory prefix to be added to each possible completion filename
243 # 3: Generate possible completion matches for this word (optional).
248 # XXX does not work when the directory prefix contains a tilde,
249 # since tilde expansion is not applied.
250 # This means that COMPREPLY will be empty and Bash default
251 # completion will be used.
252 COMPREPLY
=($
(compgen
-P "${2-}" -W "$1" -- "${3-$cur}"))
254 # Tell Bash that compspec generates filenames.
255 compopt
-o filenames
2>/dev
/null
258 __git_index_file_list_filter_compat
()
262 while read -r path
; do
264 ?
*/*) echo "${path%%/*}/" ;;
270 __git_index_file_list_filter_bash
()
274 while read -r path
; do
277 # XXX if we append a slash to directory names when using
278 # `compopt -o filenames`, Bash will append another slash.
279 # This is pretty stupid, and this the reason why we have to
280 # define a compatible version for this function.
281 echo "${path%%/*}" ;;
288 # Process path list returned by "ls-files" and "diff-index --name-only"
289 # commands, in order to list only file names relative to a specified
290 # directory, and append a slash to directory names.
291 __git_index_file_list_filter
()
293 # Default to Bash >= 4.x
294 __git_index_file_list_filter_bash
297 # Execute git ls-files, returning paths relative to the directory
298 # specified in the first argument, and using the options specified in
299 # the second argument.
300 __git_ls_files_helper
()
302 # NOTE: $2 is not quoted in order to support multiple options
303 cd "$1" && git ls-files
--exclude-standard $2
307 # Execute git diff-index, returning paths relative to the directory
308 # specified in the first argument, and using the tree object id
309 # specified in the second argument.
310 __git_diff_index_helper
()
312 cd "$1" && git diff-index
--name-only --relative "$2"
315 # __git_index_files accepts 1 or 2 arguments:
316 # 1: Options to pass to ls-files (required).
317 # Supported options are --cached, --modified, --deleted, --others,
319 # 2: A directory path (optional).
320 # If provided, only files within the specified directory are listed.
321 # Sub directories are never recursed. Path must have a trailing
325 local dir
="$(__gitdir)" root
="${2-.}"
327 if [ -d "$dir" ]; then
328 __git_ls_files_helper
"$root" "$1" | __git_index_file_list_filter |
333 # __git_diff_index_files accepts 1 or 2 arguments:
334 # 1) The id of a tree object.
335 # 2) A directory path (optional).
336 # If provided, only files within the specified directory are listed.
337 # Sub directories are never recursed. Path must have a trailing
339 __git_diff_index_files
()
341 local dir
="$(__gitdir)" root
="${2-.}"
343 if [ -d "$dir" ]; then
344 __git_diff_index_helper
"$root" "$1" | __git_index_file_list_filter |
351 local dir
="$(__gitdir)"
352 if [ -d "$dir" ]; then
353 git
--git-dir="$dir" for-each-ref
--format='%(refname:short)' \
361 local dir
="$(__gitdir)"
362 if [ -d "$dir" ]; then
363 git
--git-dir="$dir" for-each-ref
--format='%(refname:short)' \
369 # __git_refs accepts 0, 1 (to pass to __gitdir), or 2 arguments
370 # presence of 2nd argument means use the guess heuristic employed
371 # by checkout for tracking branches
374 local i
hash dir
="$(__gitdir "${1-}")" track
="${2-}"
376 if [ -d "$dir" ]; then
384 for i
in HEAD FETCH_HEAD ORIG_HEAD MERGE_HEAD
; do
385 if [ -e "$dir/$i" ]; then echo $i; fi
387 format
="refname:short"
388 refs
="refs/tags refs/heads refs/remotes"
391 git
--git-dir="$dir" for-each-ref
--format="%($format)" \
393 if [ -n "$track" ]; then
394 # employ the heuristic used by git checkout
395 # Try to find a remote branch that matches the completion word
396 # but only output if the branch name is unique
398 git
--git-dir="$dir" for-each-ref
--shell --format="ref=%(refname:short)" \
400 while read -r entry
; do
403 if [[ "$ref" == "$cur"* ]]; then
406 done |
sort |
uniq -u
412 git ls-remote
"$dir" "$cur*" 2>/dev
/null | \
413 while read -r hash i
; do
421 git ls-remote
"$dir" HEAD ORIG_HEAD
'refs/tags/*' 'refs/heads/*' 'refs/remotes/*' 2>/dev
/null | \
422 while read -r hash i
; do
425 refs
/*) echo "${i#refs/*/}" ;;
433 # __git_refs2 requires 1 argument (to pass to __git_refs)
437 for i
in $
(__git_refs
"$1"); do
442 # __git_refs_remotes requires 1 argument (to pass to ls-remote)
443 __git_refs_remotes
()
446 git ls-remote
"$1" 'refs/heads/*' 2>/dev
/null | \
447 while read -r hash i
; do
448 echo "$i:refs/remotes/$1/${i#refs/heads/}"
454 local i IFS
=$
'\n' d
="$(__gitdir)"
455 test -d "$d/remotes" && ls -1 "$d/remotes"
456 for i
in $
(git
--git-dir="$d" config
--get-regexp 'remote\..*\.url' 2>/dev
/null
); do
462 __git_list_merge_strategies
()
464 git merge
-s help 2>&1 |
465 sed -n -e '/[Aa]vailable strategies are: /,/^$/{
474 __git_merge_strategies
=
475 # 'git merge -s help' (and thus detection of the merge strategy
476 # list) fails, unfortunately, if run outside of any git working
477 # tree. __git_merge_strategies is set to the empty string in
478 # that case, and the detection will be repeated the next time it
480 __git_compute_merge_strategies
()
482 test -n "$__git_merge_strategies" ||
483 __git_merge_strategies
=$
(__git_list_merge_strategies
)
486 __git_complete_revlist_file
()
488 local pfx
ls ref cur_
="$cur"
508 case "$COMP_WORDBREAKS" in
510 *) pfx
="$ref:$pfx" ;;
513 __gitcomp_nl
"$(git --git-dir="$
(__gitdir
)" ls-tree "$ls" 2>/dev/null \
514 | sed '/^100... blob /{
530 pfx
="${cur_%...*}..."
532 __gitcomp_nl
"$(__git_refs)" "$pfx" "$cur_"
537 __gitcomp_nl
"$(__git_refs)" "$pfx" "$cur_"
540 __gitcomp_nl
"$(__git_refs)"
546 # __git_complete_index_file requires 1 argument: the options to pass to
548 __git_complete_index_file
()
550 local pfx cur_
="$cur"
558 __gitcomp_file
"$(__git_index_files "$1" "$pfx")" "$pfx" "$cur_"
561 __gitcomp_file
"$(__git_index_files "$1")" "" "$cur_"
566 # __git_complete_diff_index_file requires 1 argument: the id of a tree
568 __git_complete_diff_index_file
()
570 local pfx cur_
="$cur"
578 __gitcomp_file
"$(__git_diff_index_files "$1" "$pfx")" "$pfx" "$cur_"
581 __gitcomp_file
"$(__git_diff_index_files "$1")" "" "$cur_"
586 __git_complete_file
()
588 __git_complete_revlist_file
591 __git_complete_revlist
()
593 __git_complete_revlist_file
596 __git_complete_remote_or_refspec
()
598 local cur_
="$cur" cmd
="${words[1]}"
599 local i c
=2 remote
="" pfx
="" lhs
=1 no_complete_refspec
=0
600 if [ "$cmd" = "remote" ]; then
603 while [ $c -lt $cword ]; do
606 --mirror) [ "$cmd" = "push" ] && no_complete_refspec
=1 ;;
609 push
) no_complete_refspec
=1 ;;
618 *) remote
="$i"; break ;;
622 if [ -z "$remote" ]; then
623 __gitcomp_nl
"$(__git_remotes)"
626 if [ $no_complete_refspec = 1 ]; then
630 [ "$remote" = "." ] && remote
=
633 case "$COMP_WORDBREAKS" in
635 *) pfx
="${cur_%%:*}:" ;;
647 if [ $lhs = 1 ]; then
648 __gitcomp_nl
"$(__git_refs2 "$remote")" "$pfx" "$cur_"
650 __gitcomp_nl
"$(__git_refs)" "$pfx" "$cur_"
654 if [ $lhs = 1 ]; then
655 __gitcomp_nl
"$(__git_refs "$remote")" "$pfx" "$cur_"
657 __gitcomp_nl
"$(__git_refs)" "$pfx" "$cur_"
661 if [ $lhs = 1 ]; then
662 __gitcomp_nl
"$(__git_refs)" "$pfx" "$cur_"
664 __gitcomp_nl
"$(__git_refs "$remote")" "$pfx" "$cur_"
670 __git_complete_strategy
()
672 __git_compute_merge_strategies
675 __gitcomp
"$__git_merge_strategies"
680 __gitcomp
"$__git_merge_strategies" "" "${cur##--strategy=}"
688 if test -n "${GIT_TESTING_COMMAND_COMPLETION:-}"
690 printf "%s" "${GIT_TESTING_COMMAND_COMPLETION}"
692 git
help -a|
egrep '^ [a-zA-Z0-9]'
696 __git_list_all_commands
()
699 for i
in $
(__git_commands
)
702 *--*) : helper pattern
;;
709 __git_compute_all_commands
()
711 test -n "$__git_all_commands" ||
712 __git_all_commands
=$
(__git_list_all_commands
)
715 __git_list_porcelain_commands
()
718 __git_compute_all_commands
719 for i
in $__git_all_commands
722 *--*) : helper pattern
;;
723 applymbox
) : ask gittus
;;
724 applypatch
) : ask gittus
;;
725 archimport
) : import
;;
726 cat-file
) : plumbing
;;
727 check-attr
) : plumbing
;;
728 check-ignore
) : plumbing
;;
729 check-ref-format
) : plumbing
;;
730 checkout-index
) : plumbing
;;
731 commit-tree
) : plumbing
;;
732 count-objects
) : infrequent
;;
733 credential-cache
) : credentials helper
;;
734 credential-store
) : credentials helper
;;
735 cvsexportcommit
) : export;;
736 cvsimport
) : import
;;
737 cvsserver
) : daemon
;;
739 diff-files
) : plumbing
;;
740 diff-index
) : plumbing
;;
741 diff-tree
) : plumbing
;;
742 fast-import
) : import
;;
743 fast-export
) : export;;
744 fsck-objects
) : plumbing
;;
745 fetch-pack
) : plumbing
;;
746 fmt-merge-msg
) : plumbing
;;
747 for-each-ref
) : plumbing
;;
748 hash-object
) : plumbing
;;
749 http-
*) : transport
;;
750 index-pack
) : plumbing
;;
751 init-db
) : deprecated
;;
752 local-fetch
) : plumbing
;;
753 lost-found
) : infrequent
;;
754 ls-files
) : plumbing
;;
755 ls-remote
) : plumbing
;;
756 ls-tree
) : plumbing
;;
757 mailinfo
) : plumbing
;;
758 mailsplit
) : plumbing
;;
759 merge-
*) : plumbing
;;
762 pack-objects
) : plumbing
;;
763 pack-redundant
) : plumbing
;;
764 pack-refs
) : plumbing
;;
765 parse-remote
) : plumbing
;;
766 patch-id
) : plumbing
;;
767 peek-remote
) : plumbing
;;
769 prune-packed
) : plumbing
;;
770 quiltimport
) : import
;;
771 read-tree
) : plumbing
;;
772 receive-pack
) : plumbing
;;
773 remote-
*) : transport
;;
774 repo-config
) : deprecated
;;
776 rev-list
) : plumbing
;;
777 rev-parse
) : plumbing
;;
778 runstatus
) : plumbing
;;
779 sh-setup
) : internal
;;
781 show-ref
) : plumbing
;;
782 send-pack
) : plumbing
;;
783 show-index
) : plumbing
;;
785 stripspace
) : plumbing
;;
786 symbolic-ref
) : plumbing
;;
787 tar-tree
) : deprecated
;;
788 unpack-file
) : plumbing
;;
789 unpack-objects
) : plumbing
;;
790 update-index
) : plumbing
;;
791 update-ref
) : plumbing
;;
792 update-server-info
) : daemon
;;
793 upload-archive
) : plumbing
;;
794 upload-pack
) : plumbing
;;
795 write-tree
) : plumbing
;;
797 verify-pack
) : infrequent
;;
798 verify-tag
) : plumbing
;;
804 __git_porcelain_commands
=
805 __git_compute_porcelain_commands
()
807 __git_compute_all_commands
808 test -n "$__git_porcelain_commands" ||
809 __git_porcelain_commands
=$
(__git_list_porcelain_commands
)
812 __git_pretty_aliases
()
815 for i
in $
(git
--git-dir="$(__gitdir)" config
--get-regexp "pretty\..*" 2>/dev
/null
); do
828 for i
in $
(git
--git-dir="$(__gitdir)" config
--get-regexp "alias\..*" 2>/dev
/null
); do
838 # __git_aliased_command requires 1 argument
839 __git_aliased_command
()
841 local word cmdline
=$
(git
--git-dir="$(__gitdir)" \
842 config
--get "alias.$1")
843 for word
in $cmdline; do
849 \
!*) : shell
command alias ;;
851 *=*) : setting env
;;
860 # __git_find_on_cmdline requires 1 argument
861 __git_find_on_cmdline
()
863 local word subcommand c
=1
864 while [ $c -lt $cword ]; do
866 for subcommand
in $1; do
867 if [ "$subcommand" = "$word" ]; then
876 __git_has_doubledash
()
879 while [ $c -lt $cword ]; do
880 if [ "--" = "${words[c]}" ]; then
888 # Try to count non option arguments passed on the command line for the
889 # specified git command.
890 # When options are used, it is necessary to use the special -- option to
891 # tell the implementation were non option arguments begin.
892 # XXX this can not be improved, since options can appear everywhere, as
896 # __git_count_arguments requires 1 argument: the git command executed.
897 __git_count_arguments
()
901 # Skip "git" (first argument)
902 for ((i
=1; i
< ${#words[@]}; i
++)); do
907 # Good; we can assume that the following are only non
912 # Skip the specified git command and discard git
925 __git_whitespacelist
="nowarn warn error error-all fix"
929 local dir
="$(__gitdir)"
930 if [ -d "$dir"/rebase-apply
]; then
931 __gitcomp
"--skip --continue --resolved --abort"
936 __gitcomp
"$__git_whitespacelist" "" "${cur##--whitespace=}"
941 --3way --committer-date-is-author-date --ignore-date
942 --ignore-whitespace --ignore-space-change
943 --interactive --keep --no-utf8 --signoff --utf8
944 --whitespace= --scissors
955 __gitcomp
"$__git_whitespacelist" "" "${cur##--whitespace=}"
960 --stat --numstat --summary --check --index
961 --cached --index-info --reverse --reject --unidiff-zero
962 --apply --no-add --exclude=
963 --ignore-whitespace --ignore-space-change
964 --whitespace= --inaccurate-eof --verbose
976 --interactive --refresh --patch --update --dry-run
977 --ignore-errors --intent-to-add
982 # XXX should we check for --update and --all options ?
983 __git_complete_index_file
"--others --modified"
990 __gitcomp
"$(git archive --list)" "" "${cur##--format=}"
994 __gitcomp_nl
"$(__git_remotes)" "" "${cur##--remote=}"
999 --format= --list --verbose
1000 --prefix= --remote= --exec=
1010 __git_has_doubledash
&& return
1012 local subcommands
="start bad good skip reset visualize replay log run"
1013 local subcommand
="$(__git_find_on_cmdline "$subcommands")"
1014 if [ -z "$subcommand" ]; then
1015 if [ -f "$(__gitdir)"/BISECT_START
]; then
1016 __gitcomp
"$subcommands"
1018 __gitcomp
"replay start"
1023 case "$subcommand" in
1024 bad|good|
reset|skip|start
)
1025 __gitcomp_nl
"$(__git_refs)"
1035 local i c
=1 only_local_ref
="n" has_r
="n"
1037 while [ $c -lt $cword ]; do
1040 -d|
-m) only_local_ref
="y" ;;
1047 --set-upstream-to=*)
1048 __gitcomp
"$(__git_refs)" "" "${cur##--set-upstream-to=}"
1052 --color --no-color --verbose --abbrev= --no-abbrev
1053 --track --no-track --contains --merged --no-merged
1054 --set-upstream-to= --edit-description --list
1059 if [ $only_local_ref = "y" -a $has_r = "n" ]; then
1060 __gitcomp_nl
"$(__git_heads)"
1062 __gitcomp_nl
"$(__git_refs)"
1070 local cmd
="${words[2]}"
1073 __gitcomp
"create list-heads verify unbundle"
1076 # looking for a file
1081 __git_complete_revlist
1090 __git_has_doubledash
&& return
1094 __gitcomp
"diff3 merge" "" "${cur##--conflict=}"
1098 --quiet --ours --theirs --track --no-track --merge
1099 --conflict= --orphan --patch
1103 # check if --track, --no-track, or --no-guess was specified
1104 # if so, disable DWIM mode
1105 local flags
="--track --no-track --no-guess" track
=1
1106 if [ -n "$(__git_find_on_cmdline "$flags")" ]; then
1109 __gitcomp_nl
"$(__git_refs '' $track)"
1116 __gitcomp
"$(__git_refs)"
1123 __gitcomp
"--edit --no-commit"
1126 __gitcomp_nl
"$(__git_refs)"
1135 __gitcomp
"--dry-run --quiet"
1140 # XXX should we check for -x option ?
1141 __git_complete_index_file
"--others"
1174 __gitcomp_nl
"$(__git_refs)" "" "${cur}"
1181 __gitcomp_nl
"$(__git_refs)" "" "${cur}"
1188 __gitcomp
"default strip verbatim whitespace
1189 " "" "${cur##--cleanup=}"
1192 --reuse-message=*|
--reedit-message=*|\
1193 --fixup=*|
--squash=*)
1194 __gitcomp_nl
"$(__git_refs)" "" "${cur#*=}"
1197 --untracked-files=*)
1198 __gitcomp
"all no normal" "" "${cur##--untracked-files=}"
1203 --all --author= --signoff --verify --no-verify
1205 --amend --include --only --interactive
1206 --dry-run --reuse-message= --reedit-message=
1207 --reset-author --file= --message= --template=
1208 --cleanup= --untracked-files --untracked-files=
1209 --verbose --quiet --fixup= --squash=
1214 if git rev-parse
--verify --quiet HEAD
>/dev
/null
; then
1215 __git_complete_diff_index_file
"HEAD"
1217 # This is the first commit
1218 __git_complete_index_file
"--cached"
1227 --all --tags --contains --abbrev= --candidates=
1228 --exact-match --debug --long --match --always
1232 __gitcomp_nl
"$(__git_refs)"
1235 __git_diff_algorithms
="myers minimal patience histogram"
1237 __git_diff_common_options
="--stat --numstat --shortstat --summary
1238 --patch-with-stat --name-only --name-status --color
1239 --no-color --color-words --no-renames --check
1240 --full-index --binary --abbrev --diff-filter=
1241 --find-copies-harder
1242 --text --ignore-space-at-eol --ignore-space-change
1243 --ignore-all-space --exit-code --quiet --ext-diff
1245 --no-prefix --src-prefix= --dst-prefix=
1246 --inter-hunk-context=
1247 --patience --histogram --minimal
1249 --dirstat --dirstat= --dirstat-by-file
1250 --dirstat-by-file= --cumulative
1256 __git_has_doubledash
&& return
1260 __gitcomp
"$__git_diff_algorithms" "" "${cur##--diff-algorithm=}"
1264 __gitcomp
"--cached --staged --pickaxe-all --pickaxe-regex
1265 --base --ours --theirs --no-index
1266 $__git_diff_common_options
1271 __git_complete_revlist_file
1274 __git_mergetools_common
="diffuse ecmerge emerge kdiff3 meld opendiff
1275 tkdiff vimdiff gvimdiff xxdiff araxis p4merge bc3 codecompare
1280 __git_has_doubledash
&& return
1284 __gitcomp
"$__git_mergetools_common kompare" "" "${cur##--tool=}"
1288 __gitcomp
"--cached --staged --pickaxe-all --pickaxe-regex
1289 --base --ours --theirs
1290 --no-renames --diff-filter= --find-copies-harder
1291 --relative --ignore-submodules
1299 __git_fetch_options
="
1300 --quiet --verbose --append --upload-pack --force --keep --depth=
1301 --tags --no-tags --all --prune --dry-run
1308 __gitcomp
"$__git_fetch_options"
1312 __git_complete_remote_or_refspec
1315 __git_format_patch_options
="
1316 --stdout --attach --no-attach --thread --thread= --output-directory
1317 --numbered --start-number --numbered-files --keep-subject --signoff
1318 --signature --no-signature --in-reply-to= --cc= --full-index --binary
1319 --not --all --cover-letter --no-prefix --src-prefix= --dst-prefix=
1320 --inline --suffix= --ignore-if-in-upstream --subject-prefix=
1323 _git_format_patch
()
1329 " "" "${cur##--thread=}"
1333 __gitcomp
"$__git_format_patch_options"
1337 __git_complete_revlist
1345 --tags --root --unreachable --cache --no-reflogs --full
1346 --strict --verbose --lost-found
1358 __gitcomp
"--prune --aggressive"
1370 __git_match_ctag
() {
1371 awk "/^${1////\\/}/ { print \$1 }" "$2"
1376 __git_has_doubledash
&& return
1382 --text --ignore-case --word-regexp --invert-match
1383 --full-name --line-number
1384 --extended-regexp --basic-regexp --fixed-strings
1386 --files-with-matches --name-only
1387 --files-without-match
1390 --and --or --not --all-match
1396 case "$cword,$prev" in
1398 if test -r tags
; then
1399 __gitcomp_nl
"$(__git_match_ctag "$cur" tags)"
1405 __gitcomp_nl
"$(__git_refs)"
1412 __gitcomp
"--all --info --man --web"
1416 __git_compute_all_commands
1417 __gitcomp
"$__git_all_commands $(__git_aliases)
1418 attributes cli core-tutorial cvs-migration
1419 diffcore gitk glossary hooks ignore modules
1420 namespaces repository-layout tutorial tutorial-2
1430 false true umask group all world everybody
1431 " "" "${cur##--shared=}"
1435 __gitcomp
"--quiet --bare --template= --shared --shared="
1446 __gitcomp
"--cached --deleted --modified --others --ignored
1447 --stage --directory --no-empty-directory --unmerged
1448 --killed --exclude= --exclude-from=
1449 --exclude-per-directory= --exclude-standard
1450 --error-unmatch --with-tree= --full-name
1451 --abbrev --ignored --exclude-per-directory
1457 # XXX ignore options like --modified and always suggest all cached
1459 __git_complete_index_file
"--cached"
1464 __gitcomp_nl
"$(__git_remotes)"
1472 # Options that go well for log, shortlog and gitk
1473 __git_log_common_options
="
1475 --branches --tags --remotes
1476 --first-parent --merges --no-merges
1478 --max-age= --since= --after=
1479 --min-age= --until= --before=
1480 --min-parents= --max-parents=
1481 --no-min-parents --no-max-parents
1483 # Options that go well for log and gitk (not shortlog)
1484 __git_log_gitk_options
="
1485 --dense --sparse --full-history
1486 --simplify-merges --simplify-by-decoration
1487 --left-right --notes --no-notes
1489 # Options that go well for log and shortlog (not gitk)
1490 __git_log_shortlog_options
="
1491 --author= --committer= --grep=
1495 __git_log_pretty_formats
="oneline short medium full fuller email raw format:"
1496 __git_log_date_formats
="relative iso8601 rfc2822 short local default raw"
1500 __git_has_doubledash
&& return
1502 local g
="$(git rev-parse --git-dir 2>/dev/null)"
1504 if [ -f "$g/MERGE_HEAD" ]; then
1508 --pretty=*|
--format=*)
1509 __gitcomp
"$__git_log_pretty_formats $(__git_pretty_aliases)
1514 __gitcomp
"$__git_log_date_formats" "" "${cur##--date=}"
1518 __gitcomp
"long short" "" "${cur##--decorate=}"
1523 $__git_log_common_options
1524 $__git_log_shortlog_options
1525 $__git_log_gitk_options
1526 --root --topo-order --date-order --reverse
1527 --follow --full-diff
1528 --abbrev-commit --abbrev=
1529 --relative-date --date=
1530 --pretty= --format= --oneline
1533 --decorate --decorate=
1535 --parents --children
1537 $__git_diff_common_options
1538 --pickaxe-all --pickaxe-regex
1543 __git_complete_revlist
1546 __git_merge_options
="
1547 --no-commit --no-stat --log --no-log --squash --strategy
1548 --commit --stat --no-squash --ff --no-ff --ff-only --edit --no-edit
1553 __git_complete_strategy
&& return
1557 __gitcomp
"$__git_merge_options"
1560 __gitcomp_nl
"$(__git_refs)"
1567 __gitcomp
"$__git_mergetools_common tortoisemerge" "" "${cur##--tool=}"
1580 __gitcomp_nl
"$(__git_refs)"
1587 __gitcomp
"--dry-run"
1592 if [ $
(__git_count_arguments
"mv") -gt 0 ]; then
1593 # We need to show both cached and untracked files (including
1594 # empty directories) since this may not be the last argument.
1595 __git_complete_index_file
"--cached --others --directory"
1597 __git_complete_index_file
"--cached"
1603 __gitcomp
"--tags --all --stdin"
1608 local subcommands
='add append copy edit list prune remove show'
1609 local subcommand
="$(__git_find_on_cmdline "$subcommands")"
1611 case "$subcommand,$cur" in
1618 __gitcomp_nl
"$(__git_refs)"
1621 __gitcomp
"$subcommands --ref"
1625 add
,--reuse-message=*|append
,--reuse-message=*|\
1626 add
,--reedit-message=*|append
,--reedit-message=*)
1627 __gitcomp_nl
"$(__git_refs)" "" "${cur#*=}"
1630 __gitcomp
'--file= --message= --reedit-message=
1637 __gitcomp
'--dry-run --verbose'
1646 __gitcomp_nl
"$(__git_refs)"
1655 __git_complete_strategy
&& return
1660 --rebase --no-rebase
1661 $__git_merge_options
1662 $__git_fetch_options
1667 __git_complete_remote_or_refspec
1674 __gitcomp_nl
"$(__git_remotes)"
1679 __gitcomp_nl
"$(__git_remotes)" "" "${cur##--repo=}"
1684 --all --mirror --tags --dry-run --force --verbose
1685 --receive-pack= --repo= --set-upstream
1690 __git_complete_remote_or_refspec
1695 local dir
="$(__gitdir)"
1696 if [ -d "$dir"/rebase-apply
] ||
[ -d "$dir"/rebase-merge
]; then
1697 __gitcomp
"--continue --skip --abort"
1700 __git_complete_strategy
&& return
1703 __gitcomp
"$__git_whitespacelist" "" "${cur##--whitespace=}"
1708 --onto --merge --strategy --interactive
1709 --preserve-merges --stat --no-stat
1710 --committer-date-is-author-date --ignore-date
1711 --ignore-whitespace --whitespace=
1717 __gitcomp_nl
"$(__git_refs)"
1722 local subcommands
="show delete expire"
1723 local subcommand
="$(__git_find_on_cmdline "$subcommands")"
1725 if [ -z "$subcommand" ]; then
1726 __gitcomp
"$subcommands"
1728 __gitcomp_nl
"$(__git_refs)"
1732 __git_send_email_confirm_options
="always never auto cc compose"
1733 __git_send_email_suppresscc_options
="author self cc bodycc sob cccmd body all"
1740 $__git_send_email_confirm_options
1741 " "" "${cur##--confirm=}"
1746 $__git_send_email_suppresscc_options
1747 " "" "${cur##--suppress-cc=}"
1751 --smtp-encryption=*)
1752 __gitcomp
"ssl tls" "" "${cur##--smtp-encryption=}"
1758 " "" "${cur##--thread=}"
1762 __gitcomp
"--annotate --bcc --cc --cc-cmd --chain-reply-to
1763 --compose --confirm= --dry-run --envelope-sender
1765 --in-reply-to --no-chain-reply-to --no-signed-off-by-cc
1766 --no-suppress-from --no-thread --quiet
1767 --signed-off-by-cc --smtp-pass --smtp-server
1768 --smtp-server-port --smtp-encryption= --smtp-user
1769 --subject --suppress-cc= --suppress-from --thread --to
1770 --validate --no-validate
1771 $__git_format_patch_options"
1775 __git_complete_revlist
1783 __git_config_get_set_variables
()
1785 local prevword word config_file
= c
=$cword
1786 while [ $c -gt 1 ]; do
1789 --system|
--global|
--local|
--file=*)
1794 config_file
="$word $prevword"
1802 git
--git-dir="$(__gitdir)" config
$config_file --list 2>/dev
/null |
1817 __gitcomp_nl
"$(__git_remotes)"
1821 __gitcomp_nl
"$(__git_refs)"
1825 local remote
="${prev#remote.}"
1826 remote
="${remote%.fetch}"
1827 if [ -z "$cur" ]; then
1828 COMPREPLY
=("refs/heads/")
1831 __gitcomp_nl
"$(__git_refs_remotes "$remote")"
1835 local remote
="${prev#remote.}"
1836 remote
="${remote%.push}"
1837 __gitcomp_nl
"$(git --git-dir="$
(__gitdir
)" \
1838 for-each-ref --format='%(refname):%(refname)' \
1842 pull.twohead|pull.octopus
)
1843 __git_compute_merge_strategies
1844 __gitcomp
"$__git_merge_strategies"
1847 color.branch|color.
diff|color.interactive|\
1848 color.showbranch|color.status|color.ui
)
1849 __gitcomp
"always never auto"
1853 __gitcomp
"false true"
1858 normal black red green yellow blue magenta cyan white
1859 bold dim ul blink reverse
1864 __gitcomp
"man info web html"
1868 __gitcomp
"$__git_log_date_formats"
1871 sendemail.aliasesfiletype
)
1872 __gitcomp
"mutt mailrc pine elm gnus"
1876 __gitcomp
"$__git_send_email_confirm_options"
1879 sendemail.suppresscc
)
1880 __gitcomp
"$__git_send_email_suppresscc_options"
1883 --get|
--get-all|
--unset|
--unset-all)
1884 __gitcomp_nl
"$(__git_config_get_set_variables)"
1895 --system --global --local --file=
1896 --list --replace-all
1897 --get --get-all --get-regexp
1898 --add --unset --unset-all
1899 --remove-section --rename-section
1904 local pfx
="${cur%.*}." cur_
="${cur##*.}"
1905 __gitcomp
"remote merge mergeoptions rebase" "$pfx" "$cur_"
1909 local pfx
="${cur%.*}." cur_
="${cur#*.}"
1910 __gitcomp_nl
"$(__git_heads)" "$pfx" "$cur_" "."
1914 local pfx
="${cur%.*}." cur_
="${cur##*.}"
1916 argprompt cmd confirm needsfile noconsole norescan
1917 prompt revprompt revunmerged title
1922 local pfx
="${cur%.*}." cur_
="${cur##*.}"
1923 __gitcomp
"cmd path" "$pfx" "$cur_"
1927 local pfx
="${cur%.*}." cur_
="${cur##*.}"
1928 __gitcomp
"cmd path" "$pfx" "$cur_"
1932 local pfx
="${cur%.*}." cur_
="${cur##*.}"
1933 __gitcomp
"cmd path trustExitCode" "$pfx" "$cur_"
1937 local pfx
="${cur%.*}." cur_
="${cur#*.}"
1938 __git_compute_all_commands
1939 __gitcomp_nl
"$__git_all_commands" "$pfx" "$cur_"
1943 local pfx
="${cur%.*}." cur_
="${cur##*.}"
1945 url proxy fetch push mirror skipDefaultUpdate
1946 receivepack uploadpack tagopt pushurl
1951 local pfx
="${cur%.*}." cur_
="${cur#*.}"
1952 __gitcomp_nl
"$(__git_remotes)" "$pfx" "$cur_" "."
1956 local pfx
="${cur%.*}." cur_
="${cur##*.}"
1957 __gitcomp
"insteadOf pushInsteadOf" "$pfx" "$cur_"
1963 advice.commitBeforeMerge
1965 advice.implicitIdentity
1966 advice.pushNonFastForward
1967 advice.resolveConflict
1971 apply.ignorewhitespace
1973 branch.autosetupmerge
1974 branch.autosetuprebase
1978 color.branch.current
1983 color.decorate.branch
1984 color.decorate.remoteBranch
1985 color.decorate.stash
1995 color.diff.whitespace
2000 color.grep.linenumber
2003 color.grep.separator
2005 color.interactive.error
2006 color.interactive.header
2007 color.interactive.help
2008 color.interactive.prompt
2013 color.status.changed
2015 color.status.nobranch
2016 color.status.untracked
2017 color.status.updated
2026 core.bigFileThreshold
2029 core.deltaBaseCacheLimit
2034 core.fsyncobjectfiles
2036 core.ignoreCygwinFSTricks
2039 core.logAllRefUpdates
2040 core.loosecompression
2043 core.packedGitWindowSize
2045 core.preferSymlinkRefs
2048 core.repositoryFormatVersion
2050 core.sharedRepository
2054 core.warnAmbiguousRefs
2057 diff.autorefreshindex
2060 diff.ignoreSubmodules
2065 diff.suppressBlankEmpty
2071 fetch.recurseSubmodules
2080 format.subjectprefix
2091 gc.reflogexpireunreachable
2095 gitcvs.commitmsgannotation
2096 gitcvs.dbTableNamePrefix
2107 gui.copyblamethreshold
2111 gui.matchtrackingbranch
2112 gui.newbranchtemplate
2113 gui.pruneduringfetch
2114 gui.spellingdictionary
2129 http.sslCertPasswordProtected
2134 i18n.logOutputEncoding
2140 imap.preformattedHTML
2150 interactive.singlekey
2166 mergetool.keepBackup
2167 mergetool.keepTemporaries
2172 notes.rewrite.rebase
2176 pack.deltaCacheLimit
2192 receive.denyCurrentBranch
2193 receive.denyDeleteCurrent
2195 receive.denyNonFastForwards
2198 receive.updateserverinfo
2200 repack.usedeltabaseoffset
2204 sendemail.aliasesfile
2205 sendemail.aliasfiletype
2209 sendemail.chainreplyto
2211 sendemail.envelopesender
2215 sendemail.signedoffbycc
2216 sendemail.smtpdomain
2217 sendemail.smtpencryption
2219 sendemail.smtpserver
2220 sendemail.smtpserveroption
2221 sendemail.smtpserverport
2223 sendemail.suppresscc
2224 sendemail.suppressfrom
2229 status.relativePaths
2230 status.showUntrackedFiles
2231 status.submodulesummary
2234 transfer.unpackLimit
2246 local subcommands
="add rename remove set-head set-branches set-url show prune update"
2247 local subcommand
="$(__git_find_on_cmdline "$subcommands")"
2248 if [ -z "$subcommand" ]; then
2249 __gitcomp
"$subcommands"
2253 case "$subcommand" in
2254 rename|remove|set-url|show|prune
)
2255 __gitcomp_nl
"$(__git_remotes)"
2257 set-head|set-branches
)
2258 __git_complete_remote_or_refspec
2261 local i c
='' IFS
=$
'\n'
2262 for i
in $
(git
--git-dir="$(__gitdir)" config
--get-regexp "remotes\..*" 2>/dev
/null
); do
2276 __gitcomp_nl
"$(__git_refs)"
2281 __git_has_doubledash
&& return
2285 __gitcomp
"--merge --mixed --hard --soft --patch"
2289 __gitcomp_nl
"$(__git_refs)"
2296 __gitcomp
"--edit --mainline --no-edit --no-commit --signoff"
2300 __gitcomp_nl
"$(__git_refs)"
2307 __gitcomp
"--cached --dry-run --ignore-unmatch --quiet"
2312 __git_complete_index_file
"--cached"
2317 __git_has_doubledash
&& return
2322 $__git_log_common_options
2323 $__git_log_shortlog_options
2324 --numbered --summary
2329 __git_complete_revlist
2334 __git_has_doubledash
&& return
2337 --pretty=*|
--format=*)
2338 __gitcomp
"$__git_log_pretty_formats $(__git_pretty_aliases)
2343 __gitcomp
"$__git_diff_algorithms" "" "${cur##--diff-algorithm=}"
2347 __gitcomp
"--pretty= --format= --abbrev-commit --oneline
2348 $__git_diff_common_options
2361 --all --remotes --topo-order --current --more=
2362 --list --independent --merge-base --no-name
2364 --sha1-name --sparse --topics --reflog
2369 __git_complete_revlist
2374 local save_opts
='--keep-index --no-keep-index --quiet --patch'
2375 local subcommands
='save list show apply clear drop pop create branch'
2376 local subcommand
="$(__git_find_on_cmdline "$subcommands")"
2377 if [ -z "$subcommand" ]; then
2380 __gitcomp
"$save_opts"
2383 if [ -z "$(__git_find_on_cmdline "$save_opts")" ]; then
2384 __gitcomp
"$subcommands"
2391 case "$subcommand,$cur" in
2393 __gitcomp
"$save_opts"
2396 __gitcomp
"--index --quiet"
2398 show
,--*|drop
,--*|branch
,--*)
2401 show
,*|apply
,*|drop
,*|pop
,*|branch
,*)
2402 __gitcomp_nl
"$(git --git-dir="$
(__gitdir
)" stash list \
2403 | sed -n -e 's/:.*//p')"
2414 __git_has_doubledash
&& return
2416 local subcommands
="add status init deinit update summary foreach sync"
2417 if [ -z "$(__git_find_on_cmdline "$subcommands")" ]; then
2420 __gitcomp
"--quiet --cached"
2423 __gitcomp
"$subcommands"
2433 init fetch clone rebase dcommit log find-rev
2434 set-tree commit-diff info create-ignore propget
2435 proplist show-ignore show-externals branch tag blame
2436 migrate mkdirs reset gc
2438 local subcommand
="$(__git_find_on_cmdline "$subcommands")"
2439 if [ -z "$subcommand" ]; then
2440 __gitcomp
"$subcommands"
2442 local remote_opts
="--username= --config-dir= --no-auth-cache"
2444 --follow-parent --authors-file= --repack=
2445 --no-metadata --use-svm-props --use-svnsync-props
2446 --log-window-size= --no-checkout --quiet
2447 --repack-flags --use-log-author --localtime
2448 --ignore-paths= $remote_opts
2451 --template= --shared= --trunk= --tags=
2452 --branches= --stdlayout --minimize-url
2453 --no-metadata --use-svm-props --use-svnsync-props
2454 --rewrite-root= --prefix= --use-log-author
2455 --add-author-from $remote_opts
2458 --edit --rmdir --find-copies-harder --copy-similarity=
2461 case "$subcommand,$cur" in
2463 __gitcomp
"--revision= --fetch-all $fc_opts"
2466 __gitcomp
"--revision= $fc_opts $init_opts"
2469 __gitcomp
"$init_opts"
2473 --merge --strategy= --verbose --dry-run
2474 --fetch-all --no-rebase --commit-url
2475 --revision --interactive $cmt_opts $fc_opts
2479 __gitcomp
"--stdin $cmt_opts $fc_opts"
2481 create-ignore
,--*|propget
,--*|proplist
,--*|show-ignore
,--*|\
2482 show-externals
,--*|mkdirs
,--*)
2483 __gitcomp
"--revision="
2487 --limit= --revision= --verbose --incremental
2488 --oneline --show-commit --non-recursive
2489 --authors-file= --color
2494 --merge --verbose --strategy= --local
2495 --fetch-all --dry-run $fc_opts
2499 __gitcomp
"--message= --file= --revision= $cmt_opts"
2505 __gitcomp
"--dry-run --message --tag"
2508 __gitcomp
"--dry-run --message"
2511 __gitcomp
"--git-format"
2515 --config-dir= --ignore-paths= --minimize
2516 --no-auth-cache --username=
2520 __gitcomp
"--revision= --parent"
2532 while [ $c -lt $cword ]; do
2536 __gitcomp_nl
"$(__git_tags)"
2552 __gitcomp_nl
"$(__git_tags)"
2558 __gitcomp_nl
"$(__git_refs)"
2570 local i c
=1 command __git_dir
2572 while [ $c -lt $cword ]; do
2575 --git-dir=*) __git_dir
="${i#--git-dir=}" ;;
2576 --bare) __git_dir
="." ;;
2577 --help) command="help"; break ;;
2580 *) command="$i"; break ;;
2585 if [ -z "$command" ]; then
2599 --no-replace-objects
2603 *) __git_compute_porcelain_commands
2604 __gitcomp
"$__git_porcelain_commands $(__git_aliases)" ;;
2609 local completion_func
="_git_${command//-/_}"
2610 declare -f $completion_func >/dev
/null
&& $completion_func && return
2612 local expansion
=$
(__git_aliased_command
"$command")
2613 if [ -n "$expansion" ]; then
2614 completion_func
="_git_${expansion//-/_}"
2615 declare -f $completion_func >/dev
/null
&& $completion_func
2621 __git_has_doubledash
&& return
2623 local g
="$(__gitdir)"
2625 if [ -f "$g/MERGE_HEAD" ]; then
2631 $__git_log_common_options
2632 $__git_log_gitk_options
2638 __git_complete_revlist
2641 if [[ -n ${ZSH_VERSION-} ]]; then
2642 echo "WARNING: this script is deprecated, please see git-completion.zsh" 1>&2
2644 autoload
-U +X compinit
&& compinit
2650 local cur_
="${3-$cur}"
2656 local c IFS
=$
' \t\n'
2664 array
[$#array+1]="$c"
2667 compadd
-Q -S '' -p "${2-}" -a -- array
&& _ret
=0
2678 compadd
-Q -S "${4- }" -p "${2-}" -- ${=1} && _ret=0
2687 compadd -Q -p "${2-}" -f -- ${=1} && _ret=0
2693 local cur cword prev
2694 cur=${words[CURRENT-1]}
2695 prev=${words[CURRENT-2]}
2705 let _ret && _default -S '' && _ret=0
2709 compdef _git git gitk
2711 elif [[ -n ${BASH_VERSION-} ]]; then
2712 if ((${BASH_VERSINFO[0]} < 4)); then
2713 # compopt is not supported
2714 __git_index_file_list_filter ()
2716 __git_index_file_list_filter_compat
2723 local cur words cword prev
2724 _get_comp_words_by_ref -n =: cur words cword prev
2728 # Setup completion for certain functions defined above by setting common
2729 # variables and workarounds.
2730 # This is NOT a public function; use at your own risk.
2733 local wrapper="__git_wrap
${2}"
2734 eval "$wrapper () { __git_func_wrap
$2 ; }"
2735 complete -o bashdefault -o default -o nospace -F $wrapper $1 2>/dev/null \
2736 || complete -o default -o nospace -F $wrapper $1
2739 # wrapper for backwards compatibility
2742 __git_wrap__git_main
2745 # wrapper for backwards compatibility
2748 __git_wrap__gitk_main
2751 __git_complete git __git_main
2752 __git_complete gitk __gitk_main
2754 # The following are necessary only for Cygwin, and only are needed
2755 # when the user has tab-completed the executable name and consequently
2756 # included the '.exe' suffix.
2758 if [ Cygwin = "$
(uname
-o 2>/dev
/null
)" ]; then
2759 __git_complete git.exe __git_main