Skip to content

Instantly share code, notes, and snippets.

@johan johan/_git_commit
Created Jul 12, 2017

Embed
What would you like to do?
_git_commit ()
{
case "$prev" in
(-c | -C) __gitcomp_nl "$(__git_refs)" "" "${cur}"
return ;;
(-m) __gitcomp "feat: fix: docs: style: refactor: test: chore:
" "" "${cur}"
return
;;
esac
case "$cur" in
(--message=*) __gitcomp "feat: fix: docs: style: refactor: test: chore:
" "" "${cur##--message=}"
return
;;
--cleanup=*)
__gitcomp "default scissors strip verbatim whitespace
" "" "${cur##--cleanup=}"
return
;;
--reuse-message=*|--reedit-message=*|\
--fixup=*|--squash=*)
__gitcomp_nl "$(__git_refs)" "" "${cur#*=}"
return
;;
--untracked-files=*)
__gitcomp "all no normal" "" "${cur##--untracked-files=}"
return
;;
--*)
__gitcomp "
--all --author= --signoff --verify --no-verify
--edit --no-edit
--amend --include --only --interactive
--dry-run --reuse-message= --reedit-message=
--reset-author --file= --message= --template=
--cleanup= --untracked-files --untracked-files=
--verbose --quiet --fixup= --squash=
"
return
esac
if git rev-parse --verify --quiet HEAD >/dev/null; then
__git_complete_index_file "--committable"
else
# This is the first commit
__git_complete_index_file "--cached"
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.