format-patch: use default email for generating message ids

We try to generate a sane message id for cover letters and threading by appending some changing bits to the front of the user's email address. The current code parses the email out of the results of git_committer_info, but we can do this much more easily by just calling ident_default_email ourselves. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Jeff King committed May 21, 2012 at 19:10 UTC 43ae9f47ab8a7762d914e91d6f57b79126986640
1 file changed +2 -8
builtin/log.c
+2 -8
@@ -737,15 +737,9 @@ static void get_patch_ids(struct rev_info *rev, struct patch_ids *ids, const cha
737
738 static void gen_message_id(struct rev_info *info, char *base)
739 {
740 - const char *committer = git_committer_info(IDENT_WARN_ON_NO_NAME);
741 - const char *email_start = strrchr(committer, '<');
742 - const char *email_end = strrchr(committer, '>');
740 struct strbuf buf = STRBUF_INIT;
744 - if (!email_start || !email_end || email_start > email_end - 1)
745 - die(_("Could not extract email from committer identity."));
746 - strbuf_addf(&buf, "%s.%lu.git.%.*s", base,
747 - (unsigned long) time(NULL),
748 - (int)(email_end - email_start - 1), email_start + 1);
741 + strbuf_addf(&buf, "%s.%lu.git.%s", base,
742 + (unsigned long) time(NULL), ident_default_email());
743 info->message_id = strbuf_detach(&buf, NULL);
744 }
745