On Mon, Apr 22, 2019 at 1:07 AM Denton Liu <[email protected]> wrote:
> In git-difftool, these options specify which tool to ultimately run. As
> a result, they are logically conflicting. Explicitly disallow these
> options from being used together.
>
> Signed-off-by: Denton Liu <[email protected]>
> ---
> diff --git a/builtin/difftool.c b/builtin/difftool.c
> @@ -731,6 +731,15 @@ int cmd_difftool(int argc, const char **argv, const char
> *prefix)
> + if (use_gui_tool)
> + count++;
> + if (difftool_cmd)
> + count++;
> + if (extcmd)
> + count++;
> + if (count > 1)
> + die(_("--gui, --tool and --extcmd are exclusive"));
The more typical way to check this condition in this codebase is:
if (use_gui_tool + !!difftool_cmd + !!extcmd > 1)
die(...);
Also, I think you might want: s/exclusive/mutually &/