Subject: Re: [PATCH 5/5] format-patch: avoid freopen()

From: Junio C Hamano <[email-masked]>
Date: Wed, 22 Jun 2016 10:37:36 -0700

Johannes Schindelin <[email-masked]> writes:

> Well, if I change `rev.diffopt.use_color != GIT_COLOR_ALWAYS` to
> `rev.diffopt.use_color == GIT_COLOR_AUTO`, then the files will contain
> ugly ANSI color sequences if I run `git format-patch -o . -3`.
>
> The reason is, as I tried to explain, that the use_color field is *not*
> initialized to GIT_COLOR_AUTO (which is equivalent to 2), but to -1.

Ah, OK.

It still feels safer to force no-color only when it is auto
(i.e. the user said --color=auto) or -1 (i.e. the default), rather
than when it is anything other than always, though.