summaryrefslogtreecommitdiffstats
path: root/mergetools/vscode
diff options
context:
space:
mode:
authorAlex Henrie <alexhenrie24@gmail.com>2024-09-02 04:59:14 +0200
committerJunio C Hamano <gitster@pobox.com>2024-09-02 05:47:58 +0200
commit6b77283f5e7fffcc74c032f2e692aaab1ddbe58a (patch)
tree18db76d0f6da4def88bd5ba0ec5f543185ad3b2a /mergetools/vscode
parentThe eleventh batch (diff)
downloadgit-6b77283f5e7fffcc74c032f2e692aaab1ddbe58a.tar.xz
git-6b77283f5e7fffcc74c032f2e692aaab1ddbe58a.zip
mergetools: vscode: new tool
VSCode has supported three-way merges since 2022, see <https://github.com/microsoft/vscode/issues/5770#issuecomment-1188658476>. Although the program binary is located at /usr/bin/code, name the mergetool "vscode" because the word "code" is too generic and would lead to confusion. The name "vscode" also matches Git's existing contrib/vscode directory. On Windows, VSCode adds the directory that contains code.cmd to %PATH%, so there is no need to invoke mergetool_find_win32_cmd to search for the program. Signed-off-by: Alex Henrie <alexhenrie24@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'mergetools/vscode')
-rw-r--r--mergetools/vscode19
1 files changed, 19 insertions, 0 deletions
diff --git a/mergetools/vscode b/mergetools/vscode
new file mode 100644
index 0000000000..3b39b458d6
--- /dev/null
+++ b/mergetools/vscode
@@ -0,0 +1,19 @@
+diff_cmd () {
+ "$merge_tool_path" --wait --diff "$LOCAL" "$REMOTE"
+}
+
+diff_cmd_help () {
+ echo "Use Visual Studio Code (requires a graphical session)"
+}
+
+merge_cmd () {
+ "$merge_tool_path" --wait --merge "$REMOTE" "$LOCAL" "$BASE" "$MERGED"
+}
+
+merge_cmd_help () {
+ echo "Use Visual Studio Code (requires a graphical session)"
+}
+
+translate_merge_tool_path () {
+ echo code
+}