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>

Alex Henrie committed Sep 1, 2024 at 20:59 UTC 6b77283f5e7fffcc74c032f2e692aaab1ddbe58a
1 file changed +19
mergetools/vscode new
+19
@@ -0,0 +1,19 @@
1 +diff_cmd () {
2 + "$merge_tool_path" --wait --diff "$LOCAL" "$REMOTE"
3 +}
4 +
5 +diff_cmd_help () {
6 + echo "Use Visual Studio Code (requires a graphical session)"
7 +}
8 +
9 +merge_cmd () {
10 + "$merge_tool_path" --wait --merge "$REMOTE" "$LOCAL" "$BASE" "$MERGED"
11 +}
12 +
13 +merge_cmd_help () {
14 + echo "Use Visual Studio Code (requires a graphical session)"
15 +}
16 +
17 +translate_merge_tool_path () {
18 + echo code
19 +}