format-patch: do not use bogus email addresses in message ids
authorJeff King <peff@peff.net>
Thu, 24 May 2012 23:32:52 +0000 (19:32 -0400)
committerJunio C Hamano <gitster@pobox.com>
Fri, 25 May 2012 03:50:19 +0000 (20:50 -0700)
We can ask git_committer_info to be strict about coming up
with an email, which will die automatically on a poorly
configured machine. This is better than letting invalid
message-ids into the wild.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/log.c

index d86bca34dd79cc00ac7e0e34929b2a00878626f8..906dca475af0ed51d499cce4a7c0a34f038c5810 100644 (file)
@@ -741,7 +741,7 @@ static void gen_message_id(struct rev_info *info, char *base)
        struct strbuf buf = STRBUF_INIT;
        strbuf_addf(&buf, "%s.%lu.git.%s", base,
                    (unsigned long) time(NULL),
-                   git_committer_info(IDENT_NO_NAME|IDENT_NO_DATE));
+                   git_committer_info(IDENT_NO_NAME|IDENT_NO_DATE|IDENT_STRICT));
        info->message_id = strbuf_detach(&buf, NULL);
 }