Fix user tutorial POD

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

Signed-off-by: Gustavo L. de M. Chaves <gnustavo@cpan.org>
New module Git::More::Message

This new class represents a Git commit message. Generally speaking, a
commit message can be any string whatsoever. However, the Git
community came up with a few conventions for how to best format a
message and this class embraces those conventions making it easier for
you to validate and change a commit message structure.

With it the Git::Hooks::CheckLog and Git::Hooks::GerritChangeId
plugins were reimplemented and simplified.

The Git::More class implements two new methods:

- read_commit_msg_file: that reads the contents of a file, respecting
  the i18n.commitencoding config option, and returns its contents
  stripspaced.

- write_commit_msg_file: that writes a string to a file respecting the
  i18n.commitencoding config option.

Signed-off-by: Gustavo L. de M. Chaves <gnustavo@cpan.org>
Support new pre-push hook

The pre-push is a new hook implemented by Git 1.8.2 which is invoked
during a "git push" command.

It's one of the three hooks (the other two being the pre-receive and
the post-receive) that receive information from STDIN, so that they
have to be treated specially. In the case of pre-push, the STDIN is
read and parsed, and the information is passed to the hooks via a Perl
data structure to make it easier for the hook implementers.

Signed-off-by: Gustavo L. de M. Chaves <gnustavo@cpan.org>
Refactor to simplify complex routine

Perl::Critic was dissatisfied with the complexity of the
spawn_external_file routine. This refactors it and change its name for
no good reason.

Signed-off-by: Gustavo L. de M. Chaves <gnustavo@cpan.org>
Unify STDIN treatment for hooks

Four hooks get data from STDIN: pre-receive, post-receive, pre-push,
and post-rewrite. This commit unifies the way STDIN is grokked by
them.

The Git::More class has two new methods to make this data available:
push_input_data and get_input_data.

This way we do not need to fake extra arguments for the hooks, which
avoids compatibility problems in the future if some of them get extra
arguments from Git itself.

In particular, the pre-push hook, which was recently implemented,
doesn't get the faked 'push-specs' argument anymore.

Signed-off-by: Gustavo L. de M. Chaves <gnustavo@cpan.org>
Process STDIN for post-rewrite hook

The post-rewrite hook receives information from STDIN much like the
pre-push, pre-receive, and post-receive hooks. It wasn't being
processed by an oversight.

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

  [New features]
  - Support the new pre-push hook, implemented by Git 1.8.2 which is
    invoked during a "git push" command.

  - New class Git::More::Message, representing a Git commit
    message. Generally speaking, a commit message can be any string
    whatsoever. However, the Git community came up with a few
    conventions for how to best format a message and this class
    embraces those conventions making it easier for you to validate
    and change a commit message structure. With it the
    Git::Hooks::CheckLog and Git::Hooks::GerritChangeId plugins were
    much simplified.

  - New method Git::More::read_commit_msg_file that reads the contents
    of a file, respecting the i18n.commitencoding config option, and
    returns its contents stripspaced.

  - New method Git::More::write_commit_msg_file that writes a string
    to a file respecting the i18n.commitencoding config option.

  - New methods Git::More::push_input_data and
    Git::More::get_input_data to unify the treatment of data read from
    STDIN by the hooks pre-receive, post-receive, pre-push, and
    post-rewrite.

  [Fixes]
  - The data passed to the post-rewrite hook via STDIN wasn't being
    processed.