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
6f9650d9
Unverified
Commit
6f9650d9
authored
Jan 28, 2022
by
Felipe Contreras
Committed by
GitHub
Jan 28, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(gitfast): update to git-completion 1.3.6 (#10633)
parent
3c5367d2
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
518 additions
and
544 deletions
+518
-544
_git
plugins/gitfast/_git
+20
-26
git-completion.bash
plugins/gitfast/git-completion.bash
+493
-514
git-prompt.sh
plugins/gitfast/git-prompt.sh
+4
-3
update
plugins/gitfast/update
+1
-1
No files found.
plugins/gitfast/_git
View file @
6f9650d9
...
@@ -33,8 +33,9 @@ if [ -z "$script" ]; then
...
@@ -33,8 +33,9 @@ if [ -z "$script" ]; then
bash_completion='/usr/share/bash-completion/completions/'
bash_completion='/usr/share/bash-completion/completions/'
locations=(
locations=(
"$
(dirname ${funcsourcetrace[1]%:*})
"/git-completion.bash
"$
{${funcsourcetrace[1]%:*}:A:h}
"/git-completion.bash
"$HOME/.local/share/bash-completion/completions/git"
"$HOME/.local/share/bash-completion/completions/git"
'/usr/local/share/bash-completion/completions/git'
"$bash_completion/git"
"$bash_completion/git"
'/etc/bash_completion.d/git' # old debian
'/etc/bash_completion.d/git' # old debian
)
)
...
@@ -51,13 +52,20 @@ functions[complete]="$old_complete"
...
@@ -51,13 +52,20 @@ functions[complete]="$old_complete"
__gitcompadd ()
__gitcompadd ()
{
{
compadd -
Q -p "${2-}" -S "${3- }" ${@[4,-1]}
-- ${=1} && _ret=0
compadd -
p "${2-}" -S "${3- }" -q
-- ${=1} && _ret=0
}
}
__gitcomp ()
__gitcomp ()
{
{
emulate -L zsh
emulate -L zsh
IFS=$' \t\n' __gitcompadd "$1" "${2-}" "${4- }"
}
__gitcomp_opts ()
{
emulate -L zsh
local cur_="${3-$cur}"
local cur_="${3-$cur}"
[[ "$cur_" == *= ]] && return
[[ "$cur_" == *= ]] && return
...
@@ -70,7 +78,7 @@ __gitcomp ()
...
@@ -70,7 +78,7 @@ __gitcomp ()
break
break
fi
fi
if [[ -z "${4
-
}" ]]; then
if [[ -z "${4
+set
}" ]]; then
case $c in
case $c in
*=) c="${c%=}"; sfx="=" ;;
*=) c="${c%=}"; sfx="=" ;;
*.) sfx="" ;;
*.) sfx="" ;;
...
@@ -79,7 +87,7 @@ __gitcomp ()
...
@@ -79,7 +87,7 @@ __gitcomp ()
else
else
sfx="$4"
sfx="$4"
fi
fi
__gitcompadd "$c" "${2-}" "$sfx"
-q
__gitcompadd "$c" "${2-}" "$sfx"
done
done
}
}
...
@@ -87,7 +95,10 @@ __gitcomp_nl ()
...
@@ -87,7 +95,10 @@ __gitcomp_nl ()
{
{
emulate -L zsh
emulate -L zsh
IFS=$'\n' __gitcompadd "$1" "${2-}" "${4- }"
# words that don't end up in space
compadd -p "${2-}" -S "${4- }" -q -- ${${(f)1}:#*\ } && _ret=0
# words that end in space
compadd -p "${2-}" -S " ${4- }" -q -- ${${(M)${(f)1}:#*\ }% } && _ret=0
}
}
__gitcomp_file ()
__gitcomp_file ()
...
@@ -107,21 +118,6 @@ __gitcomp_file_direct ()
...
@@ -107,21 +118,6 @@ __gitcomp_file_direct ()
__gitcomp_file "$1" ""
__gitcomp_file "$1" ""
}
}
__gitcomp_nl_append ()
{
__gitcomp_nl "$@"
}
__gitcomp_direct_append ()
{
__gitcomp_direct "$@"
}
_git_zsh ()
{
__gitcomp "v1.2"
}
__git_complete_command ()
__git_complete_command ()
{
{
emulate -L zsh
emulate -L zsh
...
@@ -206,9 +202,7 @@ __git_zsh_main ()
...
@@ -206,9 +202,7 @@ __git_zsh_main ()
{
{
local curcontext="$curcontext" state state_descr line
local curcontext="$curcontext" state state_descr line
typeset -A opt_args
typeset -A opt_args
local -a orig_words __git_C_args
local -a __git_C_args
orig_words=( ${words[@]} )
_arguments -C \
_arguments -C \
'(-p --paginate -P --no-pager)'{-p,--paginate}'[pipe all output into ''less'']' \
'(-p --paginate -P --no-pager)'{-p,--paginate}'[pipe all output into ''less'']' \
...
@@ -245,7 +239,7 @@ __git_zsh_main ()
...
@@ -245,7 +239,7 @@ __git_zsh_main ()
emulate ksh -c __git_complete_config_variable_name_and_value
emulate ksh -c __git_complete_config_variable_name_and_value
;;
;;
(arg)
(arg)
local command="${words[1]}" __git_dir
local command="${words[1]}" __git_dir
__git_cmd_idx=1
if (( $+opt_args[--bare] )); then
if (( $+opt_args[--bare] )); then
__git_dir='.'
__git_dir='.'
...
@@ -259,7 +253,7 @@ __git_zsh_main ()
...
@@ -259,7 +253,7 @@ __git_zsh_main ()
(( $+opt_args[--help] )) && command='help'
(( $+opt_args[--help] )) && command='help'
words=(
${orig_
words[@]} )
words=(
git ${
words[@]} )
__git_zsh_bash_func $command
__git_zsh_bash_func $command
;;
;;
...
@@ -269,7 +263,7 @@ __git_zsh_main ()
...
@@ -269,7 +263,7 @@ __git_zsh_main ()
_git ()
_git ()
{
{
local _ret=1
local _ret=1
local cur cword prev
local cur cword prev
__git_cmd_idx=0
cur=${words[CURRENT]}
cur=${words[CURRENT]}
prev=${words[CURRENT-1]}
prev=${words[CURRENT-1]}
...
...
plugins/gitfast/git-completion.bash
View file @
6f9650d9
This source diff could not be displayed because it is too large. You can
view the blob
instead.
plugins/gitfast/git-prompt.sh
View file @
6f9650d9
...
@@ -138,6 +138,7 @@ __git_ps1_show_upstream ()
...
@@ -138,6 +138,7 @@ __git_ps1_show_upstream ()
done
<<<
"
$output
"
done
<<<
"
$output
"
# parse configuration values
# parse configuration values
local
option
for
option
in
${
GIT_PS1_SHOWUPSTREAM
}
;
do
for
option
in
${
GIT_PS1_SHOWUPSTREAM
}
;
do
case
"
$option
"
in
case
"
$option
"
in
git|svn
)
upstream
=
"
$option
"
;;
git|svn
)
upstream
=
"
$option
"
;;
...
@@ -432,8 +433,8 @@ __git_ps1 ()
...
@@ -432,8 +433,8 @@ __git_ps1 ()
fi
fi
local
sparse
=
""
local
sparse
=
""
if
[
-z
"
${
GIT_PS1_COMPRESSSPARSESTATE
}
"
]
&&
if
[
-z
"
${
GIT_PS1_COMPRESSSPARSESTATE
-
}
"
]
&&
[
-z
"
${
GIT_PS1_OMITSPARSESTATE
}
"
]
&&
[
-z
"
${
GIT_PS1_OMITSPARSESTATE
-
}
"
]
&&
[
"
$(
git config
--bool
core.sparseCheckout
)
"
=
"true"
]
;
then
[
"
$(
git config
--bool
core.sparseCheckout
)
"
=
"true"
]
;
then
sparse
=
"|SPARSE"
sparse
=
"|SPARSE"
fi
fi
...
@@ -542,7 +543,7 @@ __git_ps1 ()
...
@@ -542,7 +543,7 @@ __git_ps1 ()
u
=
"%
${
ZSH_VERSION
+%
}
"
u
=
"%
${
ZSH_VERSION
+%
}
"
fi
fi
if
[
-n
"
${
GIT_PS1_COMPRESSSPARSESTATE
}
"
]
&&
if
[
-n
"
${
GIT_PS1_COMPRESSSPARSESTATE
-
}
"
]
&&
[
"
$(
git config
--bool
core.sparseCheckout
)
"
=
"true"
]
;
then
[
"
$(
git config
--bool
core.sparseCheckout
)
"
=
"true"
]
;
then
h
=
"?"
h
=
"?"
fi
fi
...
...
plugins/gitfast/update
View file @
6f9650d9
#!/bin/sh
#!/bin/sh
url
=
"https://raw.githubusercontent.com/felipec/git-completion"
url
=
"https://raw.githubusercontent.com/felipec/git-completion"
version
=
"1.
2
"
version
=
"1.
3.6
"
curl
-s
-o
_git
"
${
url
}
/v
${
version
}
/git-completion.zsh"
&&
curl
-s
-o
_git
"
${
url
}
/v
${
version
}
/git-completion.zsh"
&&
curl
-s
-o
git-completion.bash
"
${
url
}
/v
${
version
}
/git-completion.bash"
&&
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