From 9553d2b26395d9a19bf60875784661090f607f4a Mon Sep 17 00:00:00 2001 From: Jeff King Date: Thu, 26 May 2011 18:28:17 -0400 Subject: format-patch: preserve subject newlines with -k In older versions of git, we used rfc822 header folding to indicate that the original subject line had multiple lines in it. But since a1f6baa (format-patch: wrap long header lines, 2011-02-23), we now use header folding whenever there is a long line. This means that "git am" cannot trust header folding as a sign from format-patch that newlines should be preserved. Instead, format-patch needs to signal more explicitly that the newlines are significant. This patch does so by rfc2047-encoding the newlines in the subject line. No changes are needed on the "git am" end; it already decodes the newlines properly. Signed-off-by: Jeff King Signed-off-by: Junio C Hamano --- builtin/log.c | 1 + 1 file changed, 1 insertion(+) (limited to 'builtin') diff --git a/builtin/log.c b/builtin/log.c index 8d842cbcac..0e46e5ae95 100644 --- a/builtin/log.c +++ b/builtin/log.c @@ -1131,6 +1131,7 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix) die ("-n and -k are mutually exclusive."); if (keep_subject && subject_prefix) die ("--subject-prefix and -k are mutually exclusive."); + rev.preserve_subject = keep_subject; argc = setup_revisions(argc, argv, &rev, &s_r_opt); if (argc > 1) -- cgit v1.2.3