# [bug] first line truncated with `git log --oneline --decorate --graph`

10 messages from 2015-04-16 to 2015-04-17. Participants: Robin Moussu, Junio C Hamano, Johannes Schindelin, David Miller, Jeff King.
Thread: https://gitlist.dev/t/39091

## Robin Moussu, 2015-04-16 10:14

Subject: [bug] first line truncated with `git log --oneline --decorate --graph`
Message-ID: <552F8B85.2000908@gmail.com>
URL: https://gitlist.dev/e/552F8B85.2000908%40gmail.com

```
I have a bug using the following command:

    git log --oneline --decorate --graph

In short, the first line of the log is often truncated.


If the terminal is too small to display all the text (~100 columns, and too
much text to fit on the high of screen, in this example less than 4
lines), I
actually see:

If my history is:

*   4656b73 (HEAD, long_branch_name_and_long_commit_name) Merge commit
'f7f6e4736ad040a1238644a33b681a66c79fac0e' into HEAD
|\
| * f7f6e47 (master) Praesent et diam eget libero egestas mattis sit
amet vitae augue.
| * 8dccb9d Maecenas congue ligula ac quam viverra nec consectetur ante
hendrerit.
|/
* f7724a2 Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec
a diam lectus.

If my screen is not high enough, I see:

1238644a33b681a66c79fac0e' into HEAD
|\ 
| * f7f6e47 (master) Praesent et diam eget libero egestas mattis sit
amet vitae augue.
| * 8dccb9d Maecenas congue ligula ac quam viverra nec consectetur ante
hendrerit.
# next message truncated, because the screen is too small

instead of:
*   4656b73 (HEAD, long_branch_name_and_long_commit_name) Merge commit
'f7f6e4736ad040a1238644a33b681a66c79fac0e' into HEAD
|\
| * f7f6e47 (master) Praesent et diam eget libero egestas mattis sit
amet vitae augue.
| * 8dccb9d Maecenas congue ligula ac quam viverra nec consectetur ante
hendrerit.
# next message truncated, because the screen is too small

As you can see, the first line is truncated.

If I use:
    git log --pretty=oneline --all --decorate --graph
instead of:
    git log --oneline --all --decorate --graph
the problem is the same (first line truncated).

I have see that bug using terminology or xterm, with bash (without
.bashrc) or zsh
(lots of things in my .zshrc), and my desktop environment is
i3/archlinux/git
version 2.3.5 It is not a recent regression (if it is, I've learn git
one year
ago).

# How to reproduce

Open a small terminal windows (4*100)

    mkdir tmp
    cd tmp
    git init
    git commit --allow-empty -m 'Lorem ipsum dolor sit amet, consectetur
adipiscing elit. Donec a diam lectus.'
    git checkout -b long_branch_name_and_long_commit_name
    git commit --allow-empty -m 'Maecenas congue ligula ac quam viverra
nec consectetur ante hendrerit.'
    git commit --allow-empty -m 'Praesent et diam eget libero egestas
mattis sit amet vitae augue.'
    git checkout master
    git merge --no-ff long_branch_name_and_long_commit_name -m 'merge
with a long commit message'
    git checkout long_branch_name_and_long_commit_name
    git merge master
    git log --oneline  --decorate --graph

I hope it is clear. The English is not my mother tongue.
--
Robin Moussu
//


```

## Junio C Hamano, 2015-04-16 15:28

Subject: Re: [bug] first line truncated with `git log --oneline --decorate --graph`
Message-ID: <xmqqwq1chz2s.fsf@gitster.dls.corp.google.com>
URL: https://gitlist.dev/e/xmqqwq1chz2s.fsf%40gitster.dls.corp.google.com
In-Reply-To: <552F8B85.2000908@gmail.com>

```
Robin Moussu <robin.moussu@gmail.com> writes:

> I have a bug using the following command:
>
>     git log --oneline --decorate --graph
>
> In short, the first line of the log is often truncated.
> ...
> # How to reproduce
>
> Open a small terminal windows (4*100)
>
>     mkdir tmp
>     cd tmp
>     git init
>     git commit --allow-empty -m 'Lorem ipsum dolor sit amet, consectetur
> adipiscing elit. Donec a diam lectus.'
>     git checkout -b long_branch_name_and_long_commit_name
>     git commit --allow-empty -m 'Maecenas congue ligula ac quam viverra
> nec consectetur ante hendrerit.'
>     git commit --allow-empty -m 'Praesent et diam eget libero egestas
> mattis sit amet vitae augue.'
>     git checkout master
>     git merge --no-ff long_branch_name_and_long_commit_name -m 'merge
> with a long commit message'
>     git checkout long_branch_name_and_long_commit_name
>     git merge master
>     git log --oneline  --decorate --graph
>
> I hope it is clear. The English is not my mother tongue.

It is clear and it does not reproduce for me.  I see

--------
*   5eff3a3 (HEAD -> long_branch_name_and_long_commit_name, master) merge with a long commit message
|\  
| * 61e21f3 Praesent et diam eget libero egestas mattis sit amet vitae augue.
:
--------

which looks perfectly sensible (my terminal is a "screen" running
on a Ubuntu machine, displaying to a SecureShell terminal on a
Chromebook).

Can you try running that problematic "git log" with its standard
output redirected to a file (i.e. "git log ... >output") and then
run your pager in that wide-but-short terminal (i.e. "less output"),
to see if the same problem is observed?  And then run "cat output"
in a taller terminal with the same width to see if it is the output
from "git log" that is causing you the problem?

```

## Johannes Schindelin, 2015-04-16 15:42

Subject: Re: [bug] first line truncated with `git log --oneline --decorate --graph`
Message-ID: <7139e45030c23bb642c5fe35e4074c6a@www.dscho.org>
URL: https://gitlist.dev/e/7139e45030c23bb642c5fe35e4074c6a%40www.dscho.org
In-Reply-To: <xmqqwq1chz2s.fsf@gitster.dls.corp.google.com>

```
Hi,

On 2015-04-16 17:28, Junio C Hamano wrote:
> Robin Moussu <robin.moussu@gmail.com> writes:
> 
>> I have a bug using the following command:
>>
>>     git log --oneline --decorate --graph
>>
>> In short, the first line of the log is often truncated.

I imagine that the pager (`less`) cuts off the lines because we start it with the `-S` option.

Robin, if the pager does not quit right away and you see a truncated line, could you try to press the keys `-`, `Shift+S`, `<Enter>` and see whether they are "untruncated"?

Ciao,
Johannes

```

## David Miller, 2015-04-16 15:56

Subject: Re: [bug] first line truncated with `git log --oneline --decorate --graph`
Message-ID: <20150416.115628.1228076242478955092.davem@davemloft.net>
URL: https://gitlist.dev/e/20150416.115628.1228076242478955092.davem%40davemloft.net
In-Reply-To: <7139e45030c23bb642c5fe35e4074c6a@www.dscho.org>

```

Hey folks, please remove git-owner from the CC: list, that goes
to me and not the list :-)

```

## Johannes Schindelin, 2015-04-16 16:11

Subject: git-owner, was Re: [bug] first line truncated with `git log --oneline --decorate --graph`
Message-ID: <6ebf8090f8246f9880f2bd94d494c872@www.dscho.org>
URL: https://gitlist.dev/e/6ebf8090f8246f9880f2bd94d494c872%40www.dscho.org
In-Reply-To: <20150416.115628.1228076242478955092.davem@davemloft.net>

```
Hi David,

On 2015-04-16 17:56, David Miller wrote:
> Hey folks, please remove git-owner from the CC: list, that goes
> to me and not the list :-)

I feared as much, but I cannot recall putting you on any Cc: myself. It appeared to me as if the list added git-owner@vger as sender, at least under *some* circumstances...

Ciao,
Dscho

```

## Jeff King, 2015-04-16 16:26

Subject: Re: git-owner, was Re: [bug] first line truncated with `git log --oneline --decorate --graph`
Message-ID: <20150416162620.GA10573@peff.net>
URL: https://gitlist.dev/e/20150416162620.GA10573%40peff.net
In-Reply-To: <6ebf8090f8246f9880f2bd94d494c872@www.dscho.org>

```
[retaining davem in cc in case he is curious, and hopefully does not
 see this as more spam :) ]

On Thu, Apr 16, 2015 at 06:11:47PM +0200, Johannes Schindelin wrote:

> On 2015-04-16 17:56, David Miller wrote:
> > Hey folks, please remove git-owner from the CC: list, that goes
> > to me and not the list :-)
> 
> I feared as much, but I cannot recall putting you on any Cc: myself.
> It appeared to me as if the list added git-owner@vger as sender, at
> least under *some* circumstances...

Weird. In a nearby thread with the same problem, the first email that
mentions git-owner in a cc header is yours[1]. It's in reply to a
message that does not mention git-owner at all[2], except in the
"Sender" field. Your agent header looks like:

  User-Agent: Roundcube Webmail/1.1.0

Maybe their "reply to all" function is a little over-zealous?

Messages from you from a few days ago do not show this problem, but
several starting on the 15th do. I don't see anything changing in the
messages from the list. Maybe your webmail provider changed something?
Or maybe it is a difference between replying to the version that came
through the list rather than one that came straight to you.

-Peff

[1,2] Rather than link to an archive, I'll attach full messages as I
      received them to make sure the headers are intact.

```

## David Miller, 2015-04-16 16:31

Subject: Re: git-owner, was Re: [bug] first line truncated with `git log --oneline --decorate --graph`
Message-ID: <20150416.123109.141223786207291496.davem@davemloft.net>
URL: https://gitlist.dev/e/20150416.123109.141223786207291496.davem%40davemloft.net
In-Reply-To: <20150416162620.GA10573@peff.net>

```
From: Jeff King <peff@peff.net>
Date: Thu, 16 Apr 2015 12:26:21 -0400

> Weird. In a nearby thread with the same problem, the first email that
> mentions git-owner in a cc header is yours[1]. It's in reply to a
> message that does not mention git-owner at all[2], except in the
> "Sender" field. Your agent header looks like:
> 
>   User-Agent: Roundcube Webmail/1.1.0
> 
> Maybe their "reply to all" function is a little over-zealous?

This is always caused by broken reply list handling in email clients.

```

## Robin Moussu, 2015-04-16 16:54

Subject: Re: git-owner, was Re: [bug] first line truncated with `git log --oneline --decorate --graph`
Message-ID: <552FE94C.5070302@gmail.com>
URL: https://gitlist.dev/e/552FE94C.5070302%40gmail.com
In-Reply-To: <6ebf8090f8246f9880f2bd94d494c872@www.dscho.org>

```
Hi Junio and Johanes,
It was effectively a less problem, and not a git problem.
My $LESS is '-r'. If I make "export LESS='-R' ", it is fixed.

Thanks a lot.
Cheers.
Robin.


```

## Johannes Schindelin, 2015-04-16 17:06

Subject: Re: git-owner, was Re: [bug] first line truncated with `git log --oneline --decorate --graph`
Message-ID: <ef9e69f60275dc7edb2dff8e65952630@www.dscho.org>
URL: https://gitlist.dev/e/ef9e69f60275dc7edb2dff8e65952630%40www.dscho.org
In-Reply-To: <20150416.123109.141223786207291496.davem@davemloft.net>

```
On 2015-04-16 18:31, David Miller wrote:
> From: Jeff King <peff@peff.net>
> Date: Thu, 16 Apr 2015 12:26:21 -0400
> 
>> Weird. In a nearby thread with the same problem, the first email that
>> mentions git-owner in a cc header is yours[1]. It's in reply to a
>> message that does not mention git-owner at all[2], except in the
>> "Sender" field. Your agent header looks like:
>>
>>   User-Agent: Roundcube Webmail/1.1.0
>>
>> Maybe their "reply to all" function is a little over-zealous?
> 
> This is always caused by broken reply list handling in email clients.

That must be it. Dave, my apologies! Will investigate *right now*.

```

## Johannes Schindelin, 2015-04-17 07:14

Subject: Re: git-owner, was Re: [bug] first line truncated with `git log --oneline --decorate --graph`
Message-ID: <e50ad4a89b2a62ccc448e19321f97879@www.dscho.org>
URL: https://gitlist.dev/e/e50ad4a89b2a62ccc448e19321f97879%40www.dscho.org
In-Reply-To: <ef9e69f60275dc7edb2dff8e65952630@www.dscho.org>

```
Hi Dave,

On 2015-04-16 19:06, Johannes Schindelin wrote:
> On 2015-04-16 18:31, David Miller wrote:
>> From: Jeff King <peff@peff.net>
>> Date: Thu, 16 Apr 2015 12:26:21 -0400
>>
>>> Weird. In a nearby thread with the same problem, the first email that
>>> mentions git-owner in a cc header is yours[1]. It's in reply to a
>>> message that does not mention git-owner at all[2], except in the
>>> "Sender" field. Your agent header looks like:
>>>
>>>   User-Agent: Roundcube Webmail/1.1.0
>>>
>>> Maybe their "reply to all" function is a little over-zealous?
>>
>> This is always caused by broken reply list handling in email clients.
> 
> That must be it. Dave, my apologies! Will investigate *right now*.

With the help of Peff, who identified the culprit (http://trac.roundcube.net/ticket/1489011 introduces this bug, but maintains to fix one), I was able to fix this on my side: https://github.com/dscho/roundcubemail/commit/baec39d

Please accept my sincerest apologies,
Johannes

```
