Re: [PATCH 5/5] format-patch: avoid freopen()
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jun 22, 2016, 17:37 UTC
- Message-ID
- <xmqqwplhm8f3.fsf@gitster.mtv.corp.google.com>
- In-Reply-To
- <alpine.DEB.2.20.1606221811300.10382@virtualbox>
Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
Show 6 quoted lines
> 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.