From: Junio C Hamano <gitster@pobox.com>
To: Tao Klerks <tao@klerks.biz>
Cc: git <git@vger.kernel.org>, Denton Liu <liu.denton@gmail.com>
Subject: Re: git mergetool, merge.tool, merge.guitool and DISPLAY
Date: Fri, 09 Sep 2022 10:07:18 -0700 [thread overview]
Message-ID: <xmqqpmg4lbnd.fsf@gitster.g> (raw)
In-Reply-To: <CAPMMpogZd_em4_Fdk0sNFqAXqH19VOVyw3WsNT2LHsQNOb0_rw@mail.gmail.com> (Tao Klerks's message of "Fri, 9 Sep 2022 13:56:24 +0200")
Tao Klerks <tao@klerks.biz> writes:
> When you configure your tools, you can configure "merge.tool" for the
> default, and "merge.guitool" for GUI contexts - so far so good, sounds
> consistent.
>
> However, once you've configured these two settings, "git mergetool"
> will never select the GUI tool you've configured unless you very
> *explicitly* tell it to, by specifying the --gui argument. The
> sensible auto-selection based on "DISPLAY" disappears.
We've had merge.tool almost forever but merge.guitool is a more
recent invention in late 2018.
> The upshot, as I understand it, is that the only way to get a GUI when
> I'm connected with an X session, and get a terminal-based mergetool
> when I'm not, without having to be aware and issue different commands,
> is to accept whatever tooling default order is hardcoded in
> "git-mergetool--lib.sh"
60aced3d (mergetool: fallback to tool when guitool unavailable,
2019-04-29) says something interesting:
The behavior for when difftool or mergetool are called without `--gui`
should be identical with or without this patch.
So, either we broke that promise since then, or the above commit was
already broken, or the tool was already broken before that? In any
case, I do not think of a good reason why configured .guitool is not
automatically honored and .tool ignored when we know we are in an GUI
environment. In other words, the choice of the tool should probably
go like:
are we in GUI? (determined by an explicit --gui, --no-gui, or env)
if so
pick one from configured .guitool (or from the fallback default
list of tools)
else
pick one from configured .tool (or from the fallback default
list of non-GUI tools)
I would think.
> Is this intentional / is there any logic here, or is this just
> unfortunate, a result of the auto-selection evolving more
> intelligently than the built-in explicit "--gui" selection, over
> time??
next prev parent reply other threads:[~2022-09-09 17:07 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-09 11:56 git mergetool, merge.tool, merge.guitool and DISPLAY Tao Klerks
2022-09-09 17:07 ` Junio C Hamano [this message]
2022-09-09 18:09 ` Tao Klerks
2022-09-09 18:48 ` Junio C Hamano
2022-10-12 16:03 ` Tao Klerks
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xmqqpmg4lbnd.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=liu.denton@gmail.com \
--cc=tao@klerks.biz \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).