#877689 git: piping git lg to head removes coloring

Package:
git
Source:
git
Description:
fast, scalable, distributed revision control system
Submitter:
Andreas Ronnquist
Date:
2017-10-20 01:06:07 UTC
Severity:
minor
#877689#5
Date:
2017-10-04 11:30:19 UTC
From:
To:
Dear Maintainer,


Upgrading Sid git from Debian packaged 1:2.14.1-3 to 1:2.14.2-1 affects
colored output of git lg - which I have defined as a alias like this:

lg = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s
%Cgreen(%cr %an)%Creset' --abbrev-commit --date=relative

Doing 'git lg' always gets correct colors, and doing 'git lg | head -n
20' with the older version kept it nicely colored - But now, with
1:2.14.2-1 the coloring is gone in this specific case when piping to
head.

#877689#10
Date:
2017-10-20 01:03:48 UTC
From:
To:
Ah, I found a solution - Doing

git lg --color=always | head -n 20

will work just fine and will be colored correctly even with the piping.
I consider my problem solved, feel free to close this bug if you would
like. (There still is the difference between 1:2.14.1-3 and 1:2.14.2-1
if you would like to further investigate, but I am satisfied with my
solution).

Thanks!