git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jakub Narebski <jnareb@gmail.com>
To: Miklos Vajna <vmiklos@frugalware.org>
Cc: git@vger.kernel.org
Subject: Re: git-am strips newlines in some commit messages?
Date: Wed, 13 Feb 2008 01:15:02 -0800 (PST)	[thread overview]
Message-ID: <m3skzxcj5c.fsf@localhost.localdomain> (raw)
In-Reply-To: <20080213083200.GP25954@genesis.frugalware.org>

Miklos Vajna <vmiklos@frugalware.org> writes:

> it seems that in case the second line of a commit message is not empty,
> then git am strips newlines from the commit message. is this expected?

> vmiklos@gaia:~/git/t$ cat 0001-foo.patch |git am
> Applying - foo - bar - baz
> vmiklos@gaia:~/git/t$ head -n 6 0001-foo.patch
> From a928423a563201d95cf2e53c5050dbdfb415708e Mon Sep 17 00:00:00 2001
> From: Miklos Vajna <vmiklos@frugalware.org>
> Date: Wed, 13 Feb 2008 09:23:49 +0100
> Subject: [PATCH] - foo
>  - bar
>  - baz

git-am assumes that patch is in email form, and in email there is
single empty line separating email headers from email body. What makes
git-am mangle your commit message is the fact that email format allows
for header to span multiple lines: you have continuation lines to have
indented by whitespace. So git-am thinks that " - bar - baz" is
continuation of Summary: header.

> of maybe the solution would be that git format-patch inserts two
> newlines after the subject - even if the second line would not empty
> originally.

Decidely. This empty line would always be stripped.

-- 
Jakub Narebski
Poland
ShadeHawk on #git

      reply	other threads:[~2008-02-13  9:15 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-13  8:32 git-am strips newlines in some commit messages? Miklos Vajna
2008-02-13  9:15 ` Jakub Narebski [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m3skzxcj5c.fsf@localhost.localdomain \
    --to=jnareb@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=vmiklos@frugalware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).