From ce80a925d69ed446d0cae8fb9c46f1f5398b8b93 Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Fri, 6 Mar 2015 20:33:14 +0000 Subject: 34638 with tweaks: git completion: complete commit hashes and --fixup --- Completion/Unix/Command/_git | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'Completion') diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git index 9552780c6..58d642216 100644 --- a/Completion/Unix/Command/_git +++ b/Completion/Unix/Command/_git @@ -647,8 +647,8 @@ _git-commit () { # TODO: --interactive isn't explicitly listed in the documentation. _arguments -w -S -s \ '(-a --all --interactive -o --only -i --include *)'{-a,--all}'[stage all modified and deleted paths]' \ - '--fixup=[construct a commit message for use with rebase --autosquash]:commit to be amended:' \ - '--squash=[construct a commit message for use with rebase --autosquash]:commit to be amended:' \ + '--fixup=[construct a commit message for use with rebase --autosquash]:commit to be amended:__git_commits' \ + '--squash=[construct a commit message for use with rebase --autosquash]:commit to be amended:__git_commits' \ $reset_author_opt \ '( --porcelain --dry-run)--short[output dry run in short format]' \ '(--short --dry-run)--porcelain[output dry run in porcelain-ready format]' \ @@ -5631,7 +5631,13 @@ __git_heads () { (( $+functions[__git_commit_objects] )) || __git_commit_objects () { - _guard '[[:xdigit:]](#c,40)' 'commit object name' + local gitdir expl start + declare -a commits + + : ${(A)commits::=${(f)"$(_call_program commits git --no-pager log -20 --format='%h:%s')"}} + __git_command_successful $pipestatus || return 1 + + _describe -t commits 'commit object name' commits } (( $+functions[__git_blob_objects] )) || -- cgit 1.4.1