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
b74a15a8
Unverified
Commit
b74a15a8
authored
Aug 14, 2022
by
Felipe Contreras
Committed by
GitHub
Aug 14, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(gitfast): update to git-completion 1.3.7 (#11114)
parent
835a0a5d
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
115 additions
and
67 deletions
+115
-67
git-completion.bash
plugins/gitfast/git-completion.bash
+67
-22
git-prompt.sh
plugins/gitfast/git-prompt.sh
+47
-44
update
plugins/gitfast/update
+1
-1
No files found.
plugins/gitfast/git-completion.bash
View file @
b74a15a8
This diff is collapsed.
Click to expand it.
plugins/gitfast/git-prompt.sh
View file @
b74a15a8
...
...
@@ -66,6 +66,11 @@
# git always compare HEAD to @{upstream}
# svn always compare HEAD to your SVN upstream
#
# By default, __git_ps1 will compare HEAD to your SVN upstream if it can
# find one, or @{upstream} otherwise. Once you have set
# GIT_PS1_SHOWUPSTREAM, you can override it on a per-repository basis by
# setting the bash.showUpstream config variable.
#
# You can change the separator between the branch name and the above
# state symbols by setting GIT_PS1_STATESEPARATOR. The default separator
# is SP.
...
...
@@ -79,11 +84,6 @@
# single '?' character by setting GIT_PS1_COMPRESSSPARSESTATE, or omitted
# by setting GIT_PS1_OMITSPARSESTATE.
#
# By default, __git_ps1 will compare HEAD to your SVN upstream if it can
# find one, or @{upstream} otherwise. Once you have set
# GIT_PS1_SHOWUPSTREAM, you can override it on a per-repository basis by
# setting the bash.showUpstream config variable.
#
# If you would like to see more information about the identity of
# commits checked out as a detached HEAD, set GIT_PS1_DESCRIBE_STYLE
# to one of these values:
...
...
@@ -115,7 +115,7 @@ __git_ps1_show_upstream ()
{
local
key value
local
svn_remote svn_url_pattern count n
local
upstream
=
git
legacy
=
""
verbose
=
""
name
=
""
local
upstream
_type
=
git
legacy
=
""
verbose
=
""
name
=
""
svn_remote
=()
# get some config options from git-config
...
...
@@ -132,7 +132,7 @@ __git_ps1_show_upstream ()
svn-remote.
*
.url
)
svn_remote[
$((${#
svn_remote
[@]
}
+
1
))
]=
"
$value
"
svn_url_pattern
=
"
$svn_url_pattern
\\
|
$value
"
upstream
=
svn+git
# default upstream
is SVN if available, else git
upstream
_type
=
svn+git
# default upstream type
is SVN if available, else git
;;
esac
done
<<<
"
$output
"
...
...
@@ -141,16 +141,16 @@ __git_ps1_show_upstream ()
local
option
for
option
in
${
GIT_PS1_SHOWUPSTREAM
}
;
do
case
"
$option
"
in
git|svn
)
upstream
=
"
$option
"
;;
git|svn
)
upstream
_type
=
"
$option
"
;;
verbose
)
verbose
=
1
;;
legacy
)
legacy
=
1
;;
name
)
name
=
1
;;
esac
done
# Find our upstream
case
"
$upstream
"
in
git
)
upstream
=
"@{upstream}"
;;
# Find our upstream
type
case
"
$upstream
_type
"
in
git
)
upstream
_type
=
"@{upstream}"
;;
svn
*
)
# get the upstream from the "git-svn-id: ..." in a commit message
# (git-svn uses essentially the same procedure internally)
...
...
@@ -167,12 +167,12 @@ __git_ps1_show_upstream ()
if
[[
-z
"
$svn_upstream
"
]]
;
then
# default branch name for checkouts with no layout:
upstream
=
${
GIT_SVN_ID
:-
git
-svn
}
upstream
_type
=
${
GIT_SVN_ID
:-
git
-svn
}
else
upstream
=
${
svn_upstream
#/
}
upstream
_type
=
${
svn_upstream
#/
}
fi
elif
[[
"svn+git"
=
"
$upstream
"
]]
;
then
upstream
=
"@{upstream}"
elif
[[
"svn+git"
=
"
$upstream
_type
"
]]
;
then
upstream
_type
=
"@{upstream}"
fi
;;
esac
...
...
@@ -180,11 +180,11 @@ __git_ps1_show_upstream ()
# Find how many commits we are ahead/behind our upstream
if
[[
-z
"
$legacy
"
]]
;
then
count
=
"
$(
git rev-list
--count
--left-right
\
"
$upstream
"
...HEAD 2>/dev/null
)
"
"
$upstream
_type
"
...HEAD 2>/dev/null
)
"
else
# produce equivalent output to --count for older versions of git
local
commits
if
commits
=
"
$(
git rev-list
--left-right
"
$upstream
"
...HEAD 2>/dev/null
)
"
if
commits
=
"
$(
git rev-list
--left-right
"
$upstream
_type
"
...HEAD 2>/dev/null
)
"
then
local
commit
behind
=
0
ahead
=
0
for
commit
in
$commits
...
...
@@ -214,26 +214,26 @@ __git_ps1_show_upstream ()
*
)
# diverged from upstream
p
=
"<>"
;;
esac
else
else
# verbose, set upstream instead of p
case
"
$count
"
in
""
)
# no upstream
p
=
""
;;
upstream
=
""
;;
"0 0"
)
# equal to upstream
p
=
"
u="
;;
upstream
=
"|
u="
;;
"0 "
*
)
# ahead of upstream
p
=
"
u+
${
count
#0
}
"
;;
upstream
=
"|
u+
${
count
#0
}
"
;;
*
" 0"
)
# behind upstream
p
=
"
u-
${
count
% 0
}
"
;;
upstream
=
"|
u-
${
count
% 0
}
"
;;
*
)
# diverged from upstream
p
=
"
u+
${
count
#*
}
-
${
count
% *
}
"
;;
upstream
=
"|
u+
${
count
#*
}
-
${
count
% *
}
"
;;
esac
if
[[
-n
"
$count
"
&&
-n
"
$name
"
]]
;
then
__git_ps1_upstream_name
=
$(
git rev-parse
\
--abbrev-ref
"
$upstream
"
2>/dev/null
)
--abbrev-ref
"
$upstream
_type
"
2>/dev/null
)
if
[
$pcmode
=
yes
]
&&
[
$ps1_expanded
=
yes
]
;
then
p
=
"
$p
\$
{__git_ps1_upstream_name}"
upstream
=
"
$upstream
\$
{__git_ps1_upstream_name}"
else
p
=
"
$p
${
__git_ps1_upstream_name
}
"
upstream
=
"
$upstream
${
__git_ps1_upstream_name
}
"
# not needed anymore; keep user's
# environment clean
unset
__git_ps1_upstream_name
...
...
@@ -245,7 +245,8 @@ __git_ps1_show_upstream ()
# Helper function that is meant to be called from __git_ps1. It
# injects color codes into the appropriate gitstring variables used
# to build a gitstring.
# to build a gitstring. Colored variables are responsible for clearing
# their own color.
__git_ps1_colorize_gitstring
()
{
if
[[
-n
${
ZSH_VERSION
-
}
]]
;
then
...
...
@@ -271,22 +272,23 @@ __git_ps1_colorize_gitstring ()
else
branch_color
=
"
$bad_color
"
fi
c
=
"
$branch_color$c
"
if
[
-n
"
$c
"
]
;
then
c
=
"
$branch_color$c$c_clear
"
fi
b
=
"
$branch_color$b$c_clear
"
z
=
"
$c_clear$z
"
if
[
"
$w
"
=
"*"
]
;
then
w
=
"
$bad_color$w
"
if
[
-n
"
$w
"
]
;
then
w
=
"
$bad_color$w$c_clear
"
fi
if
[
-n
"
$i
"
]
;
then
i
=
"
$ok_color$i
"
i
=
"
$ok_color$i
$c_clear
"
fi
if
[
-n
"
$s
"
]
;
then
s
=
"
$flags_color$s
"
s
=
"
$flags_color$s
$c_clear
"
fi
if
[
-n
"
$u
"
]
;
then
u
=
"
$bad_color$u
"
u
=
"
$bad_color$u
$c_clear
"
fi
r
=
"
$c_clear$r
"
}
# Helper function to read the first line of a file into a variable.
...
...
@@ -512,7 +514,8 @@ __git_ps1 ()
local
u
=
""
local
h
=
""
local
c
=
""
local
p
=
""
local
p
=
""
# short version of upstream state indicator
local
upstream
=
""
# verbose version of upstream state indicator
if
[
"true"
=
"
$inside_gitdir
"
]
;
then
if
[
"true"
=
"
$bare_repo
"
]
;
then
...
...
@@ -555,6 +558,12 @@ __git_ps1 ()
local
z
=
"
${
GIT_PS1_STATESEPARATOR
-
" "
}
"
b
=
${
b
##refs/heads/
}
if
[
$pcmode
=
yes
]
&&
[
$ps1_expanded
=
yes
]
;
then
__git_ps1_branch_name
=
$b
b
=
"
\$
{__git_ps1_branch_name}"
fi
# 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
...
...
@@ -562,14 +571,8 @@ __git_ps1 ()
fi
fi
b
=
${
b
##refs/heads/
}
if
[
$pcmode
=
yes
]
&&
[
$ps1_expanded
=
yes
]
;
then
__git_ps1_branch_name
=
$b
b
=
"
\$
{__git_ps1_branch_name}"
fi
local
f
=
"
$h$w$i$s$u
"
local
gitstring
=
"
$c$b
${
f
:+
$z$f
}${
sparse
}
$r$p
"
local
f
=
"
$h$w$i$s$u$p
"
local
gitstring
=
"
$c$b
${
f
:+
$z$f
}${
sparse
}
$r
${
upstream
}
"
if
[
$pcmode
=
yes
]
;
then
if
[
"
${
__git_printf_supports_v
-
}
"
!=
yes
]
;
then
...
...
plugins/gitfast/update
View file @
b74a15a8
#!/bin/sh
url
=
"https://raw.githubusercontent.com/felipec/git-completion"
version
=
"1.3.
6
"
version
=
"1.3.
7
"
curl
-s
-o
_git
"
${
url
}
/v
${
version
}
/git-completion.zsh"
&&
curl
-s
-o
git-completion.bash
"
${
url
}
/v
${
version
}
/git-completion.bash"
&&
...
...
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