Config.get(): default to None by default, not the empty string.

In most cases, callers explicitly set the default to None anywayf, and
None is also more consistent with Python dicts.

Suggested by: Ramkumar Ramachandra <artagnon@gmail.com>
Add a comment explaining what retcode==1 from "git config --get-all" means.

Suggested by: Ramkumar Ramachandra <artagnon@gmail.com>
Discard end-of-line characters when splitting header template into lines.

This makes it unnecessary to strip them off later using rstrip().

Suggested by: Ramkumar Ramachandra <artagnon@gmail.com>
Look in two places for the sendmail program.

If the sendmail command is not configured explicitly, then look at
paths /usr/sbin/sendmail or /usr/lib/sendmail and use the first one
that is present and executable.

Suggested by: Ramkumar Ramachandra <artagnon@gmail.com>
Fix error message if get_git_dir() fails.

Pointed out by: Ramkumar Ramachandra <artagnon@gmail.com>
Merge branch 'ram-comments'

Incorporate a bunch of changes suggested by Ramkumar Ramachandra in a
code review on the Git mailing list.