threads / bug / 12744

bug in git-send-mail (the 'next' branch)

Subject: bug in git-send-mail (the 'next' branch)

## tl;dr

3 messages between Mar 18, 2008 and Mar 19, 2008.

replies: 2people: 3as markdown or json

Yakov Lerner· Mar 18, 2008, 13:52 UTC · lore

There is a bug in git-send-mail in the 'next' branch. If first paragraph of the file in all indented by 1 space, and 1st line of the paragraph is at the first line of the file, then the whole paragraph disappears silently. If it's intentional, there should be a warning or something. And If it's *not* indented (as if it expects message header lines at this place), then it appears in the message body, so there is some inconsistency here.

Yakov
Jakub Narebski· Mar 18, 2008, 15:55 UTC · re: Yakov Lerner · lore

Re: bug in git-send-mail (the 'next' branch)

"Yakov Lerner" <iler.ml@gmail.com> writes:
Show 7 quoted lines
> There is a bug in git-send-mail in the 'next' branch. If first
> paragraph of the file in all indented by 1 space, and 1st line of the
> paragraph is at the first line of the file, then the whole
> paragraph disappears silently. If it's intentional, there should be a warning
> or something. And If it's *not* indented (as if it expects message
> header lines at this place), then it appears in the message body, so
> there is some inconsistency here.

I guess that this bug is in "header flowing" code; headers in email message can span multiple lines by some use of indenting. That is where one can search for the source of this bug...

-- 
Jakub Narebski
Poland
ShadeHawk on #git
Frank Lichtenheld· Mar 19, 2008, 08:03 UTC · re: Yakov Lerner · lore

Re: bug in git-send-mail (the 'next' branch)

On Tue, Mar 18, 2008 at 03:52:58PM +0200, Yakov Lerner wrote:
Show 7 quoted lines
> There is a bug in git-send-mail in the 'next' branch. If first
> paragraph of the file in all indented by 1 space, and 1st line of the
> paragraph is at the first line of the file, then the whole
> paragraph disappears silently. If it's intentional, there should be a warning
> or something. And If it's *not* indented (as if it expects message
> header lines at this place), then it appears in the message body, so
> there is some inconsistency here.

If the first line of the file doesn't match either /^From / or /^[-A-Za-z]+:\s/ send-email assumes the file is using the legacy format from the original send_lots_of_email.pl script which is apparently "first line of the message is who to CC, and second line is the subject of the message." (comment from source code). The code doesn't use only the first two lines but eats everything up the first whitespace line. Which explains the behaviour you have seen.

There are a few things that could be fixed here:
1) Document the file formats this script expects in the man page. It
   doesn't talk about this at all atm.
2) Fix the legacy format support to only use the first two lines and
   warn/die if there is no whitespace line after that
3) Warn if the first line looks neither like a email header nor a
   email address
4) Perhaps in the future at some point deprecate the legacy support
   (1.6.0?)
Gruesse,
-- 
Frank Lichtenheld <frank@lichtenheld.de>
www: http://www.djpig.de/

← back to recent threads