Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
send-email: use lexical filehandles for $compose
author
Ævar Arnfjörð Bjarmason
<avarab@gmail.com>
Thu, 30 Sep 2010 13:42:55 +0000
(13:42 +0000)
committer
Junio C Hamano
<gitster@pobox.com>
Thu, 30 Sep 2010 19:20:32 +0000
(12:20 -0700)
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.comReviewed-by: Avery Pennarun <apenwarr@gmail.com>
Reviewed-by: Jeff King <peff@peff.net>
>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
git-send-email.perl
patch
|
blob
|
history
raw
|
patch
|
inline
| side by side (parent:
c603816
)
diff --git
a/git-send-email.perl
b/git-send-email.perl
index 2f18d83074b70a7ed31b6ce4fe07d5d0c48afcb3..634835c8377fb6524377ca5ae9bc479484296ce6 100755
(executable)
--- a/
git-send-email.perl
+++ b/
git-send-email.perl
@@
-567,7
+567,7
@@
($)
$compose_filename = ($repo ?
tempfile(".gitsendemail.msg.XXXXXX", DIR => $repo->repo_path()) :
tempfile(".gitsendemail.msg.XXXXXX", DIR => "."))[1];
$compose_filename = ($repo ?
tempfile(".gitsendemail.msg.XXXXXX", DIR => $repo->repo_path()) :
tempfile(".gitsendemail.msg.XXXXXX", DIR => "."))[1];
- open
(C,">",$compose_filename)
+ open
my $c, ">", $compose_filename
or die "Failed to open for writing $compose_filename: $!";
or die "Failed to open for writing $compose_filename: $!";
@@
-575,7
+575,7
@@
($)
my $tpl_subject = $initial_subject || '';
my $tpl_reply_to = $initial_reply_to || '';
my $tpl_subject = $initial_subject || '';
my $tpl_reply_to = $initial_reply_to || '';
- print
C
<<EOT;
+ print
$c
<<EOT;
From $tpl_sender # This line is ignored.
GIT: Lines beginning in "GIT:" will be removed.
GIT: Consider including an overall diffstat or table of contents
From $tpl_sender # This line is ignored.
GIT: Lines beginning in "GIT:" will be removed.
GIT: Consider including an overall diffstat or table of contents
@@
-588,9
+588,9
@@
($)
EOT
for my $f (@files) {
EOT
for my $f (@files) {
- print
C
get_patch_subject($f);
+ print
$c
get_patch_subject($f);
}
}
- close
(C)
;
+ close
$c
;
if ($annotate) {
do_edit($compose_filename, @files);
if ($annotate) {
do_edit($compose_filename, @files);
@@
-598,23
+598,23
@@
($)
do_edit($compose_filename);
}
do_edit($compose_filename);
}
- open
(C2,">",$compose_filename . ".final")
+ open
my $c2, ">", $compose_filename . ".final"
or die "Failed to open $compose_filename.final : " . $!;
or die "Failed to open $compose_filename.final : " . $!;
- open
(C,"<",$compose_filename)
+ open
$c, "<", $compose_filename
or die "Failed to open $compose_filename : " . $!;
my $need_8bit_cte = file_has_nonascii($compose_filename);
my $in_body = 0;
my $summary_empty = 1;
or die "Failed to open $compose_filename : " . $!;
my $need_8bit_cte = file_has_nonascii($compose_filename);
my $in_body = 0;
my $summary_empty = 1;
- while(<
C
>) {
+ while(<
$c
>) {
next if m/^GIT:/;
if ($in_body) {
$summary_empty = 0 unless (/^\n$/);
} elsif (/^\n$/) {
$in_body = 1;
if ($need_8bit_cte) {
next if m/^GIT:/;
if ($in_body) {
$summary_empty = 0 unless (/^\n$/);
} elsif (/^\n$/) {
$in_body = 1;
if ($need_8bit_cte) {
- print
C
2 "MIME-Version: 1.0\n",
+ print
$c
2 "MIME-Version: 1.0\n",
"Content-Type: text/plain; ",
"charset=UTF-8\n",
"Content-Transfer-Encoding: 8bit\n";
"Content-Type: text/plain; ",
"charset=UTF-8\n",
"Content-Transfer-Encoding: 8bit\n";
@@
-639,10
+639,10
@@
($)
print "To/Cc/Bcc fields are not interpreted yet, they have been ignored\n";
next;
}
print "To/Cc/Bcc fields are not interpreted yet, they have been ignored\n";
next;
}
- print
C
2 $_;
+ print
$c
2 $_;
}
}
- close
(C)
;
- close
(C2)
;
+ close
$c
;
+ close
$c2
;
if ($summary_empty) {
print "Summary email is empty, skipping it\n";
if ($summary_empty) {
print "Summary email is empty, skipping it\n";