# inconsistent logs when displayed on screen / piped to a file

5 messages from 2012-07-30 to 2012-07-31. Participants: Mojca Miklavec, Michael J Gruber, Carlos Martín Nieto, Jan Engelhardt.
Thread: https://gitlist.dev/t/31137

## Mojca Miklavec, 2012-07-30 12:25

Subject: inconsistent logs when displayed on screen / piped to a file
Message-ID: <CALBOmsYh5AgpRQe28yUcChqemQ7HFMHahesGj_MPwQXDF-EM=Q@mail.gmail.com>
URL: https://gitlist.dev/e/CALBOmsYh5AgpRQe28yUcChqemQ7HFMHahesGj_MPwQXDF-EM%3DQ%40mail.gmail.com

```
Hello,

I'm trying to use "git log" to generate ChangeLog for a project
recently migrated from CVS.

The problem is that
    git log --summary --stat --no-merges --date=short --decorate=short
behaves differently when the result is displayed on screen and when it
is piped to a file.

For example, running the commands:
    a) git log --summary --stat --no-merges --date=short
--decorate=short e9f65aa976
    b) git log --summary --stat --no-merges --date=short
--decorate=short e9f65aa976 > /tmp/log.txt
would result in two different outputs:

a)

 aquaterm/Docs/gptProtocol.rtf                         |  316
++++++++++++++++++++++++++
 aquaterm/English.lproj/GPTInfoWindow.nib/classes.nib  |   12 +
 aquaterm/English.lproj/GPTInfoWindow.nib/info.nib     |   12 +
 aquaterm/English.lproj/GPTInfoWindow.nib/objects.nib  |  Bin 0 -> 1010 bytes
 aquaterm/English.lproj/GPTInfoWindow~.nib/classes.nib |    4 +
 aquaterm/English.lproj/GPTInfoWindow~.nib/info.nib    |   12 +
 aquaterm/English.lproj/GPTInfoWindow~.nib/objects.nib |  Bin 0 -> 1232 bytes
 aquaterm/English.lproj/GPTWindow.nib/classes.nib      |   13 ++
 aquaterm/English.lproj/GPTWindow.nib/info.nib         |   12 +

b)

 aquaterm/Docs/gptProtocol.rtf                      |  316 ++++++
 .../English.lproj/GPTInfoWindow.nib/classes.nib    |   12 +
 aquaterm/English.lproj/GPTInfoWindow.nib/info.nib  |   12 +
 .../English.lproj/GPTInfoWindow.nib/objects.nib    |  Bin 0 -> 1010 bytes
 .../English.lproj/GPTInfoWindow~.nib/classes.nib   |    4 +
 aquaterm/English.lproj/GPTInfoWindow~.nib/info.nib |   12 +
 .../English.lproj/GPTInfoWindow~.nib/objects.nib   |  Bin 0 -> 1232 bytes
 aquaterm/English.lproj/GPTWindow.nib/classes.nib   |   13 +
 aquaterm/English.lproj/GPTWindow.nib/info.nib      |   12 +


The project where the results could be easily reproduced is the following:
    https://github.com/AquaTerm/AquaTerm
    git://github.com/AquaTerm/AquaTerm.git

It is possible that I screwed up something when importing the project
from CVS. In that case I would be happy if someone could point me out
what exactly I did wrong, and I can still rewrite the history before
the first release of the project using git.

But in any case I find it weird that I get two different outputs.

I would be grateful for any clues or hints about what goes wrong.

Mojca

```

## Michael J Gruber, 2012-07-30 13:39

Subject: Re: inconsistent logs when displayed on screen / piped to a file
Message-ID: <50168E93.2090202@drmicha.warpmail.net>
URL: https://gitlist.dev/e/50168E93.2090202%40drmicha.warpmail.net
In-Reply-To: <CALBOmsYh5AgpRQe28yUcChqemQ7HFMHahesGj_MPwQXDF-EM=Q@mail.gmail.com>

```
Mojca Miklavec venit, vidit, dixit 30.07.2012 14:25:
> Hello,
> 
> I'm trying to use "git log" to generate ChangeLog for a project
> recently migrated from CVS.
> 
> The problem is that
>     git log --summary --stat --no-merges --date=short --decorate=short
> behaves differently when the result is displayed on screen and when it
> is piped to a file.
> 
> For example, running the commands:
>     a) git log --summary --stat --no-merges --date=short
> --decorate=short e9f65aa976
>     b) git log --summary --stat --no-merges --date=short
> --decorate=short e9f65aa976 > /tmp/log.txt
> would result in two different outputs:
> 
> a)
> 
>  aquaterm/Docs/gptProtocol.rtf                         |  316
> ++++++++++++++++++++++++++
>  aquaterm/English.lproj/GPTInfoWindow.nib/classes.nib  |   12 +
>  aquaterm/English.lproj/GPTInfoWindow.nib/info.nib     |   12 +
>  aquaterm/English.lproj/GPTInfoWindow.nib/objects.nib  |  Bin 0 -> 1010 bytes
>  aquaterm/English.lproj/GPTInfoWindow~.nib/classes.nib |    4 +
>  aquaterm/English.lproj/GPTInfoWindow~.nib/info.nib    |   12 +
>  aquaterm/English.lproj/GPTInfoWindow~.nib/objects.nib |  Bin 0 -> 1232 bytes
>  aquaterm/English.lproj/GPTWindow.nib/classes.nib      |   13 ++
>  aquaterm/English.lproj/GPTWindow.nib/info.nib         |   12 +
> 
> b)
> 
>  aquaterm/Docs/gptProtocol.rtf                      |  316 ++++++
>  .../English.lproj/GPTInfoWindow.nib/classes.nib    |   12 +
>  aquaterm/English.lproj/GPTInfoWindow.nib/info.nib  |   12 +
>  .../English.lproj/GPTInfoWindow.nib/objects.nib    |  Bin 0 -> 1010 bytes
>  .../English.lproj/GPTInfoWindow~.nib/classes.nib   |    4 +
>  aquaterm/English.lproj/GPTInfoWindow~.nib/info.nib |   12 +
>  .../English.lproj/GPTInfoWindow~.nib/objects.nib   |  Bin 0 -> 1232 bytes
>  aquaterm/English.lproj/GPTWindow.nib/classes.nib   |   13 +
>  aquaterm/English.lproj/GPTWindow.nib/info.nib      |   12 +
> 
> 
> The project where the results could be easily reproduced is the following:
>     https://github.com/AquaTerm/AquaTerm
>     git://github.com/AquaTerm/AquaTerm.git
> 
> It is possible that I screwed up something when importing the project
> from CVS. In that case I would be happy if someone could point me out
> what exactly I did wrong, and I can still rewrite the history before
> the first release of the project using git.
> 
> But in any case I find it weird that I get two different outputs.
> 
> I would be grateful for any clues or hints about what goes wrong.
> 
> Mojca
> 

The only difference that I see is the formatting. ("..." is merely an
abbreviation for a leading path.)

a) probes your terminal for the number of columns and uses all available
space.

b) goes to a file and has no connected terminal, thus uses a default
column number. You can change that number using

COLUMNS=YourNumber git log YourArgs > YourFile

Michael

```

## Carlos Martín Nieto, 2012-07-30 13:50

Subject: Re: inconsistent logs when displayed on screen / piped to a file
Message-ID: <1343656217.3970.5.camel@centaur.cmartin.tk>
URL: https://gitlist.dev/e/1343656217.3970.5.camel%40centaur.cmartin.tk
In-Reply-To: <50168E93.2090202@drmicha.warpmail.net>

```
On Mon, 2012-07-30 at 15:39 +0200, Michael J Gruber wrote:
> a) probes your terminal for the number of columns and uses all available
> space.
> 
> b) goes to a file and has no connected terminal, thus uses a default
> column number. You can change that number using
> 
> COLUMNS=YourNumber git log YourArgs > YourFile

You can also pass a width to --stat. See the git log manpage for details
about which widths you can override.

   cmn

```

## Mojca Miklavec, 2012-07-30 14:58

Subject: Re: inconsistent logs when displayed on screen / piped to a file
Message-ID: <CALBOmsage+Gx9=bkH0rX1SvViSbMUPUWuYoifjgEnsjw+0=osw@mail.gmail.com>
URL: https://gitlist.dev/e/CALBOmsage%2BGx9%3DbkH0rX1SvViSbMUPUWuYoifjgEnsjw%2B0%3Dosw%40mail.gmail.com
In-Reply-To: <50168E93.2090202@drmicha.warpmail.net>

```
On Mon, Jul 30, 2012 at 3:39 PM, Michael J Gruber wrote:
> Mojca Miklavec venit, vidit, dixit 30.07.2012 14:25:
>>
>> I'm trying to use "git log" to generate ChangeLog for a project
>> recently migrated from CVS.
>>
>> The problem is that
>>     git log --summary --stat --no-merges --date=short --decorate=short
>> behaves differently when the result is displayed on screen and when it
>> is piped to a file.
>
> The only difference that I see is the formatting. ("..." is merely an
> abbreviation for a leading path.)
>
> a) probes your terminal for the number of columns and uses all available
> space.
>
> b) goes to a file and has no connected terminal, thus uses a default
> column number. You can change that number using
>
> COLUMNS=YourNumber git log YourArgs > YourFile

Wow, perfect, thank you very much. Setting COLUMNS=200 (the high
number just in case) solved the problem.

Mojca

```

## Jan Engelhardt, 2012-07-31 08:08

Subject: Re: inconsistent logs when displayed on screen / piped to a file
Message-ID: <alpine.LNX.2.01.1207311008350.11095@frira.zrqbmnf.qr>
URL: https://gitlist.dev/e/alpine.LNX.2.01.1207311008350.11095%40frira.zrqbmnf.qr
In-Reply-To: <CALBOmsage+Gx9=bkH0rX1SvViSbMUPUWuYoifjgEnsjw+0=osw@mail.gmail.com>

```
On Monday 2012-07-30 16:58, Mojca Miklavec wrote:
>>
>> COLUMNS=YourNumber git log YourArgs > YourFile
>
>Wow, perfect, thank you very much. Setting COLUMNS=200 (the high
>number just in case) solved the problem.

200 ought to be enough for everybody? PATH_MAX is never enough...

```
