zsh-workers
 help / color / mirror / code / Atom feed
From: Daniel Shahaf <d.s@daniel.shahaf.name>
To: zsh-workers@zsh.org
Subject: [PATCH] More git completion tweaks
Date: Mon, 13 Apr 2015 20:44:55 +0000	[thread overview]
Message-ID: <20150413204455.GC2133@tarsus.local2> (raw)

[-- Attachment #1: Type: text/plain, Size: 10 bytes --]

Attached.

[-- Attachment #2: 0001-completion-git-Fix-another-instance-of-the-34671-bug.patch --]
[-- Type: text/x-patch, Size: 1082 bytes --]

>From dd90cd4f36b9b907cda588b09ecbbd2737fecd70 Mon Sep 17 00:00:00 2001
From: Daniel Shahaf <d.s@daniel.shahaf.name>
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


[-- Attachment #3: 0002-completion-git-Sort-commit-object-completions-most-r.patch --]
[-- Type: text/x-patch, Size: 990 bytes --]

>From ab6a61fb2e59a64add6e6d9f24a9efd9ed01726f Mon Sep 17 00:00:00 2001
From: Daniel Shahaf <d.s@daniel.shahaf.name>
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


                 reply	other threads:[~2015-04-13 20:45 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150413204455.GC2133@tarsus.local2 \
    --to=d.s@daniel.shahaf.name \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).