From: Junio C Hamano <gitster@pobox.com>
To: Tao Klerks <tao@klerks.biz>
Cc: David Aguilar <davvid@gmail.com>,
Tao Klerks via GitGitGadget <gitgitgadget@gmail.com>,
git@vger.kernel.org, Eric Sunshine <sunshine@sunshineco.com>
Subject: Re: [PATCH v4] mergetool: new config guiDefault supports auto-toggling gui by DISPLAY
Date: Tue, 04 Apr 2023 13:35:57 -0700 [thread overview]
Message-ID: <xmqq355fz8pe.fsf@gitster.g> (raw)
In-Reply-To: <CAPMMpohtL2dG_Ody5zALhS5kOuLLTTRw7L0vc6SnpWym+usppg@mail.gmail.com> (Tao Klerks's message of "Tue, 4 Apr 2023 16:50:31 +0200")
Tao Klerks <tao@klerks.biz> writes:
> If you get it wrong, an inconvenient or even bad
> thing happens: If you're in a GUI context and you forget to say
> `--gui`, then you get the CLI tool - not the end of the world, you
> might argue. If you're in a non-GUI context and you say `--gui`, you
> get a (hopefully intelligible) error about not finding a display, or
> worst case, you hang - and git doesn't know what happened, the
> messaging has to assume you aborted explicitly.
The worst case I can think of is if you have a machine that allows a
persistent virtual graphical session (remote desktop). You can go
there, open a terminal and create a screen session, which captures
the $DISPLAY in effect. You may disconnect from the screen session
before you disconnect from the remote desktop. As the remote
desktop is persistent, the $DISPLAY would be valid even after you
disconnect from there.
Then you ssh into the machine and connect to the screen session. If
you say "xterm &" in that screen session, a new window with a
terminal will open and be shown on that remote display session,
which you cannot see until you reconnect to the remote desktop.
Running "git mergetool --gui" would be the same.
With the proposed patch, the experience would become even worse in
that scenario, I am afraid. "git mergetool" (without "--[no-]gui")
would detect the presense of $DISPLAY and start a GUI mergetool that
you cannot view or interact with ;-). You need to explicitly say
"git mergetool --no-gui" in such a case to force use of cli tool.
Even with that caveat, I think the proposed behaviour would be a net
improvement. I almost always work in non-GUI environment, but I can
see many people work in both and depending on their environment wish
to use the best tool for the situation.
> If there were a way to get git to autoselect "--gui" by presence of
> the DISPLAY, as it does for the *default* mergetool, then this kind of
> flow would be much more intuitive, usable, etc.
>
> I'm not sure whether I'm explaining better, or just repeating myself,
> so I'll stop here :)
Hopefully your explanation was clear enough. Others may be able to
offer solution better than "look at DISPLAY and choose --[no-]gui
when neither is given from the command line", but I think at least I
understand your motivation behind this change.
Thanks.
next prev parent reply other threads:[~2023-04-04 20:36 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-12 15:59 [PATCH] mergetool: new config guiDefault supports auto-toggling gui by DISPLAY Tao Klerks via GitGitGadget
2022-10-12 16:08 ` Tao Klerks
2022-10-12 18:12 ` Junio C Hamano
2022-10-13 6:49 ` Tao Klerks
2022-10-13 21:58 ` Junio C Hamano
2022-10-14 4:53 ` Tao Klerks
2022-10-14 9:10 ` Junio C Hamano
2022-10-14 12:32 ` Tao Klerks
2022-10-14 15:37 ` Junio C Hamano
2022-10-16 20:07 ` Tao Klerks
2022-10-14 8:00 ` [PATCH v2] RFC: " Tao Klerks via GitGitGadget
2022-10-14 8:24 ` Eric Sunshine
2022-10-14 9:11 ` Tao Klerks
2022-10-14 15:45 ` Junio C Hamano
2022-10-16 20:19 ` Tao Klerks
2022-10-17 5:50 ` Junio C Hamano
2022-10-18 6:54 ` [PATCH v3] " Tao Klerks via GitGitGadget
2023-02-17 10:59 ` Tao Klerks
2023-03-18 15:27 ` [PATCH v4] " Tao Klerks via GitGitGadget
2023-04-04 9:46 ` David Aguilar
2023-04-04 14:50 ` Tao Klerks
2023-04-04 20:35 ` Junio C Hamano [this message]
2023-04-06 3:33 ` David Aguilar
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=xmqq355fz8pe.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=davvid@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitgitgadget@gmail.com \
--cc=sunshine@sunshineco.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.