summaryrefslogtreecommitdiff
path: root/Completion/Unix/Command
diff options
context:
space:
mode:
authorAxel Beckert <abe@deuxchevaux.org>2018-09-15 01:47:04 +0200
committerAxel Beckert <abe@deuxchevaux.org>2018-09-15 01:47:04 +0200
commit3d116bbb41654625687f0dbec0fef30b961e191d (patch)
tree3a56be953e45a78a95404fd816c325eae9410be7 /Completion/Unix/Command
parent77265d89ccd13989f26366915c46a3f5775a4dce (diff)
parent92bef88545ee9dc23f35886a8606c81610341477 (diff)
downloadzsh-3d116bbb41654625687f0dbec0fef30b961e191d.tar.gz
zsh-3d116bbb41654625687f0dbec0fef30b961e191d.zip
Merge tag 'zsh-5.6.2' into debian
Patch release: 5.6.2
Diffstat (limited to 'Completion/Unix/Command')
-rw-r--r--Completion/Unix/Command/_git25
-rw-r--r--Completion/Unix/Command/_subversion2
2 files changed, 24 insertions, 3 deletions
diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git
index 2cae4c82f..195a7f6dc 100644
--- a/Completion/Unix/Command/_git
+++ b/Completion/Unix/Command/_git
@@ -2108,8 +2108,7 @@ _git-worktree() {
;;
esac
if [[ $state = worktrees ]]; then
- _wanted directories expl 'working tree' compadd -S ' ' -f -M 'r:|/=* r:|=*' \
- ${${(M)${(f)"$(_call_program directories git worktree list --porcelain)"}:#worktree*}#* } && ret=0
+ __git_worktrees && ret=0
fi
;;
esac
@@ -7561,6 +7560,28 @@ __git_browsers () {
'builtin-browsers:builtin browser:compadd -a - builtinbrowsers'
}
+__git_worktrees () {
+ local -a records=( ${(ps.\n\n.)"$(_call_program directories git worktree list --porcelain)"} )
+ local -a directories descriptions
+ local i hash branch
+ for i in $records; do
+ directories+=( ${${i%%$'\n'*}#worktree } )
+ hash=${${${"${(f)i}"[2]}#HEAD }[1,9]}
+ branch=${${"${(f)i}"[3]}#branch refs/heads/}
+
+ # Simulate the non-porcelain output
+ if [[ $branch == detached ]]; then
+ # TODO: show a ref that points at $hash here, like vcs_info does?
+ branch="(detached HEAD)"
+ else
+ branch="[$branch]"
+ fi
+
+ descriptions+=( "${directories[-1]}"$'\t'"$hash $branch" )
+ done
+ _wanted directories expl 'working tree' compadd -ld descriptions -S ' ' -f -M 'r:|/=* r:|=*' -a directories
+}
+
(( $+functions[__git_difftools] )) ||
__git_difftools () {
__git_diff-or-merge-tools diff $*
diff --git a/Completion/Unix/Command/_subversion b/Completion/Unix/Command/_subversion
index e16be7e59..d30f2e657 100644
--- a/Completion/Unix/Command/_subversion
+++ b/Completion/Unix/Command/_subversion
@@ -70,7 +70,7 @@ _svn () {
${=${${${(M)${(f)"$(_call_program options svn help $cmd)"#(*Valid options:|(#e))}:#* :*}%% #:*}/ (arg|ARG)/:arg:}/(#b)(-##)([[:alpha:]]##) \[--([a-z-]##)\](:arg:)#/(--$match[3])$match[1]$match[2]$match[4] ($match[1]$match[2])--$match[3]$match[4]}
)
while (( idx=$args[(I)*--accept:arg:] )); do
- args[idx]=( --accept'=:automatic conflict resolution action:((working\:working base\:base '"`for i j in p postpone mc mine-conflict tc theirs-conflict mf mine-full tf theirs-full e edit l launch; do print -rn $i\\\\:$j $j\\\\:$j ""; done `"'))' )
+ args[idx]=( --accept'=:automatic conflict resolution action:((working\:working base\:base recommended\:recommended '"`for i j in p postpone mc mine-conflict tc theirs-conflict mf mine-full tf theirs-full e edit l launch; do print -rn $i\\\\:$j $j\\\\:$j ""; done `"'))' )
done
while (( idx=$args[(I)*--c(l|hangelist):arg:] )); do
args[idx]=( \*{--cl,--changelist}'=:change list:_svn_changelists' )