git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 2/2] mergetools: fail if display needed but not present

From
Junio C Hamano <gitster@pobox.com>
Date
Mar 28, 2012, 21:02 UTC
Message-ID
<7vmx70tp4t.fsf@alter.siamese.dyndns.org>
In-Reply-To
<1332964693-4058-2-git-send-email-tim.henigan@gmail.com>
Tim Henigan <tim.henigan@gmail.com> writes:
> Prior to this commit, if 'git mergetool' or 'git difftool' were run in a
> terminal-only session, they might still try to open a tool that required
> a windowed environment.

When you say "The command does X. X is bad for such and such reasons. Make it do Y instead, because it is nicer for such and such reasons.", everybody would understand that the command does X without your patch. Maybe it is just me, but I find the phrases like "Prior to this commit" or "Currently" somewhat irritating.

> This commit teaches 'git-mergetool--lib.sh' to test for the presence of
> a display prior to opening tools that require one.

Hrm, why not make it more general, so that mergetool--lib does not have to know anything about DISPLAY but allow the tool scripts to inspect their environment and make their own decision, i.e. after loading the tool scriptlet, the caller can call "can_run [--quiet]" and the scriptlet can either return 0/1 and optionally issue the help message?

Previous: Tim HeniganNext: Junio C Hamano
Message 3 of 4 in “mergetools: split config files for vim and gvim”
  1. 1/2 mergetools: split config files for vim and gvimTim Henigan, Mar 28, 2012
  2. 2/2 mergetools: fail if display needed but not presentTim Henigan, Mar 28, 2012
  3. Junio C HamanoMar 28, 2012
  4. Junio C HamanoMar 28, 2012

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.