Re: Bug in "git am" when the body starts with spaces

2017-04-04 Thread Jeff King
On Mon, Apr 03, 2017 at 10:42:46AM -0700, Jonathan Tan wrote: > On 04/01/2017 09:18 PM, Jeff King wrote: > > On Sat, Apr 01, 2017 at 12:03:44PM -0700, Linus Torvalds wrote: > > > The logic is fairly simple: if we encounter an empty line, and we have > > > pending in-body headers, we flush the

Re: Bug in "git am" when the body starts with spaces

2017-04-03 Thread Jonathan Tan
Thanks, everyone, for looking into this. On 04/01/2017 09:18 PM, Jeff King wrote: On Sat, Apr 01, 2017 at 12:03:44PM -0700, Linus Torvalds wrote: The logic is fairly simple: if we encounter an empty line, and we have pending in-body headers, we flush the pending headers, and mark us as no

Re: Bug in "git am" when the body starts with spaces

2017-04-02 Thread Junio C Hamano
Linus Torvalds writes: > On Fri, Mar 31, 2017 at 5:52 PM, Linus Torvalds > wrote: >> >> The continuation logic is oddly complex, and I can't follow the logic. >> But it is completely broken in how it thinks empty lines are somehow >>

Re: Bug in "git am" when the body starts with spaces

2017-04-01 Thread Jeff King
On Sat, Apr 01, 2017 at 12:03:44PM -0700, Linus Torvalds wrote: > On Fri, Mar 31, 2017 at 5:52 PM, Linus Torvalds > wrote: > > > > The continuation logic is oddly complex, and I can't follow the logic. > > But it is completely broken in how it thinks empty lines

Re: Bug in "git am" when the body starts with spaces

2017-04-01 Thread Linus Torvalds
On Fri, Mar 31, 2017 at 5:52 PM, Linus Torvalds wrote: > > The continuation logic is oddly complex, and I can't follow the logic. > But it is completely broken in how it thinks empty lines are somehow > "continuations". The attached patch seems to work for me.

Re: Bug in "git am" when the body starts with spaces

2017-03-31 Thread Jeff King
On Fri, Mar 31, 2017 at 05:52:00PM -0700, Linus Torvalds wrote: > Ok, did a bisect, and this bisects to commit 6b4b013f1884 ("mailinfo: > handle in-body header continuations"). > > The continuation logic is oddly complex, and I can't follow the logic. > But it is completely broken in how it

Re: Bug in "git am" when the body starts with spaces

2017-03-31 Thread Linus Torvalds
Ok, did a bisect, and this bisects to commit 6b4b013f1884 ("mailinfo: handle in-body header continuations"). The continuation logic is oddly complex, and I can't follow the logic. But it is completely broken in how it thinks empty lines are somehow "continuations". Jonathan?

Bug in "git am" when the body starts with spaces

2017-03-31 Thread Linus Torvalds
Try applying the attached patch with git am 0001-Test-patch.patch in the git repository. At least for me, it results in a very odd commit that has one single line in the commit message: Test patch This should go in the body not in the subject line which is obviously bogus. I think the