Re: git-mailinfo doesn't stop parsing at the end of the header

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Jeff King
Date: Wednesday, November 18, 2009 - 8:51 am

On Wed, Nov 18, 2009 at 03:20:48PM +0100, Philip Hofstetter wrote:


It is not quite "anywhere"; extra headers are respected at the very top
of the message body. This is intentional, to allow one to indicate that
a patch you are sending was authored by somebody else.

So the problem is slightly less severe; the body of your commit message
has to _start_ with "From:". Still, it is awfully ugly to hit a parsing
ambiguity like this when you are trying to do something as simple as
rebase.

Some solutions I can think of are:

  1. Improve the header-finding heuristic to actually look for something
     more sane, like "From:.*<.*@.*>" (I don't recall off the top of my
     head which other headers we handle in this position. Probably
     Date, too).

  2. Give mailinfo a "--strict" mode to indicate that it is directly
     parsing the output of format-patch, and not some random email. Use
     --strict when invoking "git am" via "git rebase".


As I explained above, there is a reason, but I don't think it's rude to
have either of those lines. You were, after all, writing a commit
message, not an email (and even if you were, it is a failure of the
storage format if it can't represent your data correctly). So I think
git is to blame here.

-Peff
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
git-mailinfo doesn't stop parsing at the end of the header, Philip Hofstetter, (Wed Nov 18, 7:20 am)
Re: git-mailinfo doesn't stop parsing at the end of the header, Jeff King, (Wed Nov 18, 8:51 am)
Re: git-mailinfo doesn't stop parsing at the end of the header, Philip Hofstetter, (Wed Nov 18, 10:11 am)
Re: git-mailinfo doesn't stop parsing at the end of the header, Philip Hofstetter, (Wed Nov 18, 12:57 pm)
[PATCH] git am/mailinfo: Don't look at in-body headers whe ..., =?UTF-8?B?THVrYXMgU2 ..., (Wed Nov 18, 3:45 pm)
Re: [PATCH] git am/mailinfo: Don't look at in-body headers ..., Philip Hofstetter, (Wed Nov 18, 4:47 pm)
[PATCH v2] git am/mailinfo: Don't look at in-body headers ..., =?ISO-8859-1?Q?Lukas ..., (Thu Nov 19, 1:51 am)
[PATCH] git am/mailinfo: Don't look at in-body headers whe ..., =?UTF-8?B?THVrYXMgU2 ..., (Fri Nov 20, 9:12 am)