Re: [PATCH 5/5] format-patch: avoid freopen()
- From
Johannes Schindelin <johannes.schindelin@gmx.de>
- Date
- Jun 21, 2016, 07:15 UTC
- Message-ID
- <alpine.DEB.2.20.1606210906190.22630@virtualbox>
- In-Reply-To
- <xmqq4m8nvodo.fsf@gitster.mtv.corp.google.com>
Hi Junio,
On Mon, 20 Jun 2016, Junio C Hamano wrote:
Show 7 quoted lines
> You can probably sell "when giving out put to file, we will never color > the output" as an improved new world order, but if that is what this > change wants to do, it probably deserves a separate patch. > > I however think you can avoid breaking expectations by people who are > not so sensible by overriding only when use_color is set to > GIT_COLOR_AUTO, perhaps?
That is a very convincing argument. So convincing that I wanted to change the patch to guard behind `diff_use_color_default == GIT_COLOR_AUTO`. But that is the wrong variable: the variable that *has* that default value is git_use_color_default, and is private to color.c.
But then I dug further to determine under which circumstances that variable can be reset to any different value. It turns out that in format-patch's case, it cannot:
787570c (format-patch: ignore ui.color, 2011-09-13)
I hope you agree that it will be enough to augment the commit message with this analysis and keep the patch as-is (as per v2, that is)?
Ciao, Dscho