Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8CDBDCDB47E for ; Thu, 12 Oct 2023 13:07:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1378390AbjJLNHT (ORCPT ); Thu, 12 Oct 2023 09:07:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56052 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343765AbjJLNHR (ORCPT ); Thu, 12 Oct 2023 09:07:17 -0400 Received: from imap4.hz.codethink.co.uk (imap4.hz.codethink.co.uk [188.40.203.114]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EAED191 for ; Thu, 12 Oct 2023 06:07:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=codethink.co.uk; s=imap4-20230908; h=Sender:Content-Transfer-Encoding: Content-Type:In-Reply-To:From:References:To:Subject:MIME-Version:Date: Message-ID:Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From :Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=H9I2IRsNhHtbd3HBBtpiGfxHwgjx/M8oepVjALMSFJk=; b=jvC0OX0XppVpXnJVjHBleIgU1K dNpIJ/g88W0VHSx5uM7KwZzr6+t5dKBFrNRMWUPZzINNN9A182JkkbTJNcMLrWj3VTCTfoBgeYfK1 RD0SHFAEL1KLrrAWo8XrrZWyxrzRoXNYS/krmtmaObZDobGoVwsDAMf+88yFAwsJ37MwXUi5uYOrG YsLQyZOnD9nq3RkVE4Tah25d4I/hNcEZQqmW+YDkaHHgehub74fI8Kl8i0DlmMCMToDkIw7AJU+No pZLJljMw44yzdrm+H9yRmwzdYJ+rV+bYiSpmFGW6aniR+uzkgq4XkaqlfErKMxPopptIdVcZcu1tA W6KsEuRw==; Received: from [63.135.74.212] (helo=[192.168.1.184]) by imap4.hz.codethink.co.uk with esmtpsa (Exim 4.94.2 #2 (Debian)) id 1qqvPE-000Tws-Ku; Thu, 12 Oct 2023 14:07:12 +0100 Message-ID: <21893610-73d8-4405-a7ea-823b750354fa@codethink.co.uk> Date: Thu, 12 Oct 2023 14:07:11 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] send-email: add --compose-cover option Content-Language: en-GB To: git@vger.kernel.org, gitster@pobox.com References: <20231012112743.2756259-1-ben.dooks@codethink.co.uk> From: Ben Dooks Organization: Codethink Limited. In-Reply-To: <20231012112743.2756259-1-ben.dooks@codethink.co.uk> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Sender: ben.dooks@codethink.co.uk Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org On 12/10/2023 12:27, Ben Dooks wrote: > Adding an option to automatically compose a cover letter would be > helpful to put the whole process of sending an series with a cover > into one command. > > Signed-off-by: Ben Dooks > --- > Documentation/git-send-email.txt | 5 +++++ > git-send-email.perl | 11 ++++++++++- > 2 files changed, 15 insertions(+), 1 deletion(-) > > diff --git a/Documentation/git-send-email.txt b/Documentation/git-send-email.txt > index 41cd8cb424..f299732867 100644 > --- a/Documentation/git-send-email.txt > +++ b/Documentation/git-send-email.txt > @@ -78,6 +78,11 @@ Missing From or In-Reply-To headers will be prompted for. > + > See the CONFIGURATION section for `sendemail.multiEdit`. > > +--compose-cover:: > + Invoke a text editor (see GIT_EDITOR in linkgit:git-var[1]) > + to edit a cover letter generated by passing --cover-letter to > + git-send-email before invoking the editor. > + OOPS, clearly meant git-format-patch here, not git-send-email. > --from=
:: > Specify the sender of the emails. If not specified on the command line, > the value of the `sendemail.from` configuration option is used. If > diff --git a/git-send-email.perl b/git-send-email.perl > index 5861e99a6e..debec088f6 100755 > --- a/git-send-email.perl > +++ b/git-send-email.perl > @@ -54,6 +54,7 @@ sub usage { > --in-reply-to * Email "In-Reply-To:" > --[no-]xmailer * Add "X-Mailer:" header (default). > --[no-]annotate * Review each patch that will be sent in an editor. > + --compose-cover * Open an editor on format-patch --cover-letter > --compose * Open an editor for introduction. > --compose-encoding * Encoding to assume for introduction. > --8bit-encoding * Encoding to assume 8bit mails if undeclared > @@ -199,7 +200,7 @@ sub format_2822_time { > # Variables we fill in automatically, or via prompting: > my (@to,@cc,@xh,$envelope_sender, > $initial_in_reply_to,$reply_to,$initial_subject,@files, > - $author,$sender,$smtp_authpass,$annotate,$compose,$time); > + $author,$sender,$smtp_authpass,$annotate,$compose_cover,$compose,$time); > # Things we either get from config, *or* are overridden on the > # command-line. > my ($no_cc, $no_to, $no_bcc, $no_identity); > @@ -512,6 +513,7 @@ sub config_regexp { > "no-smtp-auth" => sub {$smtp_auth = 'none'}, > "annotate!" => \$annotate, > "no-annotate" => sub {$annotate = 0}, > + "compose-cover" => \$compose_cover, > "compose" => \$compose, > "quiet" => \$quiet, > "cc-cmd=s" => \$cc_cmd, > @@ -782,6 +784,9 @@ sub is_format_patch_arg { > die __("Cannot run git format-patch from outside a repository\n") > unless $repo; > require File::Temp; > + if ($compose_cover) { > + push @rev_list_opts, "--cover-letter"; > + } > push @files, $repo->command('format-patch', '-o', File::Temp::tempdir(CLEANUP => 1), @rev_list_opts); > } > > @@ -854,6 +859,8 @@ sub get_patch_subject { > > if ($annotate) { > do_edit($compose_filename, @files); > + } elsif ($compose_cover) { > + do_edit($files[0]); > } else { > do_edit($compose_filename); > } > @@ -927,6 +934,8 @@ sub get_patch_subject { > > } elsif ($annotate) { > do_edit(@files); > +} elsif ($compose_cover) { > + do_edit($files[0]); > } > > sub term { -- Ben Dooks http://www.codethink.co.uk/ Senior Engineer Codethink - Providing Genius https://www.codethink.co.uk/privacy.html