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

Re: [PATCH] format-patch: Properly escape From_ lines when creating an mbox.

From
Carl Worth <cworth@cworth.org>
Date
Jun 10, 2010, 15:52 UTC
Message-ID
<87mxv2hola.fsf@yoom.home.cworth.org>
In-Reply-To
<87pqzyhpl2.fsf@yoom.home.cworth.org>
On Thu, 10 Jun 2010 08:31:05 -0700, Carl Worth <cworth@cworth.org> wrote:
Show 6 quoted lines
> I suppose we could maintain compatibility with any scripts, etc. by
> still emitting the initial "From " line, but declaring these files as
> messages (not mbox) and avoiding doing any quoting for them.
> 
> I think that gets us all the upsides with no downsides. I'll send one
> last patch for that.

Thinking about implementing and testing this, I realized that a file that looks like an mbox but isn't an mbox will confuse "git am" slightly. It will think that it should unquote any ">From " lines, but that would end up being the technically wrong thing to do since the lines aren't quoted.

I'm not sure what to do here that would cause the least undesirable breakage. Ignore this problem? Emit a line that still contains anything that scripts might be looking for but that "git am" could key off of as "not actually an mbox"?

I suppose we could put a magic timestamp there, but that feels pretty creepy and fragile.

Another option would be to just emit RFC2822 messages unless the user passes an explicit option to format-patch (such as --mbox, which would be implied by --stdout). Then git would generate legitimate (unqoted) messages and legitimate (quoted) mbox files.

I'd leave it to you to decide whether the --mbox option should be on by default or phased in with a warning or whatever.

What do you think?
-Carl
-- 
carl.d.worth@intel.com
Previous: Carl WorthNext: Junio C Hamano
Message 7 of 11 in “format-patch: Properly escape From_ lines when creating an mbox.”
  1. format-patch: Properly escape From_ lines when creating an mbox.Carl Worth, Jun 9, 2010
  2. Junio C HamanoJun 9, 2010
  3. Carl WorthJun 9, 2010
  4. Carl WorthJun 9, 2010
  5. Junio C HamanoJun 10, 2010
  6. Carl WorthJun 10, 2010
  7. Carl WorthJun 10, 2010
  8. Junio C HamanoJun 10, 2010
  9. Carl WorthJun 10, 2010
  10. H. Peter AnvinJun 9, 2010
  11. Carl WorthJun 9, 2010

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.