From: Daniel Hahler <genml+zsh-workers@thequod.de>
To: zsh-workers@zsh.org
Subject: [PATCH 4/7] completion: git: __git_commit_objects: query 1000 commits
Date: Wed, 13 May 2015 16:26:28 +0200 [thread overview]
Message-ID: <1431527191-32165-5-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>
Also, `--all` and `--reflog` is used to get all commits.
It adds the _guard in front, so only non-empty values will come here.
Also, __git_commit_objects_prefer_recent will only call it, if there are
no matching recent commits.
---
Completion/Unix/Command/_git | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git
index b590df0..faf2e55 100644
--- a/Completion/Unix/Command/_git
+++ b/Completion/Unix/Command/_git
@@ -5655,12 +5655,15 @@ __git_commit_objects () {
local gitdir expl start
declare -a commits
+ # Abort if the argument does not match a commit hash (including empty).
+ _guard '[[:xdigit:]](#c,40)' || return 1
+
# 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')"}}
+ : ${(A)commits::=${(f)"$(_call_program commits git --no-pager log -1000 --all --reflog --format='%h:\\\[%h\\\]\ %s')"}}
__git_command_successful $pipestatus || return 1
- _describe -V -t commits 'commit object name' commits || _guard '[[:xdigit:]](#c,40)' 'commit object name'
+ _describe -V -t commits 'commit object name' commits
}
(( $+functions[__git_recent_commits] )) ||
--
2.4.0.dirty
next prev 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 ` [PATCH 3/7] completion: git: add __git_commit_objects_prefer_recent Daniel Hahler
2015-05-14 14:29 ` Daniel Shahaf
2015-05-13 14:26 ` Daniel Hahler [this message]
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-5-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).