Subject: [PATCH 2/3] mergetool-lib: keep a list of cross desktop merge tools

From: "Marco Trevisan (Treviño) via GitGitGadget" <[email-masked]>
Date: Wed, 05 Aug 2020 13:34:22 +0000

From: =?UTF-8?q?Marco=20Trevisan=20=28Trevi=C3=B1o=29?= <[email-masked]>

Instead of repeating the same tools multiple times, let's just keep them
in another variable and list them depending the current desktop

Signed-off-by: Marco Trevisan (Treviño) <[email-masked]>
---
 git-mergetool--lib.sh | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/git-mergetool--lib.sh b/git-mergetool--lib.sh
index be28fe375f..243cd2b06b 100644
--- a/git-mergetool--lib.sh
+++ b/git-mergetool--lib.sh
@@ -288,11 +288,12 @@ list_merge_tool_candidates () {
 	fi
 	if test -n "$DISPLAY"
 	then
+		cross_desktop_tools="opendiff kdiff3 tkdiff xxdiff"
 		if is_desktop "GNOME"
 		then
-			tools="meld opendiff kdiff3 tkdiff xxdiff $tools"
+			tools="meld $cross_desktop_tools $tools"
 		else
-			tools="opendiff kdiff3 tkdiff xxdiff meld $tools"
+			tools="$cross_desktop_tools meld $tools"
 		fi
 		tools="$tools gvimdiff diffuse diffmerge ecmerge"
 		tools="$tools p4merge araxis bc codecompare"
-- 
gitgitgadget