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

[PATCH] More git completion tweaks



Attached.
From dd90cd4f36b9b907cda588b09ecbbd2737fecd70 Mon Sep 17 00:00:00 2001
From: Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx>
Date: Sat, 11 Apr 2015 10:13:55 +0000
Subject: [PATCH 1/2] completion: git: Fix another instance of the 34671 bug
 fixed in 34814

---
 Completion/Unix/Command/_git | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git
index b11c83c..365482c 100644
--- a/Completion/Unix/Command/_git
+++ b/Completion/Unix/Command/_git
@@ -5634,7 +5634,9 @@ __git_commit_objects () {
   local gitdir expl start
   declare -a commits
 
-  : ${(A)commits::=${(f)"$(_call_program commits git --no-pager log -20 --format='%h:%s')"}}
+  # Note: the after-the-colon part must be unique across the entire array;
+  # see workers/34768
+  : ${(A)commits::=${(f)"$(_call_program commits git --no-pager log -20 --format='%h:\\\[%h\\\]\ %s')"}}
   __git_command_successful $pipestatus || return 1
 
   _describe -t commits 'commit object name' commits || _guard '[[:xdigit:]](#c,40)' 'commit object name'
-- 
1.9.1

From ab6a61fb2e59a64add6e6d9f24a9efd9ed01726f Mon Sep 17 00:00:00 2001
From: Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx>
Date: Thu, 2 Apr 2015 13:28:58 +0000
Subject: [PATCH 2/2] completion: git: Sort "commit object" completions most
 recent first

---
 Completion/Unix/Command/_git | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git
index 365482c..6a2da17 100644
--- a/Completion/Unix/Command/_git
+++ b/Completion/Unix/Command/_git
@@ -5639,7 +5639,7 @@ __git_commit_objects () {
   : ${(A)commits::=${(f)"$(_call_program commits git --no-pager log -20 --format='%h:\\\[%h\\\]\ %s')"}}
   __git_command_successful $pipestatus || return 1
 
-  _describe -t commits 'commit object name' commits || _guard '[[:xdigit:]](#c,40)' 'commit object name'
+  _describe -V -t commits 'commit object name' commits || _guard '[[:xdigit:]](#c,40)' 'commit object name'
 }
 
 (( $+functions[__git_recent_commits] )) ||
-- 
1.9.1



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