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

[bug (maybe)] Applying patch with '---'

From
Chris Packham <judge.packham@gmail.com>
Date
Apr 1, 2015, 02:37 UTC
Message-ID
<CAFOYHZC6Qd9wkoWPcTJDxAs9u=FGpHQTkjE-guhwkya0DRVA6g@mail.gmail.com>
Hi List,

So I was just sent a patch generated with 'git format-patch' that 'git am' fails to apply correctly. It applies but part of the commit message is lost.

The problem is that the commit message has lines like
--- Foo happened
    did some things to handle Foo
--- Bar happened
    Still processing update from Foo which led to a crash

git mailinfo seems to discard everything after the first '--- Blah'. I know ^---$ is special but I thought ^---.+$ would be OK. I know git mailinfo shouldn't handle garbage input but I guess the problem I have is that the patch was generated by git format-patch so surely git mailinfo (and therefore git am) _should_ handle something generated by generated by git format-patch.

Do people agree with my thinking? I'm not sure if it would be appropriate for git format-patch to produce a warning or for git mailinfo to tighten the matching of '---'.

Regards, Chris

Next: Junio C Hamano
Message 1 of 3 in “[bug (maybe)] Applying patch with '---'”
  1. Chris PackhamApr 1, 2015
  2. Junio C HamanoApr 1, 2015
  3. Chris PackhamApr 1, 2015

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.