zsh-workers
 help / color / mirror / code / Atom feed
From: Daniel Hahler <genml+zsh-workers@thequod.de>
To: zsh-workers@zsh.org
Subject: [PATCH 3/7] completion: git: add __git_commit_objects_prefer_recent
Date: Wed, 13 May 2015 16:26:27 +0200	[thread overview]
Message-ID: <1431527191-32165-4-git-send-email-genml+zsh-workers@thequod.de> (raw)
In-Reply-To: <1431527191-32165-1-git-send-email-genml+zsh-workers@thequod.de>

From: Daniel Hahler <git@thequod.de>

This is used with __git_commits then, and is meant to only call
__git_recent_commits, if there are matches.
---
 Completion/Unix/Command/_git | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git
index 2204fc8..b590df0 100644
--- a/Completion/Unix/Command/_git
+++ b/Completion/Unix/Command/_git
@@ -5599,6 +5599,11 @@ __git_remote_branch_names_noprefix () {
   _wanted remote-branch-names-noprefix expl 'remote branch name' compadd "$@" -a - branch_names
 }
 
+(( $+functions[__git_commit_objects_prefer_recent] )) ||
+__git_commit_objects_prefer_recent () {
+  __git_recent_commits || __git_commit_objects
+}
+
 (( $+functions[__git_commits] )) ||
 __git_commits () {
   # TODO: deal with things that __git_heads and __git_tags has in common (i.e.,
@@ -5609,7 +5614,7 @@ __git_commits () {
   _alternative \
     "heads::__git_heads $sopts" \
     "commit-tags::__git_commit_tags $sopts" \
-    'commit-objects::__git_commit_objects'
+    'commit-objects::__git_commit_objects_prefer_recent'
 }
 
 (( $+functions[__git_heads] )) ||
-- 
2.4.0.dirty


  parent reply	other threads:[~2015-05-13 14:26 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-13 14:26 completion: git: various improvements to commit object handling Daniel Hahler
2015-05-13 14:26 ` [PATCH 1/7] completion: git: __git_recent_commits: remove ' ->*' from heads Daniel Hahler
2015-05-13 14:26 ` [PATCH 2/7] completion: git: use %D for %d, without the " (", ")" wrapping Daniel Hahler
2015-05-13 14:26 ` Daniel Hahler [this message]
2015-05-14 14:29   ` [PATCH 3/7] completion: git: add __git_commit_objects_prefer_recent Daniel Shahaf
2015-05-13 14:26 ` [PATCH 4/7] completion: git: __git_commit_objects: query 1000 commits Daniel Hahler
2015-05-13 14:26 ` [PATCH 5/7] completion: git: add %cr to commit objects (all and recent) Daniel Hahler
2015-05-13 14:26 ` [PATCH 6/7] completion: git: unique name for __git_recent_commits Daniel Hahler
2015-05-13 14:26 ` [PATCH 7/7] completion: git: add distance_from_head to __git_recent_commits Daniel Hahler
2015-05-17 19:09 ` completion: git: various improvements to commit object handling Daniel Hahler

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=1431527191-32165-4-git-send-email-genml+zsh-workers@thequod.de \
    --to=genml+zsh-workers@thequod.de \
    --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).