Jeff King [off-list ref] writes:
It does raise a subtle issue, though: should we be trimming whitespace
and other undesirable characters from git_default_email (or
git_default_name)? We don't currently, and it ends up OK because the
result typically is fed through fmt_ident, which cleans it up. But:
1. We do look at the git_default_* variables for things like deciding
whether the name is blank. So if your gecos field was " ", I think
that would fool git into thinking it had something useful, and skip
the IDENT_ERROR_ON_NO_NAME check, even though fmt_ident would
produce an empty name.
2. We don't always feed it through fmt_ident (the http-push.c callsite
I mentioned above, and now patch 6 adds another one).
So I think my preference would be:
- apply the patch below as 5.5/13
- tweak patch 9 to remove the extra trimming
- add a patch 14 to call strbuf_trim on the name and email buffers
after reading them from system files.
Sounds sensible; thanks.