Re: Missing trailing newline with git log --pretty=format

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

 



Andreas Gruenbacher <agruen@xxxxxxx> writes:

> On Wednesday, 18 March 2009 22:56:43 Markus Heidelberg wrote:
>> Use tformat instead of format.
>
> Hmm ... didn't know that, thanks. Now I wonder why anyone would ever want 
> format instead of tformat ;)

If your payload is multi-line, you would want to see a separating empty
line in between entries, but not after the last one:

	$ command with --format
        The first line of first entry.
        The second line of first entry.
        ...
        The last line of first entry.

        The first line of second entry.
        ...
        ...
        The last line of last entry.
        $ notice there is no extra newline after that

That is what --format does.  One-line-per-entry is a special case.  You do
not want a "separating LF in between entries", but a "terminating LF after
each entry".  T in --tformat stands for this "terminating" aspect, as
opposed to the "separator" behaviour --format gives you.
--
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]

  Powered by Linux