mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-10-23 16:40:24 +02:00
34638 with tweaks: git completion: complete commit hashes and --fixup
This commit is contained in:
parent
d902b55bd4
commit
ce80a925d6
2 changed files with 14 additions and 3 deletions
|
@ -1,3 +1,8 @@
|
|||
2015-03-07 Daniel Shahaf <d.s@daniel.shahaf.name>
|
||||
|
||||
* 34638: Completion/Unix/Command/_git: 34638 with tweaks:
|
||||
git completion: complete commit hashes and --fixup
|
||||
|
||||
2015-03-05 Jun-ichi Takimoto <takimoto-j@kba.biglobe.ne.jp>
|
||||
|
||||
* 34643: Doc/Zsh/builtins.yo, Doc/Zsh/zle.yo: clarify which
|
||||
|
|
|
@ -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] )) ||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue