Re: Bug: "git log --format='format:%+s%+b'" doesn't insert newline before body

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

 



Hi Ilya,

On Sun, 24 Jul 2016, Ilya Tumaykin wrote:

> Steps to reproduce:
> $ git init
> $ >123
> $ git add 123
> $ git commit -v -m 'This is subject' -m 'And this is body'
> $ git --no-pager log -1 --format='format:%+s%+b'
> 
> Actual results:
> ```
> 
> This is subject
> And this is body
> ```
> 
> Expected results:
> ```
> 
> This is subject
> 
> And this is body
> ```

The empty line between commit subject and body is neither part of the
subject nor of the body. That means that the above-mentioned expectation
was incorrect.

Unless you somehow allow empty commit messages (Git does not, unless you
play games with low-level commands), the second '+' is unnecessarily
conditional. Therefore "%s%n%+b" *might* do what you intended (I would not
know, because that information was missing from the report).

Ciao,
Johannes
--
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]