summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 7a2a0d2)
raw | patch | inline | side by side (parent: 7a2a0d2)
author | Junio C Hamano <junkio@cox.net> | |
Sat, 7 Oct 2006 10:09:05 +0000 (03:09 -0700) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Sun, 8 Oct 2006 06:37:15 +0000 (23:37 -0700) |
Earlier we insisted that mbox file to begin with "From ". That
is fine as long as you feed format-patch output, but if you
handcraft the input file, this is unnecessary burden. We should
detect lines that look like e-mail headers and say that is also
a mbox file.
The other input file format is traditional "send lots of email",
whose first line would never look like e-mail headers, so this
is a safe change.
The original patch was done by Matthew Wilcox, which checked
explicitly for headers the script pays attention to.
Signed-off-by: Junio C Hamano <junkio@cox.net>
is fine as long as you feed format-patch output, but if you
handcraft the input file, this is unnecessary burden. We should
detect lines that look like e-mail headers and say that is also
a mbox file.
The other input file format is traditional "send lots of email",
whose first line would never look like e-mail headers, so this
is a safe change.
The original patch was done by Matthew Wilcox, which checked
explicitly for headers the script pays attention to.
Signed-off-by: Junio C Hamano <junkio@cox.net>
git-send-email.perl | patch | blob | history |
diff --git a/git-send-email.perl b/git-send-email.perl
index 21b3686b2c94740fac030624dc2eefeda82617da..eb91270898fe3e961cea626e5e43be85a08ba51d 100755 (executable)
--- a/git-send-email.perl
+++ b/git-send-email.perl
my $author_not_sender = undef;
@cc = @initial_cc;
@xh = ();
- my $found_mbox = 0;
+ my $input_format = undef;
my $header_done = 0;
$message = "";
while(<F>) {
if (!$header_done) {
- $found_mbox = 1, next if (/^From /);
+ if (/^From /) {
+ $input_format = 'mbox';
+ next;
+ }
chomp;
+ if (!defined $input_format && /^[-A-Za-z]+:\s/) {
+ $input_format = 'mbox';
+ }
- if ($found_mbox) {
+ if (defined $input_format && $input_format eq 'mbox') {
if (/^Subject:\s+(.*)$/) {
$subject = $1;
# line 1 = cc
# line 2 = subject
# So let's support that, too.
+ $input_format = 'lots';
if (@cc == 0) {
printf("(non-mbox) Adding cc: %s from line '%s'\n",
$_, $_) unless $quiet;