From: "Michael Schindler via GitGitGadget" <gitgitgadget@gmail.com>
To: git@vger.kernel.org
Cc: Michael Schindler <michael@compressconsult.com>,
Michael Schindler <michael@compressconsult.com>
Subject: [PATCH] mergetools/kdiff3: make kdiff3 work on windows too
Date: Mon, 07 Jun 2021 20:18:33 +0000 [thread overview]
Message-ID: <pull.952.git.git.1623097114277.gitgitgadget@gmail.com> (raw)
From: Michael Schindler <michael@compressconsult.com>
Currently the native kdiff3 mergetool is not found by git mergetool on windows.
The message "The merge tool kdiff3 is not available as 'kdiff3'" is displayed.
But it is important especially for GUI to use this native version on windows.
Kdiff3 for various systems can be downloaded from https://download.kde.org/stable/kdiff3/
Bug cause:
On Windows the executable name has to be translated (kdiff3.exe instead of kdiff) and the windows path has to be searched - similar to winmerge.
Fix:
This change is using mergetool_find_win32_cmd from the library in the translate_merge_tool_path().
This is done the same way as in winmerge.
However this translation must not be made on linux/unix, so a "type kdiff3" test is made on kdiff3 and only if not found the windows search is tried.
Signed-off-by: Michael Schindler michael@compressconsult.com
---
mergetools/kdiff3: make kdiff3 work on windows too
mergetools/kdiff3: make kdiff3 work on windows too
Currently the native kdiff3 mergetool is not found by git mergetool on
windows. The message "The merge tool kdiff3 is not available as
'kdiff3'" is displayed.
But it is important especially for GUI to use this native version on
windows. Kdiff3 for various systems can be downloaded from
https://download.kde.org/stable/kdiff3/
Bug cause: On Windows the executable name has to be translated
(kdiff3.exe instead of kdiff) and the windows path has to be searched -
similar to winmerge.
Fix: This change is using mergetool_find_win32_cmd from the library in
the translate_merge_tool_path(). This is done the same way as in
winmerge.
However this translation must not be made on linux/unix, so a "type
kdiff3" test is made on kdiff3 and only if not found the windows search
is tried.
Signed-off-by: Michael Schindler michael@compressconsult.com
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-952%2Fmichaelcompressconsult%2Fkdiff3_win-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-952/michaelcompressconsult/kdiff3_win-v1
Pull-Request: https://github.com/git/git/pull/952
mergetools/kdiff3 | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/mergetools/kdiff3 b/mergetools/kdiff3
index 0264ed5b20b2..520cb914a18b 100644
--- a/mergetools/kdiff3
+++ b/mergetools/kdiff3
@@ -25,3 +25,12 @@ merge_cmd () {
exit_code_trustable () {
true
}
+
+translate_merge_tool_path() {
+ if type kdiff3 >/dev/null 2>/dev/null
+ then
+ echo kdiff3
+ else
+ mergetool_find_win32_cmd "kdiff3.exe" "Kdiff3"
+ fi
+}
base-commit: c09b6306c6ca275ed9d0348a8c8014b2ff723cfb
--
gitgitgadget
next reply other threads:[~2021-06-07 20:19 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-07 20:18 Michael Schindler via GitGitGadget [this message]
2021-06-08 1:26 ` [PATCH] mergetools/kdiff3: make kdiff3 work on windows too Junio C Hamano
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=pull.952.git.git.1623097114277.gitgitgadget@gmail.com \
--to=gitgitgadget@gmail.com \
--cc=git@vger.kernel.org \
--cc=michael@compressconsult.com \
/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.