about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog3
-rw-r--r--Completion/Unix/Command/_git3
2 files changed, 5 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 225f7312f..221967fc0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2017-03-14  Daniel Shahaf  <d.s@daniel.shahaf.name>
 
+	* 40817: Completion/Unix/Command/_git: __git_recent_branches:
+	Retrieve less data, but faster.
+
 	* 40822: Doc/Zsh/contrib.yo: vcs_info quilt: Document the
 	'.quilt-foo' zstyle context element. (Compare users/20807.)
 
diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git
index 43cbc46ec..73daedcc9 100644
--- a/Completion/Unix/Command/_git
+++ b/Completion/Unix/Command/_git
@@ -6126,12 +6126,13 @@ __git_recent_branches__names()
   # 2. Extracts the move-source from each
   # 3. Eliminates duplicates
   # 4. Eliminates commit hashes (leaving only ref names)
+  #    [This step is done again by the caller.]
   #
   # See workers/38592 for an equivalent long-hand implementation, and the rest
   # of that thread for why this implementation was chosen instead.
   #
   # Note: since we obtain the "from" part of the reflog, we only obtain heads, not tags.
-  reply=(${${(u)${${(0)"$(_call_program reflog git reflog -1000 -z --grep-reflog='\^checkout:\ moving\ from\ ' --pretty='%gs')"}#checkout: moving from }%% *}:#[[:xdigit:]](#c40)})
+  reply=(${${(u)${${(M)${(0)"$(_call_program reflog git reflog -1000 -z --pretty='%gs')"}:#(#s)checkout: moving from *}#checkout: moving from }%% *}:#[0-9a-f](#c40)})
 }
 
 (( $+functions[__git_recent_branches] )) ||