* [PATCH] mergetools: vscode: new tool
@ 2024-09-02 2:59 Alex Henrie
2024-09-03 11:11 ` Johannes Schindelin
0 siblings, 1 reply; 3+ messages in thread
From: Alex Henrie @ 2024-09-02 2:59 UTC (permalink / raw)
To: Johannes.Schindelin, cogoni.guillaume, stolee, gitster, git; +Cc: 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_cmd to search for the
program.
Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
---
mergetools/vscode | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
create mode 100644 mergetools/vscode
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
+}
--
2.46.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] mergetools: vscode: new tool
2024-09-02 2:59 [PATCH] mergetools: vscode: new tool Alex Henrie
@ 2024-09-03 11:11 ` Johannes Schindelin
2024-09-03 15:56 ` Junio C Hamano
0 siblings, 1 reply; 3+ messages in thread
From: Johannes Schindelin @ 2024-09-03 11:11 UTC (permalink / raw)
To: Alex Henrie; +Cc: cogoni.guillaume, stolee, gitster, git
Hi Alex,
On Sun, 1 Sep 2024, Alex Henrie wrote:
> 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.
The commit message and the patch look good to me.
Thank you!
Johannes
>
> Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
> ---
> mergetools/vscode | 19 +++++++++++++++++++
> 1 file changed, 19 insertions(+)
> create mode 100644 mergetools/vscode
>
> 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
> +}
> --
> 2.46.0
>
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] mergetools: vscode: new tool
2024-09-03 11:11 ` Johannes Schindelin
@ 2024-09-03 15:56 ` Junio C Hamano
0 siblings, 0 replies; 3+ messages in thread
From: Junio C Hamano @ 2024-09-03 15:56 UTC (permalink / raw)
To: Johannes Schindelin; +Cc: Alex Henrie, cogoni.guillaume, stolee, git
Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
>> 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.
>
> The commit message and the patch look good to me.
Thanks, both. Let me mark the topic for 'next'.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-09-03 15:56 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-02 2:59 [PATCH] mergetools: vscode: new tool Alex Henrie
2024-09-03 11:11 ` Johannes Schindelin
2024-09-03 15:56 ` Junio C Hamano
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).