Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
[PATCH 3/7] completion: git: add __git_commit_objects_prefer_recent
- X-seq: zsh-workers 35101
- From: Daniel Hahler <genml+zsh-workers@xxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: [PATCH 3/7] completion: git: add __git_commit_objects_prefer_recent
- Date: Wed, 13 May 2015 16:26:27 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/simple; d=thequod.de; h= references:in-reply-to:x-mailer:message-id:date:date:subject :subject:from:from:received:received:received; s=postfix2; t= 1431527205; bh=kUgTvywvwqSCqKtjcFk+oasj/D6OdGTDg74ItkmVyyE=; b=Z /WTLC6oYRDHMj6vj7df24S2etWAww2eTCVgI/VPL1tvV1cuAzw2MrDPJVpXpdLV9 mxqEIh4MerDKZZNd+WDOgYaaKYUDlcsYeTVYSkqL1eW7NPJeeXJxyVsd5lL1I9Oo oo101SN4rrZxmyd9swKC/rKE99AREWt88tnK/FWBxo=
- In-reply-to: <1431527191-32165-1-git-send-email-genml+zsh-workers@thequod.de>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <1431527191-32165-1-git-send-email-genml+zsh-workers@thequod.de>
From: Daniel Hahler <git@xxxxxxxxxx>
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
Messages sorted by:
Reverse Date,
Date,
Thread,
Author