Subject: Re: [PATCH] mergetool: new config guiDefault supports auto-toggling gui by DISPLAY

From: Junio C Hamano <[email-masked]>
Date: Fri, 14 Oct 2022 02:10:58 -0700

Tao Klerks <[email-masked]> writes:

> 1. Why add an OPT_CALLBACK_F arg handler, rather than keeping a simple
> OPT_BOOL arg type?
> Because OPT_BOOL always overwrites with either true or false, so in
> order to have use_gui_tool retain its "_BY_CONFIG" value in the
> absence of an arg, the explicit arg handler function is required.

That is exactly why you want to initialize the variable to something
other than 0 or 1 (say "-1") and use that as "not explicitly
specified from the command line" aka _BY_CONFIG value, isn't it?

And once you do so, you do not need callback and you do not need
enum.  The original "int" can take tri-state, (unspecified = -1,
false = 0, true = 1).

Am I missing something?