From patchwork Wed Aug 5 13:34:21 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Jean-No=C3=ABl_Avila_via_GitGitGadget?= X-Patchwork-Id: 11702437 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8AC3F14B7 for ; Wed, 5 Aug 2020 19:50:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 76B0E2076E for ; Wed, 5 Aug 2020 19:50:21 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="miMc7r7E" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728308AbgHETuU (ORCPT ); Wed, 5 Aug 2020 15:50:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47316 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728265AbgHEQxw (ORCPT ); Wed, 5 Aug 2020 12:53:52 -0400 Received: from mail-wm1-x343.google.com (mail-wm1-x343.google.com [IPv6:2a00:1450:4864:20::343]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B8522C0A54D6 for ; Wed, 5 Aug 2020 06:34:43 -0700 (PDT) Received: by mail-wm1-x343.google.com with SMTP id 184so6384454wmb.0 for ; Wed, 05 Aug 2020 06:34:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=message-id:in-reply-to:references:from:date:subject:mime-version :content-transfer-encoding:fcc:to:cc; bh=GTth7ZlgfEQKOaHMOM4OTwa7f0ezvsrKyYbwytkK8Xg=; b=miMc7r7EyAQ1pNLDMOoaBMqRAWIPuMn6rcBrR3kLiahzW4MydJPl3j1CPuShRKdEFB 2YcQDN6m32MNHvbkp7vAsyzwSNcmookuz/dET1PgiwU0ih6+lIFo6fNQgVljxVx5TmeP pQx5IL7v/EkK4840m109a+7hss8ksONVAQrbxPg1/kD/6ByFimgRaWpZ4g3J/WW2e3Cx 3hfvWiIUan5qztWUXM1A/+wkTqdeUh2Z3O61g3E3FuU8beI2EK25/banmtxK9i6yKdzY YqiJ5w+w9STeIA8ikSVYC/ae7UkF3n3kgvt0L2OY1mmdfh+XDll7fxZFPu8csYZQ/6eu eKKA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:in-reply-to:references:from:date :subject:mime-version:content-transfer-encoding:fcc:to:cc; bh=GTth7ZlgfEQKOaHMOM4OTwa7f0ezvsrKyYbwytkK8Xg=; b=CXpOGeg8eHLv+4xUyB9pYlHRvyhzD+89FgtpVTX3GSZ+iV8i4c/HMIDNh9s1ueSor3 1+Xiylhlr7KXIoQHHdCirxC9WiIb9M03fOcIYqNoQxuNteF82H/W4G9np8JM/6l9oNmV geDkGs3gF+u5KQLDmVF4aqukdJccF2D7ukmX8S2h01Hnt7WXXG86/J9KaQzBFlcOTAwm ESNlMoM9tDuUIbbNo2fuOhr3whuhLq8Y7GD4Lp5+HPwGilRrNjP/1HS0XbQUFeHRsttV G3j68I61YMrMO6kMzDPi8ce6CDICtnckzkYRKCtam1KHlDp5vEZAiOG7hT7bUkaRJk5t fkaA== X-Gm-Message-State: AOAM5313JITbo3goCM/kXcw3mFI9l1wn7CXt9wg4JPvR+sMNB+HMh7Zy kjAe703AwkFtM0UY+GynwzNv8pZC X-Google-Smtp-Source: ABdhPJzDkUvQTSRubF2DHSE4SQy87svbuzezCN8oUXRrEKd1RwBNxLG3Z3aBgCBN4K43qYQsIJ+l+A== X-Received: by 2002:a05:600c:220b:: with SMTP id z11mr3294876wml.48.1596634466100; Wed, 05 Aug 2020 06:34:26 -0700 (PDT) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id m16sm2619557wrr.71.2020.08.05.06.34.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Aug 2020 06:34:25 -0700 (PDT) Message-Id: <66a026ae678341fe7e93a89e22f76e24282cebaa.1596634463.git.gitgitgadget@gmail.com> In-Reply-To: References: From: " =?utf-8?q?Marco_Trevisan_=28Trevi=C3=B1o=29?= via GitGitGadget" Date: Wed, 05 Aug 2020 13:34:21 +0000 Subject: [PATCH 1/3] mergetool-lib: use $XDG_CURRENT_DESKTOP to check GNOME MIME-Version: 1.0 Fcc: Sent To: git@vger.kernel.org Cc: Marco Trevisan , =?utf-8?q?Marco_Trevisan_=28Trevi=C3=B1?= =?utf-8?q?o=29?= Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: =?UTF-8?q?Marco=20Trevisan=20=28Trevi=C3=B1o=29?= 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, git should instead check the XDG_CURRENT_DESKTOP env variable, that is 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. [1] https://gitlab.gnome.org/GNOME/gnome-session/-/commit/00e0e6226371d53f65 Signed-off-by: Marco Trevisan (Treviño) --- git-mergetool--lib.sh | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/git-mergetool--lib.sh b/git-mergetool--lib.sh index 204a5acd66..be28fe375f 100644 --- a/git-mergetool--lib.sh +++ b/git-mergetool--lib.sh @@ -266,6 +266,19 @@ run_merge_cmd () { fi } +is_desktop () { + IFS=':' + for desktop in ${XDG_CURRENT_DESKTOP} + do + if test "$desktop" = "$1" + then + return 0 + fi + done + + return 1 +} + list_merge_tool_candidates () { if merge_mode then @@ -275,7 +288,7 @@ list_merge_tool_candidates () { fi if test -n "$DISPLAY" then - if test -n "$GNOME_DESKTOP_SESSION_ID" + if is_desktop "GNOME" then tools="meld opendiff kdiff3 tkdiff xxdiff $tools" else From patchwork Wed Aug 5 13:34:22 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Jean-No=C3=ABl_Avila_via_GitGitGadget?= X-Patchwork-Id: 11702445 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D0D89722 for ; Wed, 5 Aug 2020 19:52:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B7AD322CA0 for ; Wed, 5 Aug 2020 19:52:41 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="UkyXvsbG" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729438AbgHETwk (ORCPT ); Wed, 5 Aug 2020 15:52:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46390 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726418AbgHEQut (ORCPT ); Wed, 5 Aug 2020 12:50:49 -0400 Received: from mail-wr1-x443.google.com (mail-wr1-x443.google.com [IPv6:2a00:1450:4864:20::443]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AA5C7C0A3BFD for ; Wed, 5 Aug 2020 06:34:43 -0700 (PDT) Received: by mail-wr1-x443.google.com with SMTP id a15so40714408wrh.10 for ; Wed, 05 Aug 2020 06:34:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=message-id:in-reply-to:references:from:date:subject:mime-version :content-transfer-encoding:fcc:to:cc; bh=8qo/UduqfGZZ69wrhv8No4m5HunNDTQ7JOhdXAVzgEM=; b=UkyXvsbGKo4zKwut2yEuhmDFpX3XARvmW1M6CtppjHpiXSVGT20bg0pNGLfbTCxk/p JOAr1tqxKvDdjliImuib7drJN7m6qm328R+vwsTxWFOufy/fMPfMvV2UadNUXDaA3QEY v0ejoVGbixyqVbgEv2X059+PqLOwdYsV5LAzjsgJYvGHuE7PfODansRRcZyITf6tgd8W ZcFDwQQZhtxfVek24Y++V3cfP3eL75OYgIah6x37Adb9/mc0tpXxdsxb2qtRWLmM91HF mVjgpnMo6Q+vY745pSYZimB9orMyx1z0IrpEIa7+ivLu6mGPz92Xn3B4GFdyxOH4riTy 9zDA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:in-reply-to:references:from:date :subject:mime-version:content-transfer-encoding:fcc:to:cc; bh=8qo/UduqfGZZ69wrhv8No4m5HunNDTQ7JOhdXAVzgEM=; b=mCGCgJFCPUXQFxUbKeI/0UT0Jjh+UX8OnL67pNteXc1ip+moPvkD0vY+La8DR8VUce dLMzNWbhdfq9HgY3W5Pos9JOCNMBCilcuKGO5zZfmesbEnz1KOM6p5NpsxojliH4yHoc nHUTAUcVQDulvU6TMqNyNRTy0SIVAu8iWVVR5XufmIxrvpF8eDl4Tfq0JP5V7Pba33DA C3XCOICTv6E7l63NmuKk4m7/4k5lHxaR622p/Y5CWjFYHqdpIaGzbmbcMKjPDr/1j2Is 0/pbVeHqY6aWqiviHI8l0LcoOGK2Ae+XIIQheTjQSZR4CenjOhIhmiUWZLSv+k9zqrfC kuDw== X-Gm-Message-State: AOAM5328xpeonVDFHNYNO18KA2or2pDDSXQ/vbcqbZDwQH7S5yYbCNry XrWdU6CRCrgd34iS3FnDVDKcOYWA X-Google-Smtp-Source: ABdhPJxDd6j3Q6+FTCg1pyGGa8kd05Y6yxVuWUsbJTpS2wQ78K910q1ee0CIKA9qlCDTfErjg8zG1A== X-Received: by 2002:adf:df89:: with SMTP id z9mr2825133wrl.395.1596634466977; Wed, 05 Aug 2020 06:34:26 -0700 (PDT) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id z7sm2778327wmk.6.2020.08.05.06.34.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Aug 2020 06:34:26 -0700 (PDT) Message-Id: In-Reply-To: References: From: " =?utf-8?q?Marco_Trevisan_=28Trevi=C3=B1o=29?= via GitGitGadget" Date: Wed, 05 Aug 2020 13:34:22 +0000 Subject: [PATCH 2/3] mergetool-lib: keep a list of cross desktop merge tools MIME-Version: 1.0 Fcc: Sent To: git@vger.kernel.org Cc: Marco Trevisan , =?utf-8?q?Marco_Trevisan_=28Trevi=C3=B1?= =?utf-8?q?o=29?= Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: =?UTF-8?q?Marco=20Trevisan=20=28Trevi=C3=B1o=29?= 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) --- 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" From patchwork Wed Aug 5 13:34:23 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Jean-No=C3=ABl_Avila_via_GitGitGadget?= X-Patchwork-Id: 11702483 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C0EBD13B6 for ; Wed, 5 Aug 2020 20:01:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A9BE222B42 for ; Wed, 5 Aug 2020 20:01:53 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="XjhlSdP9" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728003AbgHEUBu (ORCPT ); Wed, 5 Aug 2020 16:01:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45432 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727819AbgHEQkH (ORCPT ); Wed, 5 Aug 2020 12:40:07 -0400 Received: from mail-wm1-x32e.google.com (mail-wm1-x32e.google.com [IPv6:2a00:1450:4864:20::32e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 870ACC0A54D8 for ; Wed, 5 Aug 2020 06:34:46 -0700 (PDT) Received: by mail-wm1-x32e.google.com with SMTP id k20so6353518wmi.5 for ; Wed, 05 Aug 2020 06:34:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=message-id:in-reply-to:references:from:date:subject:mime-version :content-transfer-encoding:fcc:to:cc; bh=q/VKbgaqXwb22OtOuemlOUEe/c49c2WOTrwLfmpWBjY=; b=XjhlSdP9+4p+U7DY3UPgsqcy1Vg+OdRYlpe96boOpKURm5gc/1ZCCgrsVpmIecmwCV Fe3HLnHOJDSzpZVaHsobSFiXQFeY7foW58SnpLgV6q75vE0U3v3FKh6t7aBc1/Qiyr2w F9EDKscHCaMJ2BjizD1jb6aABt4j5i93nbSKEOU8QXpyp4isxPyB8biG8Ri5rCeGR8co ejaq2NCx0Uts2zhyIbZfAo5z+OYG7Sa04VYKfEn2dro3Wvy8EJwBVTXSDDGQR5biq/DZ IcLTEvIJZGenbvkzD8KgRKrDcWwIMnyJLLkQwwXcJyoaCyrS0r7KyDO8pAj/fIwY/7EI bMOg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:in-reply-to:references:from:date :subject:mime-version:content-transfer-encoding:fcc:to:cc; bh=q/VKbgaqXwb22OtOuemlOUEe/c49c2WOTrwLfmpWBjY=; b=XKhXnVJtlC7zTNvtNqTQWWkU5I2NOJRiQVqzE2jxIcyb3Pfeyd36MUEygUEtqdZO2D /PlSn2XCLrKwsZ2koBz7Ak26d+hHH8YB98BRiudkd+sF69yVH3uAOPONiUNcdcgtcYbf 11Q7EJdgX/orOZ7ryw0FhW3gGMrk5fOBR9vtjAmFg//uILCC4EapyTxvQPteXoXsrLSX BVtNhD70hErcJNN0FxJ+MWzjxwDjClhT+wocZ8ZIRb+yIYg5dqUk+goV6kpVzmdP9ZSO FMtcJWis2+DqjxaTGBMgST4Wink7KjFALsaVgWym1/WE19V/Chmvc0HrOp3/iJHOo4/u m4LQ== X-Gm-Message-State: AOAM533nwIZtLdNTb5Q4AAZwmqk9guJx9oqQsNjIgPglhn94Sx1EeiDK JAfjlu+jb70SScN7S+Q4HbLg+NNZ X-Google-Smtp-Source: ABdhPJzP4LPDuOJDLo+PmPUDMZlwb2/our4B2Ej7Gd2KhJdlJgExE0vUqn+AaWVJfTV5F22j1bbbeQ== X-Received: by 2002:a1c:32c3:: with SMTP id y186mr3289375wmy.15.1596634467640; Wed, 05 Aug 2020 06:34:27 -0700 (PDT) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id r206sm2946757wma.6.2020.08.05.06.34.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Aug 2020 06:34:27 -0700 (PDT) Message-Id: <37090d232221415b227c165bd44f6711d21f376b.1596634463.git.gitgitgadget@gmail.com> In-Reply-To: References: From: " =?utf-8?q?Marco_Trevisan_=28Trevi=C3=B1o=29?= via GitGitGadget" Date: Wed, 05 Aug 2020 13:34:23 +0000 Subject: [PATCH 3/3] mergetool-lib: give kdiff3 prioirty in KDE environments MIME-Version: 1.0 Fcc: Sent To: git@vger.kernel.org Cc: Marco Trevisan , =?utf-8?q?Marco_Trevisan_=28Trevi=C3=B1?= =?utf-8?q?o=29?= Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: =?UTF-8?q?Marco=20Trevisan=20=28Trevi=C3=B1o=29?= Signed-off-by: Marco Trevisan (Treviño) --- git-mergetool--lib.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/git-mergetool--lib.sh b/git-mergetool--lib.sh index 243cd2b06b..90de6ee884 100644 --- a/git-mergetool--lib.sh +++ b/git-mergetool--lib.sh @@ -288,12 +288,15 @@ 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" then - tools="meld $cross_desktop_tools $tools" + tools="meld $cross_desktop_tools kdiff3 $tools" + elif is_desktop "KDE" + then + tools="kdiff3 $cross_desktop_tools meld $tools" else - tools="$cross_desktop_tools meld $tools" + tools="$cross_desktop_tools kdiff3 meld $tools" fi tools="$tools gvimdiff diffuse diffmerge ecmerge" tools="$tools p4merge araxis bc codecompare"