All of lore.kernel.org
 help / color / mirror / Atom feed
* Bug in "git am" when the body starts with spaces
@ 2017-04-01  0:24 Linus Torvalds
  2017-04-01  0:52 ` Linus Torvalds
  0 siblings, 1 reply; 8+ messages in thread
From: Linus Torvalds @ 2017-04-01  0:24 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Git Mailing List

[-- Attachment #1: Type: text/plain, Size: 743 bytes --]

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 reason is that the "header continuation line" logic kicks
in because the lines in the body start with spaces, but that's
entirely incorrect, since

 (a) we're not in an email header

 (b) there's an empty line in between anyway, so no way are those body
lines continuation lines.

I didn't check how far back this goes, I guess I'll do that next. But
I thought I'd report it here first in case somebody else goes "ahhh".

                Linus

[-- Attachment #2: 0001-Test-patch.patch --]
[-- Type: text/x-patch, Size: 532 bytes --]

From ad65cf7ba97ac071da1f845ec854165e7bf1efdf Mon Sep 17 00:00:00 2001
From: Linus Torvalds <torvalds@linux-foundation.org>
Date: Fri, 31 Mar 2017 17:18:16 -0700
Subject: [PATCH] Test patch example

Subject: [PATCH] Test patch

  This should go in the body
  not in the subject line
---
 Makefile | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Makefile b/Makefile
index 9b36068ac..9f36c149b 100644
--- a/Makefile
+++ b/Makefile
@@ -1,3 +1,4 @@
+
 # The default target of this Makefile is...
 all::
 
-- 
2.12.2.401.g5d4234a49


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2017-04-04  6:51 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-01  0:24 Bug in "git am" when the body starts with spaces Linus Torvalds
2017-04-01  0:52 ` Linus Torvalds
2017-04-01  5:27   ` Jeff King
2017-04-01 19:03   ` Linus Torvalds
2017-04-02  4:18     ` Jeff King
2017-04-03 17:42       ` Jonathan Tan
2017-04-04  6:50         ` Jeff King
2017-04-02 17:35     ` Junio C Hamano

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.