git@vger.kernel.org list mirror (unofficial, one of many)
 help / color / mirror / code / Atom feed
From: "Marco Trevisan via GitGitGadget" <gitgitgadget@gmail.com>
To: git@vger.kernel.org
Cc: Marco Trevisan <mail@3v1n0.net>
Subject: [PATCH v2 0/2] mergetool-lib: Don't use deprecated variable to detect GNOME
Date: Thu, 06 Aug 2020 15:27:51 +0000	[thread overview]
Message-ID: <pull.693.v2.git.1596727673.gitgitgadget@gmail.com> (raw)
In-Reply-To: <pull.693.git.1596634463.gitgitgadget@gmail.com>

To list merge tool candidates we used to use a private GNOME env variable (
GNOME_DESKTOP_SESSION_ID) that has been deprecated for long time ago and
removed as part of GNOME 3.30.0 release [1].

So replace this using XDG_CURRENT_DESKTOP instead, and cleanup the code to
avoid duplication and supporting KDE's kdiff3 better.

[1] https://gitlab.gnome.org/GNOME/gnome-session/-/commit/00e0e6226371d53f65

Marco Trevisan (Treviño) (2):
  mergetool-lib: use $XDG_CURRENT_DESKTOP to check GNOME
  mergetool-lib: give kdiff3 priority in KDE environments

 git-mergetool--lib.sh | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)


base-commit: 85b4e0a6dc8407de6f69808d9ee6debdf167ced3
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-693%2F3v1n0%2Fdesktop-envs-fixes-v2
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-693/3v1n0/desktop-envs-fixes-v2
Pull-Request: https://github.com/gitgitgadget/git/pull/693

Range-diff vs v1:

 1:  66a026ae67 ! 1:  26b25b0d65 mergetool-lib: use $XDG_CURRENT_DESKTOP to check GNOME
     @@ Commit message
          variable (GNOME_DESKTOP_SESSION_ID) that has been deprecated for long time ago
          and removed as part of GNOME 3.30.0 release [1].
      
     -    So, git should instead check the XDG_CURRENT_DESKTOP env variable, that
     -    is supported by all the desktop environments.
     +    So, git should instead primarily check the XDG_CURRENT_DESKTOP env variable,
     +    that is now supported by all the desktop environments.
      
          Since the variable is actually a colon-separated list of names that the current
     -    desktop is known as, we need to go through all the values to ensure
     -    we're using GNOME.
     +    desktop is known as, we need to check if the value is set if we're using GNOME.
      
          [1] https://gitlab.gnome.org/GNOME/gnome-session/-/commit/00e0e6226371d53f65
      
     @@ git-mergetool--lib.sh: run_merge_cmd () {
       }
       
      +is_desktop () {
     -+	IFS=':'
     -+	for desktop in ${XDG_CURRENT_DESKTOP}
     -+	do
     -+		if test "$desktop" = "$1"
     -+		then
     -+			return 0
     -+		fi
     -+	done
     -+
     -+	return 1
     ++	case ":$XDG_CURRENT_DESKTOP:" in
     ++	*:$1:*)
     ++		return 0
     ++		;;
     ++	*)
     ++		return 1
     ++		;;
     ++	esac
      +}
      +
       list_merge_tool_candidates () {
     @@ git-mergetool--lib.sh: list_merge_tool_candidates () {
       	if test -n "$DISPLAY"
       	then
      -		if test -n "$GNOME_DESKTOP_SESSION_ID"
     -+		if is_desktop "GNOME"
     ++		if is_desktop "GNOME" || test -n "$GNOME_DESKTOP_SESSION_ID"
       		then
       			tools="meld opendiff kdiff3 tkdiff xxdiff $tools"
       		else
 2:  fc0d2b103e < -:  ---------- mergetool-lib: keep a list of cross desktop merge tools
 3:  37090d2322 ! 2:  c18a5edf50 mergetool-lib: give kdiff3 prioirty in KDE environments
     @@ Metadata
      Author: Marco Trevisan (Treviño) <mail@3v1n0.net>
      
       ## Commit message ##
     -    mergetool-lib: give kdiff3 prioirty in KDE environments
     +    mergetool-lib: give kdiff3 priority in KDE environments
      
          Signed-off-by: Marco Trevisan (Treviño) <mail@3v1n0.net>
      
       ## git-mergetool--lib.sh ##
      @@ git-mergetool--lib.sh: list_merge_tool_candidates () {
     - 	fi
     - 	if test -n "$DISPLAY"
     - 	then
     --		cross_desktop_tools="opendiff kdiff3 tkdiff xxdiff"
     -+		cross_desktop_tools="opendiff tkdiff xxdiff"
     - 		if is_desktop "GNOME"
     + 		if is_desktop "GNOME" || test -n "$GNOME_DESKTOP_SESSION_ID"
       		then
     --			tools="meld $cross_desktop_tools $tools"
     -+			tools="meld $cross_desktop_tools kdiff3 $tools"
     -+		elif is_desktop "KDE"
     + 			tools="meld opendiff kdiff3 tkdiff xxdiff $tools"
     ++		elif is_desktop "KDE" || test x"$KDE_FULL_SESSION" = x"true"
      +		then
     -+			tools="kdiff3 $cross_desktop_tools meld $tools"
     ++			tools="kdiff3 opendiff tkdiff xxdiff meld $tools"
       		else
     --			tools="$cross_desktop_tools meld $tools"
     -+			tools="$cross_desktop_tools kdiff3 meld $tools"
     + 			tools="opendiff kdiff3 tkdiff xxdiff meld $tools"
       		fi
     - 		tools="$tools gvimdiff diffuse diffmerge ecmerge"
     - 		tools="$tools p4merge araxis bc codecompare"

-- 
gitgitgadget

  parent reply	other threads:[~2020-08-06 17:12 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-05 13:34 [PATCH 0/3] " Marco Trevisan via GitGitGadget
2020-08-05 13:34 ` [PATCH 1/3] mergetool-lib: use $XDG_CURRENT_DESKTOP to check GNOME Marco Trevisan (Treviño) via GitGitGadget
2020-08-05 20:58   ` Eric Sunshine
2020-08-05 22:14     ` Junio C Hamano
2020-08-06 12:12     ` Marco Trevisan (Treviño)
2020-08-05 13:34 ` [PATCH 2/3] mergetool-lib: keep a list of cross desktop merge tools Marco Trevisan (Treviño) via GitGitGadget
2020-08-05 21:08   ` Eric Sunshine
2020-08-06  8:16     ` Johannes Sixt
2020-08-06 12:19       ` Marco Trevisan (Treviño)
2020-08-06 12:28     ` Marco Trevisan (Treviño)
2020-08-05 13:34 ` [PATCH 3/3] mergetool-lib: give kdiff3 prioirty in KDE environments Marco Trevisan (Treviño) via GitGitGadget
2020-08-05 21:15   ` Eric Sunshine
2020-08-06 12:36     ` Marco Trevisan (Treviño)
2020-08-06 16:17       ` Eric Sunshine
2020-08-06 15:27 ` Marco Trevisan via GitGitGadget [this message]
2020-08-06 15:27   ` [PATCH v2 1/2] mergetool-lib: use $XDG_CURRENT_DESKTOP to check GNOME Marco Trevisan (Treviño) via GitGitGadget
2020-08-06 15:27   ` [PATCH v2 2/2] mergetool-lib: give kdiff3 priority in KDE environments Marco Trevisan (Treviño) via GitGitGadget

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

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=pull.693.v2.git.1596727673.gitgitgadget@gmail.com \
    --to=gitgitgadget@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=mail@3v1n0.net \
    --subject='Re: [PATCH v2 0/2] mergetool-lib: Don'\''t use deprecated variable to detect GNOME' \
    /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

Code repositories for project(s) associated with this inbox:

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).