From 3a30aa17879b08f96262abb9a22c7bbe8f56e4c9 Mon Sep 17 00:00:00 2001 From: "brian m. carlson" Date: Tue, 15 Dec 2015 01:52:04 +0000 Subject: format-patch: add an option to suppress commit hash Oftentimes, patches created by git format-patch will be stored in version control or compared with diff. In these cases, two otherwise identical patches can have different commit hashes, leading to diff noise. Teach git format-patch a --zero-commit option that instead produces an all-zero hash to avoid this diff noise. Signed-off-by: brian m. carlson Signed-off-by: Junio C Hamano --- log-tree.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'log-tree.c') diff --git a/log-tree.c b/log-tree.c index 35e780170a..f70a30e127 100644 --- a/log-tree.c +++ b/log-tree.c @@ -342,7 +342,8 @@ void log_write_email_headers(struct rev_info *opt, struct commit *commit, { const char *subject = NULL; const char *extra_headers = opt->extra_headers; - const char *name = oid_to_hex(&commit->object.oid); + const char *name = oid_to_hex(opt->zero_commit ? + &null_oid : &commit->object.oid); *need_8bit_cte_p = 0; /* unknown */ if (opt->total > 0) { -- cgit v1.2.1