Re: git log --pretty=format joins lines in the subject of commit message

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Sep 15, 2010 at 12:55, Kirill Likhodedov
<Kirill.Likhodedov@xxxxxxxxxxxxx> wrote:
> Commit something to a git repository with a commit message with several newlines like this:
>
> ==== commit message starts below ===
> first line
> second line
> third line
>
> fifth line
> === commit message ends above ===
>
> Git treats the first 3 lines as commit message subject and the last line as its body.
>
> 'git log' shows the commit message correctly - exactly like I've entered. So does 'git log --pretty=raw'
>
> But 'git log --pretty=format:%s#%b' joins the first three lines:
> first line second line third line#fifth line
>
> Is it a bug or a feature?

It's probably a feature. We delimit the subject by "\n\n", not
"\n". And IIRC subjects in E-Mail can contain \n.

> If it is a feature how can I acquire the original subject of the commit message by using custom format?

Use a log format that gives you the complete message, then pipe it
through perl or something to parse it?
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]