diff options
author | Daniel Hahler <git@thequod.de> | 2015-05-13 15:24:28 +0200 |
---|---|---|
committer | Daniel Hahler <git@thequod.de> | 2015-05-18 02:48:03 +0200 |
commit | 454f079852deb0c704870c7d5a462485f1e65bbf (patch) | |
tree | 562f4f1d278b5fd5e9badff1100b3c1f0ad02b30 | |
parent | 1d5b2254988ceeca2a2a04db2e77733f265afbd2 (diff) | |
download | zsh-454f079852deb0c704870c7d5a462485f1e65bbf.tar.gz zsh-454f079852deb0c704870c7d5a462485f1e65bbf.tar.xz zsh-454f079852deb0c704870c7d5a462485f1e65bbf.zip |
35101: completion: git: add __git_commit_objects_prefer_recent
This is used with __git_commits then, and is meant to only call __git_recent_commits, if there are matches.
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | Completion/Unix/Command/_git | 7 |
2 files changed, 11 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog index f96c27d2e..685575c05 100644 --- a/ChangeLog +++ b/ChangeLog @@ -8,6 +8,11 @@ Handle " -> master, origin/master" in decorated git-log output, and add it as separate entries. + * 35101: Completion/Unix/Command/_git: add + __git_commit_objects_prefer_recent. This is used with __git_commits + then, and is meant to only call __git_recent_commits, if there are + matches. + 2015-05-16 Daniel Shahaf <d.s@daniel.shahaf.name> * 35161: Completion/Unix/Command/_git: completion: git: Fix diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git index 92835387d..d64e777e8 100644 --- a/Completion/Unix/Command/_git +++ b/Completion/Unix/Command/_git @@ -5600,6 +5600,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., @@ -5610,7 +5615,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] )) || |