mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-10-22 16:20:23 +02:00
35104: completion: git: __git_commit_objects: query 1000 commits
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.
This commit is contained in:
parent
454f079852
commit
94c6b32fe7
2 changed files with 8 additions and 2 deletions
|
@ -5656,12 +5656,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] )) ||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue