Re: inconsistent logs when displayed on screen / piped to a file

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

 



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
--
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]