[PATCH] git send-email: add --body option for --compose

Previous thread: force a merge conflict by Caleb Cushing on Sunday, November 9, 2008 - 11:09 am. (6 messages)

Next thread: [PATCH (GIT-GUI)] git-gui: Fix focus transition in the blame viewer. by Alexander Gavrilov on Sunday, November 9, 2008 - 11:36 am. (1 message)
To: <spearce@...>
Cc: <git@...>
Date: Sunday, November 9, 2008 - 11:29 am

If the --compose option is specified, --body will allow you to specify a
file that should be included in the message body when the editor starts
up.

Signed-off-by: Joe MacDonald <joe.macdonald@gmail.com>
---
I use --compose with nearly all of my send-email bundles, but
immediately after I enter the editor I read in the contents of another
text file that contains boilerplate text. So I modified
git-send-email.perl to take a new option --body, which takes a filename
as an argument and appends the contents of that file to the standard
text that send-email normally puts into the .msg.$$ (or whatever file is
pointed to by $compose_filename).

I suppose this is even a step closer to having a batch version of
send-email that will include an introduction email in the patch thread,
but I don't know that such a thing is really useful to anyone. It would
be for me, but I might be a special case (or at least a minority) in
that.

git-send-email.perl | 14 +++++++++++++-
1 files changed, 13 insertions(+), 1 deletions(-)

diff --git a/git-send-email.perl b/git-send-email.perl
index 94ca5c8..17120d3 100755
--- a/git-send-email.perl
+++ b/git-send-email.perl
@@ -48,6 +48,7 @@ git send-email [options] <file | directory>...
--subject <str> * Email "Subject:"
--in-reply-to <str> * Email "In-Reply-To:"
--compose * Open an editor for introduction.
+ --body <str> * Initial body for the introduction.

Sending:
--envelope-sender <str> * Email envelope sender.
@@ -156,6 +157,7 @@ my ($smtp_server, $smtp_server_port,
$smtp_authuser, $smtp_encryption);
my ($identity, $aliasfiletype, @alias_files, @smtp_host_parts);
my ($validate);
my (@suppress_cc);
+my ($compose_body);

my %config_bool_settings = (
"thread" => [\$thread, 1],
@@ -222,6 +224,7 @@ my $rc = GetOptions("sender|from=s" => \$sender,
"smtp-encryption=s" => \$smtp_encryption...

Previous thread: force a merge conflict by Caleb Cushing on Sunday, November 9, 2008 - 11:09 am. (6 messages)

Next thread: [PATCH (GIT-GUI)] git-gui: Fix focus transition in the blame viewer. by Alexander Gavrilov on Sunday, November 9, 2008 - 11:36 am. (1 message)