gitfast: update to upstream v2.8

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
This commit is contained in:
Felipe Contreras 2016-05-19 23:27:30 -05:00
parent 169cd8b6ca
commit eec3dc607c
2 changed files with 80 additions and 52 deletions

View file

@ -10,6 +10,7 @@
# *) local and remote tag names # *) local and remote tag names
# *) .git/remotes file names # *) .git/remotes file names
# *) git 'subcommands' # *) git 'subcommands'
# *) git email aliases for git-send-email
# *) tree paths within 'ref:path/to/file' expressions # *) tree paths within 'ref:path/to/file' expressions
# *) file paths within current working directory and index # *) file paths within current working directory and index
# *) common --long-options # *) common --long-options
@ -663,10 +664,11 @@ __git_list_porcelain_commands ()
check-mailmap) : plumbing;; check-mailmap) : plumbing;;
check-ref-format) : plumbing;; check-ref-format) : plumbing;;
checkout-index) : plumbing;; checkout-index) : plumbing;;
column) : internal helper;;
commit-tree) : plumbing;; commit-tree) : plumbing;;
count-objects) : infrequent;; count-objects) : infrequent;;
credential-cache) : credentials helper;; credential) : credentials;;
credential-store) : credentials helper;; credential-*) : credentials helper;;
cvsexportcommit) : export;; cvsexportcommit) : export;;
cvsimport) : import;; cvsimport) : import;;
cvsserver) : daemon;; cvsserver) : daemon;;
@ -735,35 +737,28 @@ __git_list_porcelain_commands ()
__git_porcelain_commands= __git_porcelain_commands=
__git_compute_porcelain_commands () __git_compute_porcelain_commands ()
{ {
__git_compute_all_commands
test -n "$__git_porcelain_commands" || test -n "$__git_porcelain_commands" ||
__git_porcelain_commands=$(__git_list_porcelain_commands) __git_porcelain_commands=$(__git_list_porcelain_commands)
} }
# Lists all set config variables starting with the given section prefix,
# with the prefix removed.
__git_get_config_variables ()
{
local section="$1" i IFS=$'\n'
for i in $(git --git-dir="$(__gitdir)" config --name-only --get-regexp "^$section\..*" 2>/dev/null); do
echo "${i#$section.}"
done
}
__git_pretty_aliases () __git_pretty_aliases ()
{ {
local i IFS=$'\n' __git_get_config_variables "pretty"
for i in $(git --git-dir="$(__gitdir)" config --get-regexp "pretty\..*" 2>/dev/null); do
case "$i" in
pretty.*)
i="${i#pretty.}"
echo "${i/ */}"
;;
esac
done
} }
__git_aliases () __git_aliases ()
{ {
local i IFS=$'\n' __git_get_config_variables "alias"
for i in $(git --git-dir="$(__gitdir)" config --get-regexp "alias\..*" 2>/dev/null); do
case "$i" in
alias.*)
i="${i#alias.}"
echo "${i/ */}"
;;
esac
done
} }
# __git_aliased_command requires 1 argument # __git_aliased_command requires 1 argument
@ -1114,7 +1109,7 @@ _git_commit ()
case "$cur" in case "$cur" in
--cleanup=*) --cleanup=*)
__gitcomp "default strip verbatim whitespace __gitcomp "default scissors strip verbatim whitespace
" "" "${cur##--cleanup=}" " "" "${cur##--cleanup=}"
return return
;; ;;
@ -1174,7 +1169,7 @@ __git_diff_common_options="--stat --numstat --shortstat --summary
--no-prefix --src-prefix= --dst-prefix= --no-prefix --src-prefix= --dst-prefix=
--inter-hunk-context= --inter-hunk-context=
--patience --histogram --minimal --patience --histogram --minimal
--raw --word-diff --raw --word-diff --word-diff-regex=
--dirstat --dirstat= --dirstat-by-file --dirstat --dirstat= --dirstat-by-file
--dirstat-by-file= --cumulative --dirstat-by-file= --cumulative
--diff-algorithm= --diff-algorithm=
@ -1317,6 +1312,7 @@ _git_grep ()
--full-name --line-number --full-name --line-number
--extended-regexp --basic-regexp --fixed-strings --extended-regexp --basic-regexp --fixed-strings
--perl-regexp --perl-regexp
--threads
--files-with-matches --name-only --files-with-matches --name-only
--files-without-match --files-without-match
--max-depth --max-depth
@ -1448,7 +1444,7 @@ _git_log ()
return return
;; ;;
--decorate=*) --decorate=*)
__gitcomp "long short" "" "${cur##--decorate=}" __gitcomp "full short no" "" "${cur##--decorate=}"
return return
;; ;;
--*) --*)
@ -1673,7 +1669,10 @@ _git_push ()
_git_rebase () _git_rebase ()
{ {
local dir="$(__gitdir)" local dir="$(__gitdir)"
if [ -d "$dir"/rebase-apply ] || [ -d "$dir"/rebase-merge ]; then if [ -f "$dir"/rebase-merge/interactive ]; then
__gitcomp "--continue --skip --abort --edit-todo"
return
elif [ -d "$dir"/rebase-apply ] || [ -d "$dir"/rebase-merge ]; then
__gitcomp "--continue --skip --abort" __gitcomp "--continue --skip --abort"
return return
fi fi
@ -1689,8 +1688,12 @@ _git_rebase ()
--preserve-merges --stat --no-stat --preserve-merges --stat --no-stat
--committer-date-is-author-date --ignore-date --committer-date-is-author-date --ignore-date
--ignore-whitespace --whitespace= --ignore-whitespace --whitespace=
--autosquash --fork-point --no-fork-point --autosquash --no-autosquash
--autostash --fork-point --no-fork-point
--autostash --no-autostash
--verify --no-verify
--keep-empty --root --force-rebase --no-ff
--exec
" "
return return
@ -1715,6 +1718,15 @@ __git_send_email_suppresscc_options="author self cc bodycc sob cccmd body all"
_git_send_email () _git_send_email ()
{ {
case "$prev" in
--to|--cc|--bcc|--from)
__gitcomp "
$(git --git-dir="$(__gitdir)" send-email --dump-aliases 2>/dev/null)
"
return
;;
esac
case "$cur" in case "$cur" in
--confirm=*) --confirm=*)
__gitcomp " __gitcomp "
@ -1739,6 +1751,12 @@ _git_send_email ()
" "" "${cur##--thread=}" " "" "${cur##--thread=}"
return return
;; ;;
--to=*|--cc=*|--bcc=*|--from=*)
__gitcomp "
$(git --git-dir="$(__gitdir)" send-email --dump-aliases 2>/dev/null)
" "" "${cur#--*=}"
return
;;
--*) --*)
__gitcomp "--annotate --bcc --cc --cc-cmd --chain-reply-to __gitcomp "--annotate --bcc --cc --cc-cmd --chain-reply-to
--compose --confirm= --dry-run --envelope-sender --compose --confirm= --dry-run --envelope-sender
@ -1780,15 +1798,7 @@ __git_config_get_set_variables ()
c=$((--c)) c=$((--c))
done done
git --git-dir="$(__gitdir)" config $config_file --list 2>/dev/null | git --git-dir="$(__gitdir)" config $config_file --name-only --list 2>/dev/null
while read -r line
do
case "$line" in
*.*=*)
echo "${line/=*/}"
;;
esac
done
} }
_git_config () _git_config ()
@ -1803,7 +1813,7 @@ _git_config ()
return return
;; ;;
branch.*.rebase) branch.*.rebase)
__gitcomp "false true" __gitcomp "false true preserve interactive"
return return
;; ;;
remote.pushdefault) remote.pushdefault)
@ -1893,6 +1903,7 @@ _git_config ()
--get --get-all --get-regexp --get --get-all --get-regexp
--add --unset --unset-all --add --unset --unset-all
--remove-section --rename-section --remove-section --rename-section
--name-only
" "
return return
;; ;;
@ -2049,6 +2060,7 @@ _git_config ()
core.sparseCheckout core.sparseCheckout
core.symlinks core.symlinks
core.trustctime core.trustctime
core.untrackedCache
core.warnAmbiguousRefs core.warnAmbiguousRefs
core.whitespace core.whitespace
core.worktree core.worktree
@ -2123,6 +2135,8 @@ _git_config ()
http.noEPSV http.noEPSV
http.postBuffer http.postBuffer
http.proxy http.proxy
http.sslCipherList
http.sslVersion
http.sslCAInfo http.sslCAInfo
http.sslCAPath http.sslCAPath
http.sslCert http.sslCert
@ -2260,12 +2274,7 @@ _git_remote ()
__git_complete_remote_or_refspec __git_complete_remote_or_refspec
;; ;;
update) update)
local i c='' IFS=$'\n' __gitcomp "$(__git_get_config_variables "remotes")"
for i in $(git --git-dir="$(__gitdir)" config --get-regexp "remotes\..*" 2>/dev/null); do
i="${i#remotes.}"
c="$c ${i/ */}"
done
__gitcomp "$c"
;; ;;
*) *)
;; ;;
@ -2292,6 +2301,11 @@ _git_reset ()
_git_revert () _git_revert ()
{ {
local dir="$(__gitdir)"
if [ -f "$dir"/REVERT_HEAD ]; then
__gitcomp "--continue --quit --abort"
return
fi
case "$cur" in case "$cur" in
--*) --*)
__gitcomp "--edit --mainline --no-edit --no-commit --signoff" __gitcomp "--edit --mainline --no-edit --no-commit --signoff"
@ -2360,7 +2374,7 @@ _git_show_branch ()
case "$cur" in case "$cur" in
--*) --*)
__gitcomp " __gitcomp "
--all --remotes --topo-order --current --more= --all --remotes --topo-order --date-order --current --more=
--list --independent --merge-base --no-name --list --independent --merge-base --no-name
--color --no-color --color --no-color
--sha1-name --sparse --topics --reflog --sha1-name --sparse --topics --reflog
@ -2373,7 +2387,7 @@ _git_show_branch ()
_git_stash () _git_stash ()
{ {
local save_opts='--keep-index --no-keep-index --quiet --patch' local save_opts='--all --keep-index --no-keep-index --quiet --patch --include-untracked'
local subcommands='save list show apply clear drop pop create branch' local subcommands='save list show apply clear drop pop create branch'
local subcommand="$(__git_find_on_cmdline "$subcommands")" local subcommand="$(__git_find_on_cmdline "$subcommands")"
if [ -z "$subcommand" ]; then if [ -z "$subcommand" ]; then
@ -2395,9 +2409,20 @@ _git_stash ()
apply,--*|pop,--*) apply,--*|pop,--*)
__gitcomp "--index --quiet" __gitcomp "--index --quiet"
;; ;;
show,--*|drop,--*|branch,--*) drop,--*)
__gitcomp "--quiet"
;; ;;
show,*|apply,*|drop,*|pop,*|branch,*) show,--*|branch,--*)
;;
branch,*)
if [ $cword -eq 3 ]; then
__gitcomp_nl "$(__git_refs)";
else
__gitcomp_nl "$(git --git-dir="$(__gitdir)" stash list \
| sed -n -e 's/:.*//p')"
fi
;;
show,*|apply,*|drop,*|pop,*)
__gitcomp_nl "$(git --git-dir="$(__gitdir)" stash list \ __gitcomp_nl "$(git --git-dir="$(__gitdir)" stash list \
| sed -n -e 's/:.*//p')" | sed -n -e 's/:.*//p')"
;; ;;

View file

@ -66,6 +66,10 @@
# git always compare HEAD to @{upstream} # git always compare HEAD to @{upstream}
# svn always compare HEAD to your SVN upstream # svn always compare HEAD to your SVN upstream
# #
# You can change the separator between the branch name and the above
# state symbols by setting GIT_PS1_STATESEPARATOR. The default separator
# is SP.
#
# By default, __git_ps1 will compare HEAD to your SVN upstream if it can # By default, __git_ps1 will compare HEAD to your SVN upstream if it can
# find one, or @{upstream} otherwise. Once you have set # find one, or @{upstream} otherwise. Once you have set
# GIT_PS1_SHOWUPSTREAM, you can override it on a per-repository basis by # GIT_PS1_SHOWUPSTREAM, you can override it on a per-repository basis by
@ -472,10 +476,9 @@ __git_ps1 ()
if [ -n "${GIT_PS1_SHOWDIRTYSTATE-}" ] && if [ -n "${GIT_PS1_SHOWDIRTYSTATE-}" ] &&
[ "$(git config --bool bash.showDirtyState)" != "false" ] [ "$(git config --bool bash.showDirtyState)" != "false" ]
then then
git diff --no-ext-diff --quiet --exit-code || w="*" git diff --no-ext-diff --quiet || w="*"
if [ -n "$short_sha" ]; then git diff --no-ext-diff --cached --quiet || i="+"
git diff-index --cached --quiet HEAD -- || i="+" if [ -z "$short_sha" ] && [ -z "$i" ]; then
else
i="#" i="#"
fi fi
fi fi
@ -487,7 +490,7 @@ __git_ps1 ()
if [ -n "${GIT_PS1_SHOWUNTRACKEDFILES-}" ] && if [ -n "${GIT_PS1_SHOWUNTRACKEDFILES-}" ] &&
[ "$(git config --bool bash.showUntrackedFiles)" != "false" ] && [ "$(git config --bool bash.showUntrackedFiles)" != "false" ] &&
git ls-files --others --exclude-standard --error-unmatch -- ':/*' >/dev/null 2>/dev/null git ls-files --others --exclude-standard --directory --no-empty-directory --error-unmatch -- ':/*' >/dev/null 2>/dev/null
then then
u="%${ZSH_VERSION+%}" u="%${ZSH_VERSION+%}"
fi fi