Get rid of any newline inside BAIL_OUT messages

The BAIL_OUT function can't show a message with newlines inside. So,
we have to make sure to get rid of any.

This is to make sense of errors like this:
http://cpantesters.org/cpan/report/bdb7aa9c-6d3d-11e2-a312-f85d9f11b563.

Signed-off-by: Gustavo L. de M. Chaves <gnustavo@cpan.org>
Fix all POD links

I didn't know about the TEXT in L<TEXT|LINK> tag syntax. Now I've
converted every link in the POD documentation.

Signed-off-by: Gustavo L. de M. Chaves <gnustavo@cpan.org>
Improve comments

Signed-off-by: Gustavo L. de M. Chaves <gnustavo@cpan.org>
Git::Hooks: refactor argument preparation

This substitutes a named routine for an anonymous one, just to make
the code clearer.

Also, I'm passing the argument-array by reference in order to make it
faster when we start to support Gerrit's hooks later, since they
receive lots of arguments.

Signed-off-by: Gustavo L. de M. Chaves <gnustavo@cpan.org>
Collect all errors during hook processing

Now, the Git::More::error method collects all error messages submitted
to it in a list and make them available through the new
Git::More::get_errors method.

This allows the Git::Hooks::run_hook routine to avoid having to count
the errors, because it can simply invoke Git::More::get_errors at the
end to know how many have occurred.

Moreover, this will make it possible later on to have a
post-processing phase where all collected error messages are sent as a
whole to some place besides STDERR.

Signed-off-by: Gustavo L. de M. Chaves <gnustavo@cpan.org>
Support Gerrit's pre-update and patchset-created hooks

Gerrit (http://gerrit.googlecode.com/) is a web-based code review
system which incorporates a Git server implemented with JGit
(http://www.eclipse.org/jgit/), which is a pure Java implementation
of Git.

Up to version 2.2.0 JGit still doesn't support Git standard
hooks. However, Gerrit implements its own special hooks
(https://gerrit.googlesource.com/gerrit/+/master/Documentation/config-hooks.txt),
which are rather different from Git's.

Here we implement support for two of Gerrit's hooks:

* ref-update

The 'ref-update' hook is executed synchronously when a user performs a
push to a real brach and not to one of Gerrit's virtual branches
(refs/for/*). It's purpose is the same as Git's 'update' hook and
Git::Hooks's plugins support them both together.

* patchset-created

The 'patchset-created' hook is executed asynchrounously when a user
performs a push to one of Gerrit's virtual branches (refs/for/*) in
order to record a new review request. This means that one cannot stop
the request from happening just by dying inside the hook. Instead,
what one needs to do is to invoke one of Gerrit's commands to accept
or reject the new review request.

In order to support this hook Git:Hooks now implements a general way
for hooks to invoke a routine after all normal hooks have been
processed. This way, the routine can see if there was any problem and
invoke the appropriate Gerrit command to review the patchset
appropriately.

Signed-off-by: Gustavo L. de M. Chaves <gnustavo@cpan.org>