Don't fail if "git config" does not support the --local option.

Matthieu Moy points out that older versions of git do not support the
--local option.  Try to work around its possible absence: if the call
to "git config --local" fails, then try again without "--local".  If
the second command indicates that the section is empty, then the local
version of the section is definitely empty, so delete it.

This might result in not deleting an empty local section (e.g., if
there is a non-empty global section with the same name), but that's
only a cosmetic problem.
Merge branch 'dont-require-config-local'

* Don't fail if "git config" does not support the --local option.
Avoid creation of redundant SMTP connection.

This line was a leftover from an earlier version of commit
ebe512aa42.
Rename HEADER_TEMPLATE to REFCHANGE_HEADER_TEMPLATE.
Split up HEADER_TEMPLATES.

Split *_HEADER_TEMPLATE into *_HEADER_TEMPLATE and *_INTRO_TEMPLATE,
where the former contains only the email header lines and the latter
contains the text forming the beginning of the email body.  This (1)
will make it easier to handle the email headers in a more RFC
2822-compliant manner, and (2) is a better division for users who
might want to customize one or the other.
Configure a from address for the test repository.
Split off method Change.generate_email_intro().

Analogous to what was just done for the HEADER_TEMPLATES, split up
Change.generate_email_header() into generate_email_header() and
generate_email_intro().
Simplify logic for setting ConfigEnvironment.fromaddr.
Expand header lines and body lines differently.

Only silently skip lines containing unknown variables references when
expanding header lines.  When expanding body lines, make it an error
if there to be an unknown variable reference.
Merge branch 'non-ascii-header' into header-handling

If a header contains non-ASCII characters, assume that it is UTF-8 and
encode it appropriately for an email header.

Conflicts:
	git-multimail/git_multimail.py
Properly handle header lines that are too long.

If a header line is too long, email.header.Header.encode() splits it
into multiple lines with proper line continuation characters.  Since
later code expects to receive lines one at a time, such lines need to
be re-split and yielded one by one.  The easiest way to do that is to
move the encoding functionality into Change.expand_header_lines(),
where (1) we can split the lines into name and value *before*
expansion and (2) we can emit as many lines as we want.  Also tell the
Header instance the name of the header so that it can account for that
length when splitting the first line.
Introduce and use read_git_output and read_git_lines

This allows building the git command in only one place of the script,
which makes it easy to add global options or change the name of the
Git executable without going through the whole script (either for users
needing to tweak the script or for future upstream code change).

Formatting tweaked by: Michael Haggerty
Add multimailhook.maxCommitEmails, to avoid accidental mailbombing

With minor tweaks by Michael Haggerty.
Add an idea to the list.
Add item to ideas list.

We've had a few cases of people accidentally adding more commits to a
branch than they wanted; for example, by merging from a branch
sprouted from master into a maintenance branch.  If they had seen that
they were adding many hundreds of commits to the maintenance branch,
they would have hopefully noticed the problem right away and been able
to fix it.  The git-multimail script already knows what commits are
being added by a push; perhaps there should be an option to output
this information to the pusher.
Merge branch 'various-improvements-v2'

* A few internal code improvements.

* Add maxCommitEmails configuration setting.

Conflicts:
	notes.txt
Merge branch 'header-handling'

Handle email headers separately from the email body and treat them in
a more RFC 2822-conforming way:

* Split the HEADER_TEMPLATEs into *_HEADER_TEMPLATE and
  *_INTRO_TEMPLATE

* Extract a method Change.generate_email_intro().

* Only silently ignore unknown expansion values in header lines (not
  in the body).

* Encode non-ASCII characters that appear in the email headers.

* Split header lines that are too long.
Introduce skipRefs and onlyRefs to limit the scope of the hook