This makes `branch_arg` empty by default, to be used only for
__git_remote_branch_names.
`branches::__git_revisions` was used here, but that's the same as
tree_ish_arg='tree-ishs::__git_tree_ishs' - both call __git_commits.
Only tree_ish_arg will call __git-commits now.
The new completion is mostly boilerplate except for the handling of
$words/$CURRENT to support specifying the arguments multiple times
separated by -n.
Without this, `ret` will be set to 1 with `git diff --ex<tab>` and
result in duplicate entries:
% git diff --ex<tab>
-- option --
--exit-code -- report exit code 1 if differences, 0 otherwise
--exit-code -- report exit code 1 if differences, 0 otherwise
--ext-diff -- allow external diff helper to be executed
--ext-diff -- allow external diff helper to be executed
--no-ext-diff -- disallow external diff helper to be executed
-- recent commit object name --
With using `_guard` there like it's been done, the completion could not
be selected, probably because of the call to `_message` therein.
This changes it to use only the logic/check from `_guard` that we want
here.
Remove "-2" for _describe in __git_recent_commits.
This fixes the duplicate entries issue, because __git_recent_commits
gets called twice for _git-checkout (for __git_revisions and
__git_tree_ishs):
1. __git_commit_objects_prefer_recent _alternative __git_commits
__git_revisions _alternative _git-checkout
2. __git_commit_objects_prefer_recent _alternative __git_commits
__git_tree_ishs _alternative _git-checkout
$pipestatus for `: foo` is 0 always.
Without this, "git checkout" in a non-git directory would complete " ",
but not result in a note/error about not being in a git dir.
Allows 'git checkout o/m<TAB>' to complete 'origin/master'.
Moreover, '/x<TAB>' would complete 'foo/bar/xyzzy/baz', since the matchspec
uses not '*' but '**'.
"|" is now found properly by looking for words that come
from the lexical analyser, rather than hacking a pattern
returned in one dollop.
Update some completion functions that need extra quoting
as a result.
Add test for new parsing.
Update version number to 5.0.8-dev-3 because of wordcode
incompatibility.
This adds the "HEAD~15" gitrevisions(7) identifier of the commit to the
description, which also uniquifies, isn't redundant, and may be easier
to type.
Ref: zsh-workers/34820 (http://www.zsh.org/mla/workers/2015/msg00744.html)
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.