From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Boyd Subject: [PATCHv2 1/2] format-patch: Add a signature option (--signature) Date: Tue, 15 Jun 2010 22:59:25 -0700 Message-ID: <1276667966-18422-1-git-send-email-bebarino@gmail.com> References: <1276578039-25023-1-git-send-email-bebarino@gmail.com> Cc: Junio C Hamano To: git@vger.kernel.org X-From: git-owner@vger.kernel.org Wed Jun 16 07:59:39 2010 connect(): No such file or directory Return-path: Envelope-to: gcvg-git-2@lo.gmane.org Received: from vger.kernel.org ([209.132.180.67]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1OOlf0-000813-Q9 for gcvg-git-2@lo.gmane.org; Wed, 16 Jun 2010 07:59:39 +0200 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755657Ab0FPF7b (ORCPT ); Wed, 16 Jun 2010 01:59:31 -0400 Received: from mail-vw0-f46.google.com ([209.85.212.46]:64853 "EHLO mail-vw0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755500Ab0FPF7a (ORCPT ); Wed, 16 Jun 2010 01:59:30 -0400 Received: by vws13 with SMTP id 13so2242668vws.19 for ; Tue, 15 Jun 2010 22:59:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:cc:subject:date :message-id:x-mailer:in-reply-to:references; bh=h6mzgM9A+jvvIt3Maj7HcfqXWpn2kMbl2Pt1pVsJdkI=; b=VvTC1rSoCNw5jkO2K/taYk2zmlIJm62PAr9nFD3l6kU7q70m5JOez+25KYiWoMsvMH 9UrZHB35qRsKgpVsFDQRgPCDRmEkbVxpJ2B4SPsL04ymLOMKuGrDC1QZk1cPmJVo5Yb+ ci9ev3qHZuOmuaBkc9AdozT+yzudNIabAPpOc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; b=d9VOubHQT2UphY6Gvwm4JCUa8m82J8vshYGJufTtPg19vfvO/gf81m9U9FUiui8ZfT dkxQMs0HvpaEeyG6mRuIWllTMesxswuDe+8llJuSOqH881KSXlHej3hDbpBMQ37l13w1 oItm8xNvbDxzIgvvt8+QASGtEU3q8yCOqo54E= Received: by 10.220.126.197 with SMTP id d5mr4629032vcs.29.1276667969518; Tue, 15 Jun 2010 22:59:29 -0700 (PDT) Received: from localhost ([24.152.169.138]) by mx.google.com with ESMTPS id w29sm6982889vcr.2.2010.06.15.22.59.28 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 15 Jun 2010 22:59:28 -0700 (PDT) X-Mailer: git-send-email 1.7.1.257.g678728 In-Reply-To: <1276578039-25023-1-git-send-email-bebarino@gmail.com> Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Archived-At: 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[=