Make publish-pre-send-email hook work with single patch emails

The publish-pre-send-email example hook script assumed a patch series
with a cover letter is being sent.  When there is a single patch email
with no cover letter it would fail to match the .patch filename.

Perform checks on the lexicographically first filename (0000-*.patch or
0001-*.patch).

Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
Add --suppress-cc option like git-send-email(1)

The git-send-email(1) --suppress-cc option disables auto-cc on emails.
Pass it through when calling git-send-email(1).

Suggested-by: John Snow <jsnow@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
Use git-var(1) to fetch GIT_EDITOR

Invoke "git var GIT_EDITOR" instead of duplicating its logic.

Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
Launch editor for --annotate before invoking hook

Do not use git-send-email(1) --annotate because the
publish-pre-send-email hook must run after the user has had a chance to
annotate their mail.

Invoke the editor manually on the emails that git-format-patch(1) has
produced.

Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
Add support for git-config(1) list variables

It is possible to store lists using git-config(1) --add.  Make sure to
fetch and store lists.

Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
Persist --to and --cc options to save typing

Store the --to and --cc options so the user does not need to put them on
the command-line for each revision.

  $ git publish --to foo@example.org
  $ ...work on v2...
  $ git publish # sends to foo@example.org!

Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
Add --profile <profile-name> option

Profiles specify default values for settings.  Command-line options and
per-branch git-config(1) options override profile settings.

See the README.rst changes for documentation on profiles.

Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>