Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
oh-my-zsh
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
github
oh-my-zsh
Commits
0736a374
Unverified
Commit
0736a374
authored
May 05, 2020
by
Felipe Contreras
Committed by
GitHub
May 05, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gitfast: proper synchronization (#8550)
parent
ff987384
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
772 additions
and
610 deletions
+772
-610
_git
plugins/gitfast/_git
+6
-13
git-completion.bash
plugins/gitfast/git-completion.bash
+760
-591
git-prompt.sh
plugins/gitfast/git-prompt.sh
+6
-6
No files found.
plugins/gitfast/_git
View file @
0736a374
...
@@ -30,7 +30,7 @@ if [ -z "$script" ]; then
...
@@ -30,7 +30,7 @@ if [ -z "$script" ]; then
local -a locations
local -a locations
local e
local e
locations=(
locations=(
$(dirname ${funcsourcetrace[1]%:*})/git-completion.bash
"$(dirname ${funcsourcetrace[1]%:*})/git-completion.bash"
'/etc/bash_completion.d/git' # fedora, old debian
'/etc/bash_completion.d/git' # fedora, old debian
'/usr/share/bash-completion/completions/git' # arch, ubuntu, new debian
'/usr/share/bash-completion/completions/git' # arch, ubuntu, new debian
'/usr/share/bash-completion/git' # gentoo
'/usr/share/bash-completion/git' # gentoo
...
@@ -39,7 +39,7 @@ if [ -z "$script" ]; then
...
@@ -39,7 +39,7 @@ if [ -z "$script" ]; then
test -f $e && script="$e" && break
test -f $e && script="$e" && break
done
done
fi
fi
GIT_SOURCING_ZSH_COMPLETION=y
. "$script"
ZSH_VERSION=''
. "$script"
__gitcomp ()
__gitcomp ()
{
{
...
@@ -93,22 +93,13 @@ __gitcomp_nl_append ()
...
@@ -93,22 +93,13 @@ __gitcomp_nl_append ()
compadd -Q -S "${4- }" -p "${2-}" -- ${=1} && _ret=0
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 ()
__gitcomp_file ()
{
{
emulate -L zsh
emulate -L zsh
local IFS=$'\n'
local IFS=$'\n'
compset -P '*[=:]'
compset -P '*[=:]'
compadd -p "${2-}" -f -- ${=1} && _ret=0
compadd -
Q -
p "${2-}" -f -- ${=1} && _ret=0
}
}
__git_zsh_bash_func ()
__git_zsh_bash_func ()
...
@@ -232,8 +223,10 @@ _git ()
...
@@ -232,8 +223,10 @@ _git ()
if (( $+functions[__${service}_zsh_main] )); then
if (( $+functions[__${service}_zsh_main] )); then
__${service}_zsh_main
__${service}_zsh_main
el
se
el
if (( $+functions[__${service}_main] )); then
emulate ksh -c __${service}_main
emulate ksh -c __${service}_main
elif (( $+functions[_${service}] )); then
emulate ksh -c _${service}
fi
fi
let _ret && _default && _ret=0
let _ret && _default && _ret=0
...
...
plugins/gitfast/git-completion.bash
View file @
0736a374
This diff is collapsed.
Click to expand it.
plugins/gitfast/git-prompt.sh
View file @
0736a374
...
@@ -219,7 +219,7 @@ __git_ps1_show_upstream ()
...
@@ -219,7 +219,7 @@ __git_ps1_show_upstream ()
if
[[
-n
"
$count
"
&&
-n
"
$name
"
]]
;
then
if
[[
-n
"
$count
"
&&
-n
"
$name
"
]]
;
then
__git_ps1_upstream_name
=
$(
git rev-parse
\
__git_ps1_upstream_name
=
$(
git rev-parse
\
--abbrev-ref
"
$upstream
"
2>/dev/null
)
--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}"
p
=
"
$p
\$
{__git_ps1_upstream_name}"
else
else
p
=
"
$p
${
__git_ps1_upstream_name
}
"
p
=
"
$p
${
__git_ps1_upstream_name
}
"
...
@@ -237,7 +237,7 @@ __git_ps1_show_upstream ()
...
@@ -237,7 +237,7 @@ __git_ps1_show_upstream ()
# to build a gitstring.
# to build a gitstring.
__git_ps1_colorize_gitstring
()
__git_ps1_colorize_gitstring
()
{
{
if
[[
-n
"
${
ZSH_VERSION
-
}
"
]]
;
then
if
[[
-n
${
ZSH_VERSION
-
}
]]
;
then
local
c_red
=
'%F{red}'
local
c_red
=
'%F{red}'
local
c_green
=
'%F{green}'
local
c_green
=
'%F{green}'
local
c_lblue
=
'%F{blue}'
local
c_lblue
=
'%F{blue}'
...
@@ -255,7 +255,7 @@ __git_ps1_colorize_gitstring ()
...
@@ -255,7 +255,7 @@ __git_ps1_colorize_gitstring ()
local
flags_color
=
"
$c_lblue
"
local
flags_color
=
"
$c_lblue
"
local
branch_color
=
""
local
branch_color
=
""
if
[
"
$detached
"
=
no
]
;
then
if
[
$detached
=
no
]
;
then
branch_color
=
"
$ok_color
"
branch_color
=
"
$ok_color
"
else
else
branch_color
=
"
$bad_color
"
branch_color
=
"
$bad_color
"
...
@@ -508,13 +508,13 @@ __git_ps1 ()
...
@@ -508,13 +508,13 @@ __git_ps1 ()
# NO color option unless in PROMPT_COMMAND mode or it's Zsh
# NO color option unless in PROMPT_COMMAND mode or it's Zsh
if
[
-n
"
${
GIT_PS1_SHOWCOLORHINTS
-
}
"
]
;
then
if
[
-n
"
${
GIT_PS1_SHOWCOLORHINTS
-
}
"
]
;
then
if
[
"
$pcmode
"
=
yes
]
||
[
-n
"
${
ZSH_VERSION
-
}
"
]
;
then
if
[
$pcmode
=
yes
]
||
[
-n
"
${
ZSH_VERSION
-
}
"
]
;
then
__git_ps1_colorize_gitstring
__git_ps1_colorize_gitstring
fi
fi
fi
fi
b
=
${
b
##refs/heads/
}
b
=
${
b
##refs/heads/
}
if
[
"
$pcmode
"
=
yes
]
&&
[
"
$ps1_expanded
"
=
yes
]
;
then
if
[
$pcmode
=
yes
]
&&
[
$ps1_expanded
=
yes
]
;
then
__git_ps1_branch_name
=
$b
__git_ps1_branch_name
=
$b
b
=
"
\$
{__git_ps1_branch_name}"
b
=
"
\$
{__git_ps1_branch_name}"
fi
fi
...
@@ -522,7 +522,7 @@ __git_ps1 ()
...
@@ -522,7 +522,7 @@ __git_ps1 ()
local
f
=
"
$w$i$s$u
"
local
f
=
"
$w$i$s$u
"
local
gitstring
=
"
$c$b
${
f
:+
$z$f
}
$r$p
"
local
gitstring
=
"
$c$b
${
f
:+
$z$f
}
$r$p
"
if
[
"
$pcmode
"
=
yes
]
;
then
if
[
$pcmode
=
yes
]
;
then
if
[
"
${
__git_printf_supports_v
-
}
"
!=
yes
]
;
then
if
[
"
${
__git_printf_supports_v
-
}
"
!=
yes
]
;
then
gitstring
=
$(
printf
--
"
$printf_format
"
"
$gitstring
"
)
gitstring
=
$(
printf
--
"
$printf_format
"
"
$gitstring
"
)
else
else
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment