diff --git a/rc/tools/git.kak b/rc/tools/git.kak index 21b5627b..3398dd2d 100644 --- a/rc/tools/git.kak +++ b/rc/tools/git.kak @@ -25,10 +25,10 @@ declare-option -hidden line-specs git_diff_flags define-command -params 1.. \ -docstring %sh{printf 'git []: git wrapping helper All the optional arguments are forwarded to the git utility -Available commands:\n add\n rm\n blame\n commit\n checkout\n diff\n hide-blame\n hide-diff\n log\n show\n show-diff\n status\n update-diff'} \ +Available commands:\n add\n rm\n blame\n commit\n checkout\n diff\n hide-blame\n hide-diff\n \init\n log\n show\n show-diff\n status\n update-diff'} \ -shell-script-candidates %{ if [ $kak_token_to_complete -eq 0 ]; then - printf "add\nrm\nblame\ncommit\ncheckout\ndiff\nhide-blame\nhide-diff\nlog\nshow\nshow-diff\nstatus\nupdate-diff\n" + printf "add\nrm\nblame\ncommit\ncheckout\ndiff\nhide-blame\nhide-diff\nlog\nshow\nshow-diff\ninit\nstatus\nupdate-diff\n" else case "$1" in commit) printf -- "--amend\n--no-edit\n--all\n--reset-author\n--fixup\n--squash\n"; git ls-files -m ;; @@ -145,6 +145,7 @@ Available commands:\n add\n rm\n blame\n commit\n checkout\n diff\n hide- ' } + commit() { # Handle case where message needs not to be edited if grep -E -q -e "-m|-F|-C|--message=.*|--file=.*|--reuse-message=.*|--no-edit|--fixup.*|--squash.*"; then @@ -189,6 +190,7 @@ Available commands:\n add\n rm\n blame\n commit\n checkout\n diff\n hide- ;; update-diff) update_diff ;; commit) shift; commit "$@" ;; + init) shift; git init "$@" > /dev/null 2>&1 ;; checkout) name="${2:-${kak_buffile}}" git checkout "${name}" > /dev/null 2>&1