mergetools: vscode: new tool
PATCH 1/1 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.
--- mergetools/vscode | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 mergetools/vscode
mergetools/vscode new file +19 -0
@@ -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 +}
Signature · 1 line
2.46.0
Hi Alex,
Quoted 11 lines · Alex Henrie
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_cmdto search for the program.
The commit message and the patch look good to me.
Thank you!
Johannes
Quoted 36 lines
Signed-off-by Alex Henrie <[email protected]>--- mergetools/vscode | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 mergetools/vscodemergetools/vscode new file +19
-1@@ -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 +} --2.46.0
Quoted 5 lines · Johannes Schindelin
Quoted 3 lines
On Windows, VSCode adds the directory that contains code.cmd to %PATH%, so there is no need to invoke
mergetool_find_win32_cmdto search for the program.The commit message and the patch look good to me.
Thanks, both. Let me mark the topic for 'next'.