commit-mode.el: initial import of git-commit-mode

git-commit-mode [1] is a great mode for editing git commit messages,
but is unfortunately maintained poorly.  Import it into the magit tree
as commit-mode.el (similar to rebase-mode.el), so we can have tighter
magit integration and better maintenance.  Subsequent commits will
modify the file significantly and integrate it into
magit-log-edit-mode.

[1]: https://github.com/rafl/git-commit-mode

Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
commit-mode.el: change git-commit-* to commit-mode-*

Change names of functions and variables in the file to reflect the
fact that it's now commit-mode.el, not git-commit.el.

Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
commit-mode.el: remove git-define-git-commit macro

As opposed to git-define-commit-mode-self, which just uses the current
user's name and email, this macro prompts for a name and email on the
minibuffer.  This is unnecessary, as the user is perfectly capable of
editing text after it is filled into the buffer.  Also migrate its
callers to use git-define-commit-mode-self.

While at it, give git-define-commit-self a more sensible name:
commit-mode-define-header.

Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
commit-mode.el: loop is now cl-loop, needs cl-lib

Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
commit-mode.el: derive magit-log-edit-mode from commit-mode

This practically means that we get the face highlighting and
keybindings from commit-mode.  The first caveat is that "C-c C-s" and
"C-c C-a" are redefined by magit-log-edit-mode-map.  The other caveat
is that a Magit header breaks all the face highlighting.  We plan to
fix these problems in future patches.

Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
commit-mode.el: remove commit-mode-commit

Since we assume that editing is happening in a server (like in
rebase-mode.el), we can replace the call to commit-mode-commit with a
simple server-edit.

Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
commit-mode.el: remove redundant function proxy

Strip the suffix from commit-mode-font-lock-keywords-1.

Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
commit-mode.el: remove session.el integration

Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
commit-mode.el: use define-derived-mode appropriately

commit-mode is defined using a defun, and does a lot of things by
hand.  Use define-derived-mode instead, and remove these hacks.

Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
magit.el: factor out a magit-log-header-re

We're doing this so we can match it in commit-mode.el in a future
patch.

Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
commit-mode.el: handle the magit header properly

Match magit-log-header-re, and give it a preprocessor face.  Then, add
a matcher for the summary that doesn't assume that it begins at the
beginning-of-buffer.

Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>