diff options
author | brian m. carlson <sandals@crustytoothpaste.net> | 2015-12-15 01:52:04 +0000 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2015-12-15 10:03:40 -0800 |
commit | 3a30aa17879b08f96262abb9a22c7bbe8f56e4c9 (patch) | |
tree | ace01289693a796bfb19661e6ed78d1b81381859 /t/t4014-format-patch.sh | |
parent | 3e56e7245c37ce57dde72ec74ee2df41ce603dda (diff) | |
download | git-3a30aa17879b08f96262abb9a22c7bbe8f56e4c9.tar.gz |
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 <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t4014-format-patch.sh')
-rwxr-xr-x | t/t4014-format-patch.sh | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/t/t4014-format-patch.sh b/t/t4014-format-patch.sh index 890db1174f..2737ca6346 100755 --- a/t/t4014-format-patch.sh +++ b/t/t4014-format-patch.sh @@ -1431,4 +1431,11 @@ test_expect_success 'cover letter auto user override' ' test_line_count = 2 list ' +test_expect_success 'format-patch --zero-commit' ' + git format-patch --zero-commit --stdout v2..v1 >patch2 && + grep "^From " patch2 | sort | uniq >actual && + echo "From $_z40 Mon Sep 17 00:00:00 2001" >expect && + test_cmp expect actual +' + test_done |