magit/git-modes — pull request #30 by tarsius (2013-08-23 22:04:07+00:00)
Title: refactor git-commit-{commit,abort} and related code

Remove option `git-commit-commit-function'. Instead integrate most
of the functionality previously provided by `git-commit-end-session'
(the default value of the former) directory into `git-commit-commit'.

I can see not good reasons why one would want to disable the default
behavior. However it might be necessary to perform some *additional*
action. E.g. when `magit-commit' cannot use emacsclient it needs a
way to tell `git-commit-commit' to actually call `git commit' to that
effect. The new hook `git-commit-commit-hook' is intended for that
purpose.

`git-commit-end-session' also contained some code wrapping around
variable `server-buffer-clients'. Since we use that while aborting
too, create a new function `git-commit-buffer-clients' from that part.

`git-commit-abort' now tells the emacsclient to exit with a non-zero
exit status, previously we had to save an empty file to communicate to
git that the user has decided to abort creating a commit. Thanks to
Dhruva Krishnamurthy who showed me how to do that.

`git-commit-abort' no longer warns that aborting will cause the edited
message to be lost. The option `git-commit-confirm-abort' that allowed
turning that warning of is removed. Instead the buffer text is always
saved to the `kill-ring'. A message is shown in the echo area to inform
the user that this has happened. This has the additional benefit that
the "git exited abnormally with code 1." message is less likely to be
seen by the user.