From: Stephen Boyd Date: Wed, 16 Jun 2010 05:59:25 GMT Subject: [PATCHv2 1/2] format-patch: Add a signature option (--signature) Message-ID: <1276667966-18422-1-git-send-email-bebarino@gmail.com> In-Reply-To: <1276578039-25023-1-git-send-email-bebarino@gmail.com> By default, git uses the version string as the signature for all patches output by format-patch. Many employers (mine included) require the use of a signature on all outgoing mails. In a format-patch | send-email workflow there isn't an easy way to modify the signature without breaking the pipe and manually replacing the version string with the signature required. Instead of doing all that work, add an option (--signature) and a config variable (format.signature) to replace the default git version signature when formatting patches. This does modify the original behavior of format-patch a bit. First off the version string is now placed in the cover letter by default. Secondly, once the configuration variable format.signature is added to the .config file there is no way to revert back to the default git version signature. Instead, specifying the --no-signature option will remove the signature from the patches entirely. Signed-off-by: Stephen Boyd --- Changes since v1: - Logic to cover empty string case - Documentation updates - Tests for empty string behavior Documentation/config.txt | 6 ++ Documentation/git-format-patch.txt | 7 +++ builtin/log.c | 18 ++++++- ...tch_--stdout_--cover-letter_-n_initial..master^ | 3 + t/t4014-format-patch.sh | 52 ++++++++++++++++++++ 5 files changed, 83 insertions(+), 3 deletions(-) diff --git a/Documentation/config.txt b/Documentation/config.txt index 95cf73c..be6e85d 100644 --- a/Documentation/config.txt +++ b/Documentation/config.txt @@ -880,6 +880,12 @@ format.subjectprefix:: The default for format-patch is to output files with the '[PATCH]' subject prefix. Use this variable to change that prefix. +format.signature:: + The default for format-patch is to output a signature containing + the git version number. Use this variable to change that default. + Set this variable to the empty string ("") to suppress + signature generation. + format.suffix:: The default for format-patch is to output files with the suffix `.patch`. Use this variable to change that suffix (make sure to diff --git a/Documentation/git-format-patch.txt b/Documentation/git-format-patch.txt index 835fb71..c8c81e8 100644 --- a/Documentation/git-format-patch.txt +++ b/Documentation/git-format-patch.txt @@ -13,6 +13,7 @@ SYNOPSIS [--no-thread | --thread[=