summary refs log tree commit diff
diff options
context:
space:
mode:
authorDaniel Shahaf <d.s@daniel.shahaf.name>2015-10-20 14:22:25 +0000
committerDaniel Shahaf <d.s@daniel.shahaf.name>2015-10-20 14:30:10 +0000
commit98875bcb05d552cc59b300e33fe9000d295b1ffe (patch)
tree7b2af194ebb2b3f66bb8f849021e7fe704c0dde0
parentc6028f7387ad496ade9daaf76ac1683c3002bbf7 (diff)
downloadzsh-98875bcb05d552cc59b300e33fe9000d295b1ffe.tar.gz
zsh-98875bcb05d552cc59b300e33fe9000d295b1ffe.tar.xz
zsh-98875bcb05d552cc59b300e33fe9000d295b1ffe.zip
36900: _git: stash names completion: Display log messages
The "$@" argument to compadd is removed because (I think) it contains a -J,
which conflicts with the -V.

Joint with Daniel Hahler.
-rw-r--r--ChangeLog5
-rw-r--r--Completion/Unix/Command/_git13
2 files changed, 16 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 4d8b15c69..04883a152 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2015-10-20  Daniel Shahaf  <d.s@daniel.shahaf.name>
+
+	* 36900: Completion/Unix/Command/_git: _git: stash names
+	completion: Display log messages
+
 2015-10-19  Oliver Kiddle  <opk@zsh.org>
 
 	* 36642: Eric Cook: Completion/Unix/Command/_zfs:
diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git
index 1fcde9015..719d717d7 100644
--- a/Completion/Unix/Command/_git
+++ b/Completion/Unix/Command/_git
@@ -5487,12 +5487,21 @@ __git_signoff_file () {
 (( $+functions[__git_stashes] )) ||
 __git_stashes () {
   local expl
+  declare -a interleaved
   declare -a stashes
+  declare -a descriptions
 
-  stashes=(${(f)"$(_call_program stashes git stash list --pretty=format:%gd 2>/dev/null)"})
+  interleaved=(${(ps:\0:)"$(_call_program stashes git stash list -z --pretty='format:%gd%x00%s%x00\(%cr\)' 2>/dev/null)"})
   __git_command_successful $pipestatus || return 1
+  () {
+    local i j k
+    for i j k in $interleaved; do
+      stashes+=($i)
+      descriptions+=("$i: $j $k")
+    done
+  }
 
-  _wanted stashes expl stash compadd "$@" -a - stashes
+  _wanted stashes expl 'stash' compadd -Vx -d descriptions -a - stashes
 }
 
 (( $+functions[__git_svn_revisions] )) ||