{"thread":{"id":"51227","subject":"[PATCH] mergetools: add support for VS Code","startedAt":"2019-06-03T15:03:21Z","lastAt":"2019-06-05T12:09:00Z","messageCount":4,"participants":["Wen Bei Li","Johannes Schindelin"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"376571","messageId":"20190603150315.16032-1-wenbei123@gmail.com","threadId":"51227","inReplyTo":null,"subject":"[PATCH] mergetools: add support for VS Code","fromName":"Wen Bei Li","fromEmail":"wenbei123@gmail.com","sentAt":"2019-06-03T15:03:15Z","receivedAt":"2019-06-03T15:03:21Z","isPatch":true,"sender":{"key":"wenbei123@gmail.com","avatar":null},"body":"Teach difftool and mergetool about VS Code.\n---\n git-mergetool--lib.sh | 2 +-\n mergetools/code       | 7 +++++++\n 2 files changed, 8 insertions(+), 1 deletion(-)\n create mode 100644 mergetools/code\n\ndiff --git a/git-mergetool--lib.sh b/git-mergetool--lib.sh\nindex 204a5acd66..59512ae673 100644\n--- a/git-mergetool--lib.sh\n+++ b/git-mergetool--lib.sh\n@@ -283,7 +283,7 @@ list_merge_tool_candidates () {\n \t\tfi\n \t\ttools=\"$tools gvimdiff diffuse diffmerge ecmerge\"\n \t\ttools=\"$tools p4merge araxis bc codecompare\"\n-\t\ttools=\"$tools smerge\"\n+\t\ttools=\"$tools smerge code\"\n \tfi\n \tcase \"${VISUAL:-$EDITOR}\" in\n \t*vim*)\ndiff --git a/mergetools/code b/mergetools/code\nnew file mode 100644\nindex 0000000000..566a0d9d63\n--- /dev/null\n+++ b/mergetools/code\n@@ -0,0 +1,7 @@\n+diff_cmd () {\n+\t\"$merge_tool_path\" --wait --diff \"$LOCAL\" \"$REMOTE\"\n+}\n+\n+merge_cmd () {\n+\t\"$merge_tool_path\" --wait \"$MERGED\"\n+}\n-- \n2.21.0.windows.1\n\n"},{"id":"376656","messageId":"nycvar.QRO.7.76.6.1906041542050.1775@tvgsbejvaqbjf.bet","threadId":"51227","inReplyTo":"20190603150315.16032-1-wenbei123@gmail.com","subject":"Re: [PATCH] mergetools: add support for VS Code","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2019-06-04T13:45:36Z","receivedAt":"2019-06-04T13:45:54Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi Wen Bei Li,\n\nOn Mon, 3 Jun 2019, Wen Bei Li wrote:\n\n> Teach difftool and mergetool about VS Code.\n> ---\n\nEven if it is a very short commit message (see e.g.\nhttps://github.com/git-for-windows/git/commit/581d2fd9f2d6 for a typical\ncommit message in Git's repository), I think it is okay.\n\nPersonally, I would have \"lost\" a few words about Visual Studio Code and\nhow popular it is, but probably only because I like it so much (and maybe\nnobody wants to hear about that anymore).\n\nHowever, in the Git project we do ask for your Sign-off:\nhttps://git-scm.com/docs/SubmittingPatches#dco\n\n> diff --git a/git-mergetool--lib.sh b/git-mergetool--lib.sh\n> index 204a5acd66..59512ae673 100644\n> --- a/git-mergetool--lib.sh\n> +++ b/git-mergetool--lib.sh\n> @@ -283,7 +283,7 @@ list_merge_tool_candidates () {\n>  \t\tfi\n>  \t\ttools=\"$tools gvimdiff diffuse diffmerge ecmerge\"\n>  \t\ttools=\"$tools p4merge araxis bc codecompare\"\n> -\t\ttools=\"$tools smerge\"\n> +\t\ttools=\"$tools smerge code\"\n\nDo you also want to add support for `code-insiders`? (That's what I run a\nlot of the time because it allows me to develop code in my Windows\nSubsystem for Linux while the GUI runs on Windows.)\n\n>  \tfi\n>  \tcase \"${VISUAL:-$EDITOR}\" in\n>  \t*vim*)\n> diff --git a/mergetools/code b/mergetools/code\n> new file mode 100644\n> index 0000000000..566a0d9d63\n> --- /dev/null\n> +++ b/mergetools/code\n> @@ -0,0 +1,7 @@\n> +diff_cmd () {\n> +\t\"$merge_tool_path\" --wait --diff \"$LOCAL\" \"$REMOTE\"\n> +}\n> +\n> +merge_cmd () {\n> +\t\"$merge_tool_path\" --wait \"$MERGED\"\n> +}\n\nThis looks good to me!\n\nThanks,\nJohannes\n"},{"id":"376700","messageId":"20190604232134.14748-1-wenbei123@gmail.com","threadId":"51227","inReplyTo":"nycvar.QRO.7.76.6.1906041542050.1775@tvgsbejvaqbjf.bet","subject":"[PATCH] mergetools: add support for VS Code","fromName":"Wen Bei Li","fromEmail":"wenbei123@gmail.com","sentAt":"2019-06-04T23:21:34Z","receivedAt":"2019-06-04T23:21:46Z","isPatch":true,"sender":{"key":"wenbei123@gmail.com","avatar":null},"body":"Teach difftool and mergetool about VS Code and VS Code Insiders\n\nSigned-off-by: Wen Bei Li <wenbei123@gmail.com>\n---\nHello Johannes, thank you for reviewing my patch. It's the first time I've done this via email.\nI've added `code-insiders` as you suggested, but I wasn't sure if I should send it as a v2.\nI used this commit as a reference: \nhttps://github.com/git/git/commit/5116eab70bf8a0c8b1c29a09c4b932c4d1cf2701\n\n contrib/completion/git-completion.bash | 2 +-\n git-mergetool--lib.sh                  | 2 +-\n mergetools/code                        | 7 +++++++\n mergetools/code-insiders               | 7 +++++++\n 4 files changed, 16 insertions(+), 2 deletions(-)\n create mode 100644 mergetools/code\n create mode 100644 mergetools/code-insiders\n\ndiff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash\nindex 3eefbabdb1..6eaa0df5b2 100644\n--- a/contrib/completion/git-completion.bash\n+++ b/contrib/completion/git-completion.bash\n@@ -1502,7 +1502,7 @@ _git_diff ()\n \n __git_mergetools_common=\"diffuse diffmerge ecmerge emerge kdiff3 meld opendiff\n \t\t\ttkdiff vimdiff gvimdiff xxdiff araxis p4merge bc\n-\t\t\tcodecompare smerge\n+\t\t\tcodecompare smerge code code-insiders\n \"\n \n _git_difftool ()\ndiff --git a/git-mergetool--lib.sh b/git-mergetool--lib.sh\nindex 204a5acd66..44f1967c84 100644\n--- a/git-mergetool--lib.sh\n+++ b/git-mergetool--lib.sh\n@@ -283,7 +283,7 @@ list_merge_tool_candidates () {\n \t\tfi\n \t\ttools=\"$tools gvimdiff diffuse diffmerge ecmerge\"\n \t\ttools=\"$tools p4merge araxis bc codecompare\"\n-\t\ttools=\"$tools smerge\"\n+\t\ttools=\"$tools smerge code code-insiders\"\n \tfi\n \tcase \"${VISUAL:-$EDITOR}\" in\n \t*vim*)\ndiff --git a/mergetools/code b/mergetools/code\nnew file mode 100644\nindex 0000000000..566a0d9d63\n--- /dev/null\n+++ b/mergetools/code\n@@ -0,0 +1,7 @@\n+diff_cmd () {\n+\t\"$merge_tool_path\" --wait --diff \"$LOCAL\" \"$REMOTE\"\n+}\n+\n+merge_cmd () {\n+\t\"$merge_tool_path\" --wait \"$MERGED\"\n+}\ndiff --git a/mergetools/code-insiders b/mergetools/code-insiders\nnew file mode 100644\nindex 0000000000..566a0d9d63\n--- /dev/null\n+++ b/mergetools/code-insiders\n@@ -0,0 +1,7 @@\n+diff_cmd () {\n+\t\"$merge_tool_path\" --wait --diff \"$LOCAL\" \"$REMOTE\"\n+}\n+\n+merge_cmd () {\n+\t\"$merge_tool_path\" --wait \"$MERGED\"\n+}\n-- \n2.21.0.windows.1\n\n"},{"id":"376710","messageId":"nycvar.QRO.7.76.6.1906051406550.1775@tvgsbejvaqbjf.bet","threadId":"51227","inReplyTo":"20190604232134.14748-1-wenbei123@gmail.com","subject":"Re: [PATCH] mergetools: add support for VS Code","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2019-06-05T12:08:39Z","receivedAt":"2019-06-05T12:09:00Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi Wen Bei Li,\n\nOn Tue, 4 Jun 2019, Wen Bei Li wrote:\n\n> Teach difftool and mergetool about VS Code and VS Code Insiders\n>\n> Signed-off-by: Wen Bei Li <wenbei123@gmail.com>\n> ---\n> Hello Johannes, thank you for reviewing my patch. It's the first time\n> I've done this via email.\n\nHeh, I hear you. It makes me happy that we still can get contributions\ndespite the slight hurdle to do it by email.\n\n> I've added `code-insiders` as you suggested, but I wasn't sure if I\n> should send it as a v2.\n\nWell, since this is the second revision of your patch, it *is* a v2,\nwhether you mark it as such or not ;-)\n\n> diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash\n> index 3eefbabdb1..6eaa0df5b2 100644\n> --- a/contrib/completion/git-completion.bash\n> +++ b/contrib/completion/git-completion.bash\n> @@ -1502,7 +1502,7 @@ _git_diff ()\n>\n>  __git_mergetools_common=\"diffuse diffmerge ecmerge emerge kdiff3 meld opendiff\n>  \t\t\ttkdiff vimdiff gvimdiff xxdiff araxis p4merge bc\n> -\t\t\tcodecompare smerge\n> +\t\t\tcodecompare smerge code code-insiders\n>  \"\n>\n>  _git_difftool ()\n> diff --git a/git-mergetool--lib.sh b/git-mergetool--lib.sh\n> index 204a5acd66..44f1967c84 100644\n> --- a/git-mergetool--lib.sh\n> +++ b/git-mergetool--lib.sh\n> @@ -283,7 +283,7 @@ list_merge_tool_candidates () {\n>  \t\tfi\n>  \t\ttools=\"$tools gvimdiff diffuse diffmerge ecmerge\"\n>  \t\ttools=\"$tools p4merge araxis bc codecompare\"\n> -\t\ttools=\"$tools smerge\"\n> +\t\ttools=\"$tools smerge code code-insiders\"\n>  \tfi\n>  \tcase \"${VISUAL:-$EDITOR}\" in\n>  \t*vim*)\n> diff --git a/mergetools/code b/mergetools/code\n> new file mode 100644\n> index 0000000000..566a0d9d63\n> --- /dev/null\n> +++ b/mergetools/code\n> @@ -0,0 +1,7 @@\n> +diff_cmd () {\n> +\t\"$merge_tool_path\" --wait --diff \"$LOCAL\" \"$REMOTE\"\n> +}\n> +\n> +merge_cmd () {\n> +\t\"$merge_tool_path\" --wait \"$MERGED\"\n> +}\n> diff --git a/mergetools/code-insiders b/mergetools/code-insiders\n> new file mode 100644\n> index 0000000000..566a0d9d63\n> --- /dev/null\n> +++ b/mergetools/code-insiders\n> @@ -0,0 +1,7 @@\n> +diff_cmd () {\n> +\t\"$merge_tool_path\" --wait --diff \"$LOCAL\" \"$REMOTE\"\n> +}\n> +\n> +merge_cmd () {\n> +\t\"$merge_tool_path\" --wait \"$MERGED\"\n> +}\n\nThis looks good to me, thank you!\nJohannes\n"}]}