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>
This commit is contained in:
brian m. carlson
2015-12-15 01:52:04 +00:00
committed by Junio C Hamano
parent 3e56e7245c
commit 3a30aa1787
5 changed files with 19 additions and 1 deletions

View File

@ -256,6 +256,10 @@ you can use `--suffix=-patch` to get `0001-description-of-my-change-patch`.
using this option cannot be applied properly, but they are
still useful for code review.
--zero-commit::
Output an all-zero hash in each patch's From header instead
of the hash of the commit.
--root::
Treat the revision argument as a <revision range>, even if it
is just a single commit (that would normally be treated as a