Add upstream oh_my_zsh repo
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
# Gitfast plugin
|
||||
|
||||
This plugin adds completion for Git, using the zsh completion from git.git folks, which is much faster than the official one from zsh. A lot of zsh-specific features are not supported, like descriptions for every argument, but everything the bash completion has, this one does too (as it is using it behind the scenes). Not only is it faster, it should be more robust, and updated regularly to the latest git upstream version..
|
||||
This plugin adds completion for Git, using the zsh completion from git.git folks, which is much faster than the official one from zsh. A lot of zsh-specific features are not supported, like descriptions for every argument, but everything the bash completion has, this one does too (as it is using it behind the scenes). Not only is it faster, it should be more robust, and updated regularly to the latest git upstream version.
|
||||
|
||||
To use it, add `gitfast` to the plugins array in your zshrc file:
|
||||
|
||||
@@ -11,5 +11,5 @@ plugins=(... gitfast)
|
||||
## Aliases
|
||||
|
||||
An earlier version of the plugin also loaded the git plugin. If you want to keep those
|
||||
aliases enable the [git plugin](https://github.com/robbyrussell/oh-my-zsh/tree/master/plugins/git)
|
||||
aliases enable the [git plugin](https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins/git)
|
||||
as well.
|
||||
|
||||
@@ -30,7 +30,7 @@ if [ -z "$script" ]; then
|
||||
local -a locations
|
||||
local e
|
||||
locations=(
|
||||
$(dirname ${funcsourcetrace[1]%:*})/git-completion.bash
|
||||
"$(dirname ${funcsourcetrace[1]%:*})/git-completion.bash"
|
||||
'/etc/bash_completion.d/git' # fedora, old debian
|
||||
'/usr/share/bash-completion/completions/git' # arch, ubuntu, new debian
|
||||
'/usr/share/bash-completion/git' # gentoo
|
||||
@@ -39,7 +39,7 @@ if [ -z "$script" ]; then
|
||||
test -f $e && script="$e" && break
|
||||
done
|
||||
fi
|
||||
GIT_SOURCING_ZSH_COMPLETION=y . "$script"
|
||||
ZSH_VERSION='' . "$script"
|
||||
|
||||
__gitcomp ()
|
||||
{
|
||||
@@ -93,22 +93,13 @@ __gitcomp_nl_append ()
|
||||
compadd -Q -S "${4- }" -p "${2-}" -- ${=1} && _ret=0
|
||||
}
|
||||
|
||||
__gitcomp_file_direct ()
|
||||
{
|
||||
emulate -L zsh
|
||||
|
||||
local IFS=$'\n'
|
||||
compset -P '*[=:]'
|
||||
compadd -f -- ${=1} && _ret=0
|
||||
}
|
||||
|
||||
__gitcomp_file ()
|
||||
{
|
||||
emulate -L zsh
|
||||
|
||||
local IFS=$'\n'
|
||||
compset -P '*[=:]'
|
||||
compadd -p "${2-}" -f -- ${=1} && _ret=0
|
||||
compadd -Q -p "${2-}" -f -- ${=1} && _ret=0
|
||||
}
|
||||
|
||||
__git_zsh_bash_func ()
|
||||
@@ -232,8 +223,10 @@ _git ()
|
||||
|
||||
if (( $+functions[__${service}_zsh_main] )); then
|
||||
__${service}_zsh_main
|
||||
else
|
||||
elif (( $+functions[__${service}_main] )); then
|
||||
emulate ksh -c __${service}_main
|
||||
elif (( $+functions[_${service}] )); then
|
||||
emulate ksh -c _${service}
|
||||
fi
|
||||
|
||||
let _ret && _default && _ret=0
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -219,7 +219,7 @@ __git_ps1_show_upstream ()
|
||||
if [[ -n "$count" && -n "$name" ]]; then
|
||||
__git_ps1_upstream_name=$(git rev-parse \
|
||||
--abbrev-ref "$upstream" 2>/dev/null)
|
||||
if [ "$pcmode" = yes ] && [ "$ps1_expanded" = yes ]; then
|
||||
if [ $pcmode = yes ] && [ $ps1_expanded = yes ]; then
|
||||
p="$p \${__git_ps1_upstream_name}"
|
||||
else
|
||||
p="$p ${__git_ps1_upstream_name}"
|
||||
@@ -237,7 +237,7 @@ __git_ps1_show_upstream ()
|
||||
# to build a gitstring.
|
||||
__git_ps1_colorize_gitstring ()
|
||||
{
|
||||
if [[ -n "${ZSH_VERSION-}" ]]; then
|
||||
if [[ -n ${ZSH_VERSION-} ]]; then
|
||||
local c_red='%F{red}'
|
||||
local c_green='%F{green}'
|
||||
local c_lblue='%F{blue}'
|
||||
@@ -255,7 +255,7 @@ __git_ps1_colorize_gitstring ()
|
||||
local flags_color="$c_lblue"
|
||||
|
||||
local branch_color=""
|
||||
if [ "$detached" = no ]; then
|
||||
if [ $detached = no ]; then
|
||||
branch_color="$ok_color"
|
||||
else
|
||||
branch_color="$bad_color"
|
||||
@@ -508,13 +508,13 @@ __git_ps1 ()
|
||||
|
||||
# NO color option unless in PROMPT_COMMAND mode or it's Zsh
|
||||
if [ -n "${GIT_PS1_SHOWCOLORHINTS-}" ]; then
|
||||
if [ "$pcmode" = yes ] || [ -n "${ZSH_VERSION-}" ]; then
|
||||
if [ $pcmode = yes ] || [ -n "${ZSH_VERSION-}" ]; then
|
||||
__git_ps1_colorize_gitstring
|
||||
fi
|
||||
fi
|
||||
|
||||
b=${b##refs/heads/}
|
||||
if [ "$pcmode" = yes ] && [ "$ps1_expanded" = yes ]; then
|
||||
if [ $pcmode = yes ] && [ $ps1_expanded = yes ]; then
|
||||
__git_ps1_branch_name=$b
|
||||
b="\${__git_ps1_branch_name}"
|
||||
fi
|
||||
@@ -522,7 +522,7 @@ __git_ps1 ()
|
||||
local f="$w$i$s$u"
|
||||
local gitstring="$c$b${f:+$z$f}$r$p"
|
||||
|
||||
if [ "$pcmode" = yes ]; then
|
||||
if [ $pcmode = yes ]; then
|
||||
if [ "${__git_printf_supports_v-}" != yes ]; then
|
||||
gitstring=$(printf -- "$printf_format" "$gitstring")
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user