git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [RFC/PATCH] mailinfo: do not treat ">From" lines as in-body headers

From
Jeff King <peff@peff.net>
Date
Sep 16, 2014, 00:19 UTC
Message-ID
<20140916001948.GC5019@peff.net>
In-Reply-To
<xmqq1trc63o8.fsf@gitster.dls.corp.google.com>
On Mon, Sep 15, 2014 at 01:15:35PM -0700, Junio C Hamano wrote:
Show 6 quoted lines
> > If we only want to skip ">?From" in pasted format-patch output, we
> > would want a rule in mailinfo that is tighter than is_from_line() in
> > mailsplit.
> 
> That is, something like this on top of your patch.  Or is this a bit
> too strict?

The only cases that I can think of that would be a problem with this strictness are:

  1. Somebody writes format-patch output to a file, reads in the mbox
     using another program, and then writes out the result (munging the
     mbox From line). And then pastes the whole thing into their email
     body.
     I can see the first part happening. But given that it is totally
     irrelevant _unless_ they then screw up and paste the From line in
     the body (which is already a corner case), it probably doesn't
     matter.
  2. We change the static From lines that git generates. We can always
     update the parser, of course, but it may be running a different
     version of git than the sender.  People with an old git running
     "git am" would stop skipping past "From" lines in messages from
     people on newer gits.

Again, this eating of the in-body "From" line is already a corner case, so it's not the end of the world if it breaks in a few cases. But I'd also be fine with just leaving it looser.

Show 6 quoted lines
>  Makefile            |  1 +
>  builtin/mailinfo.c  |  3 ++-
>  builtin/mailsplit.c |  1 +
>  cache.h             |  6 ------
>  mbox.c              | 15 +++++++++++++++
>  5 files changed, 19 insertions(+), 7 deletions(-)

I think you forgot to "git add" mbox.h. That being said, if we did go this route, I do not see any reason to share the code at all. This can be purely a mailinfo.c thing.

-Peff
Previous: Junio C HamanoNext: Junio C Hamano
Message 17 of 22 in “Re: [PATCH 4/8] staging: et131x: Remove ununsed statistics”
  1. Dan CarpenterSep 13, 2014
  2. Greg KHSep 13, 2014
  3. Dan CarpenterSep 13, 2014
  4. Jeff KingSep 13, 2014
  5. Mark EinonSep 13, 2014
  6. Dan CarpenterSep 13, 2014
  7. Mark EinonSep 13, 2014
  8. Dan CarpenterSep 13, 2014
  9. mailinfo: do not treat ">From" lines as in-body headersJeff King, Sep 13, 2014
  10. brian m. carlsonSep 13, 2014
  11. Jeff KingSep 14, 2014
  12. Junio C HamanoSep 14, 2014
  13. Jeff KingSep 14, 2014
  14. Jeff KingSep 14, 2014
  15. Junio C HamanoSep 15, 2014
  16. Junio C HamanoSep 15, 2014
  17. Jeff KingSep 16, 2014
  18. Junio C HamanoSep 16, 2014
  19. Junio C HamanoSep 16, 2014
  20. Jeff KingSep 16, 2014
  21. Jeff KingSep 16, 2014
  22. Junio C HamanoSep 15, 2014

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.