Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

[PATCH 1/7] completion: git: __git_recent_commits: remove ' ->*' from heads



From: Daniel Hahler <git@xxxxxxxxxx>

%d/%D (decorate) will also provide a pointer to a ref, e.g.

   > HEAD -> completion-git-fixes
---
 Completion/Unix/Command/_git | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git
index c01333b..962b1e8 100644
--- a/Completion/Unix/Command/_git
+++ b/Completion/Unix/Command/_git
@@ -5673,6 +5673,7 @@ __git_recent_commits () {
     # see workers/34768
     descr+=("$i:[$i] $k")
     j=${${j# \(}%\)} # strip leading ' (' and trailing ')'
+    j=${j%% ->*}  # Remove " -> master, origin/master" etc.
     for j in ${(s:, :)j}; do
       if [[ $j == 'tag: '* ]] ; then
         tags+=( ${j#tag: } )
-- 
2.4.0.dirty



Messages sorted by: Reverse Date, Date, Thread, Author