{"thread":{"id":"62035","subject":"[PATCH] mergetools: vscode: new tool","startedAt":"2024-09-02T02:58:51Z","lastAt":"2024-09-03T15:56:13Z","messageCount":3,"participants":["Alex Henrie","Johannes Schindelin","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"501968","messageId":"20240902025918.99657-1-alexhenrie24@gmail.com","threadId":"62035","inReplyTo":null,"subject":"[PATCH] mergetools: vscode: new tool","fromName":"Alex Henrie","fromEmail":"alexhenrie24@gmail.com","sentAt":"2024-09-02T02:59:14Z","receivedAt":"2024-09-02T02:58:51Z","isPatch":true,"sender":{"key":"alexhenrie24@gmail.com","avatar":"https://avatars.githubusercontent.com/u/5951993?v=4"},"body":"VSCode has supported three-way merges since 2022, see\n<https://github.com/microsoft/vscode/issues/5770#issuecomment-1188658476>.\n\nAlthough the program binary is located at /usr/bin/code, name the\nmergetool \"vscode\" because the word \"code\" is too generic and would lead\nto confusion. The name \"vscode\" also matches Git's existing\ncontrib/vscode directory.\n\nOn Windows, VSCode adds the directory that contains code.cmd to %PATH%,\nso there is no need to invoke mergetool_find_win32_cmd to search for the\nprogram.\n\nSigned-off-by: Alex Henrie <alexhenrie24@gmail.com>\n---\n mergetools/vscode | 19 +++++++++++++++++++\n 1 file changed, 19 insertions(+)\n create mode 100644 mergetools/vscode\n\ndiff --git a/mergetools/vscode b/mergetools/vscode\nnew file mode 100644\nindex 0000000000..3b39b458d6\n--- /dev/null\n+++ b/mergetools/vscode\n@@ -0,0 +1,19 @@\n+diff_cmd () {\n+\t\"$merge_tool_path\" --wait --diff \"$LOCAL\" \"$REMOTE\"\n+}\n+\n+diff_cmd_help () {\n+\techo \"Use Visual Studio Code (requires a graphical session)\"\n+}\n+\n+merge_cmd () {\n+\t\"$merge_tool_path\" --wait --merge \"$REMOTE\" \"$LOCAL\" \"$BASE\" \"$MERGED\"\n+}\n+\n+merge_cmd_help () {\n+\techo \"Use Visual Studio Code (requires a graphical session)\"\n+}\n+\n+translate_merge_tool_path () {\n+\techo code\n+}\n-- \n2.46.0\n\n"},{"id":"502028","messageId":"78e1d2b8-4d22-9bc9-ec5d-aaa072cbd393@gmx.de","threadId":"62035","inReplyTo":"20240902025918.99657-1-alexhenrie24@gmail.com","subject":"Re: [PATCH] mergetools: vscode: new tool","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2024-09-03T11:11:44Z","receivedAt":"2024-09-03T11:11:49Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi Alex,\n\nOn Sun, 1 Sep 2024, Alex Henrie wrote:\n\n> VSCode has supported three-way merges since 2022, see\n> <https://github.com/microsoft/vscode/issues/5770#issuecomment-1188658476>.\n>\n> Although the program binary is located at /usr/bin/code, name the\n> mergetool \"vscode\" because the word \"code\" is too generic and would lead\n> to confusion. The name \"vscode\" also matches Git's existing\n> contrib/vscode directory.\n>\n> On Windows, VSCode adds the directory that contains code.cmd to %PATH%,\n> so there is no need to invoke mergetool_find_win32_cmd to search for the\n> program.\n\nThe commit message and the patch look good to me.\n\nThank you!\nJohannes\n\n>\n> Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>\n> ---\n>  mergetools/vscode | 19 +++++++++++++++++++\n>  1 file changed, 19 insertions(+)\n>  create mode 100644 mergetools/vscode\n>\n> diff --git a/mergetools/vscode b/mergetools/vscode\n> new file mode 100644\n> index 0000000000..3b39b458d6\n> --- /dev/null\n> +++ b/mergetools/vscode\n> @@ -0,0 +1,19 @@\n> +diff_cmd () {\n> +\t\"$merge_tool_path\" --wait --diff \"$LOCAL\" \"$REMOTE\"\n> +}\n> +\n> +diff_cmd_help () {\n> +\techo \"Use Visual Studio Code (requires a graphical session)\"\n> +}\n> +\n> +merge_cmd () {\n> +\t\"$merge_tool_path\" --wait --merge \"$REMOTE\" \"$LOCAL\" \"$BASE\" \"$MERGED\"\n> +}\n> +\n> +merge_cmd_help () {\n> +\techo \"Use Visual Studio Code (requires a graphical session)\"\n> +}\n> +\n> +translate_merge_tool_path () {\n> +\techo code\n> +}\n> --\n> 2.46.0\n>\n>\n"},{"id":"502042","messageId":"xmqqr0a0n339.fsf@gitster.g","threadId":"62035","inReplyTo":"78e1d2b8-4d22-9bc9-ec5d-aaa072cbd393@gmx.de","subject":"Re: [PATCH] mergetools: vscode: new tool","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2024-09-03T15:56:10Z","receivedAt":"2024-09-03T15:56:13Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n\n>> On Windows, VSCode adds the directory that contains code.cmd to %PATH%,\n>> so there is no need to invoke mergetool_find_win32_cmd to search for the\n>> program.\n>\n> The commit message and the patch look good to me.\n\nThanks, both.  Let me mark the topic for 'next'.\n"}]}