From d7d9c2d04962b5aec34ec891d82dd74262306c56 Mon Sep 17 00:00:00 2001 From: Michael Hendricks Date: Thu, 26 Mar 2009 10:51:05 -0600 Subject: format-patch: add arbitrary email headers format-patch supports the format.headers configuration for adding arbitrary email headers to the patches it outputs. This patch adds support for an --add-header argument which makes the same feature available from the command line. This is useful when the content of custom email headers must change from branch to branch. This patch has been sponsored by Grant Street Group Signed-off-by: Michael Hendricks Signed-off-by: Junio C Hamano --- t/t4014-format-patch.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 't') diff --git a/t/t4014-format-patch.sh b/t/t4014-format-patch.sh index f187d15e32..11061ddd5b 100755 --- a/t/t4014-format-patch.sh +++ b/t/t4014-format-patch.sh @@ -128,6 +128,21 @@ test_expect_success 'additional command line cc' ' grep "^ *S. E. Cipient $" patch5 ' +test_expect_success 'command line headers' ' + + git config --unset-all format.headers && + git format-patch --add-header="Cc: R. E. Cipient " --stdout master..side | sed -e "/^$/q" >patch6 && + grep "^Cc: R. E. Cipient $" patch6 +' + +test_expect_success 'configuration headers and command line headers' ' + + git config --replace-all format.headers "Cc: R. E. Cipient " && + git format-patch --add-header="Cc: S. E. Cipient " --stdout master..side | sed -e "/^$/q" >patch7 && + grep "^Cc: R. E. Cipient ,$" patch7 && + grep "^ *S. E. Cipient $" patch7 +' + test_expect_success 'multiple files' ' rm -rf patches/ && -- cgit v1.2.3