# git log --summary outputs extra newlines inconsistently

2 messages from 2011-02-03 to 2011-02-04. Participants: Anders Kaseorg.
Thread: https://gitlist.dev/t/26406

## Anders Kaseorg, 2011-02-03 23:33

Subject: git log --summary outputs extra newlines inconsistently
Message-ID: <alpine.DEB.2.02.1102021842550.12561@dr-wily.mit.edu>
URL: https://gitlist.dev/e/alpine.DEB.2.02.1102021842550.12561%40dr-wily.mit.edu

```
‘git log --summary’ seems to output a newline after every non-merge 
commit.

  $ git log --summary --pretty=format:'%h %s'
  3c0eee3 Linux 2.6.37
  
  65f4288 Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
  9fc3bbb ipv4/route.c: respect prefsrc for local routes
  
  8a87694 remove trim_fs method from Documentation/filesystems/Locking
  
  989d873 Merge master.kernel.org:/home/rmk/linux-2.6-arm
  d9a1abe arch/mn10300/kernel/irq.c: fix build
  
  867c202 ima: fix add LSM rule bug

  …

Oddly, those newlines show up even with -z!

  $ git log --summary --pretty=format:%h -z
  3c0eee3
  ^@65f4288^@9fc3bbb
  ^@8a87694
  ^@989d873^@d9a1abe
  ^@867c202
  …

This makes the output annoying to parse in both cases.

(I’m using Git 1.7.4-rc2.)

Anders

```

## Anders Kaseorg, 2011-02-04 18:57

Subject: Re: git log --summary outputs extra newlines inconsistently
Message-ID: <alpine.DEB.2.02.1102041351490.32500@dr-wily.mit.edu>
URL: https://gitlist.dev/e/alpine.DEB.2.02.1102041351490.32500%40dr-wily.mit.edu
In-Reply-To: <AANLkTinX6igafGkEv+k97Tm+V-8kEJK0rZs-K0iUGyes@mail.gmail.com>

```
On Fri, 4 Feb 2011, Junio C Hamano wrote:
> > ‘git log --summary’ seems to output a newline after every non-merge
> > commit.
> 
> I suspect you want tformat.

Same problem.

  $ git log --summary --pretty=tformat:'%h %s'
  3c0eee3 Linux 2.6.37

  65f4288 Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
  9fc3bbb ipv4/route.c: respect prefsrc for local routes

  8a87694 remove trim_fs method from Documentation/filesystems/Locking

  989d873 Merge master.kernel.org:/home/rmk/linux-2.6-arm
  d9a1abe arch/mn10300/kernel/irq.c: fix build

  867c202 ima: fix add LSM rule bug

Also, tformat doesn’t seem to work at all with -z (it gives identical 
results with and without -z).

Anders

```
