diff --git a/git-emacs.el b/git-emacs.el index 32a6618..f19f37d 100644 --- a/git-emacs.el +++ b/git-emacs.el @@ -1200,6 +1200,8 @@ commit, like git commit --amend will do once we commit." "# Date : " (git--today) "\n"))) ;; Internal variables for commit +(defvar git--commit-before-hook nil + "Hooks to run before comitting the commit buffer.") (defvar git--commit-after-hook nil "Hooks to run after comitting (and killing) the commit buffer.") (defvar git--commit-args nil @@ -1225,6 +1227,9 @@ Trim the buffer log, commit runs any after-commit functions." git--commit-log-buffer) (error "Execute git commit on %s buffer" git--commit-log-buffer)) + ;; hooks (e.g. code check) + (run-hooks 'git--commit-before-hook) + ;; trail and commit (save-excursion (goto-char (point-min))