git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [PATCH] mergetools: add support for VS Code
@ 2019-06-03 15:03 Wen Bei Li
  2019-06-04 13:45 ` Johannes Schindelin
  0 siblings, 1 reply; 4+ messages in thread
From: Wen Bei Li @ 2019-06-03 15:03 UTC (permalink / raw)
  To: git

Teach difftool and mergetool about VS Code.
---
 git-mergetool--lib.sh | 2 +-
 mergetools/code       | 7 +++++++
 2 files changed, 8 insertions(+), 1 deletion(-)
 create mode 100644 mergetools/code

diff --git a/git-mergetool--lib.sh b/git-mergetool--lib.sh
index 204a5acd66..59512ae673 100644
--- a/git-mergetool--lib.sh
+++ b/git-mergetool--lib.sh
@@ -283,7 +283,7 @@ list_merge_tool_candidates () {
 		fi
 		tools="$tools gvimdiff diffuse diffmerge ecmerge"
 		tools="$tools p4merge araxis bc codecompare"
-		tools="$tools smerge"
+		tools="$tools smerge code"
 	fi
 	case "${VISUAL:-$EDITOR}" in
 	*vim*)
diff --git a/mergetools/code b/mergetools/code
new file mode 100644
index 0000000000..566a0d9d63
--- /dev/null
+++ b/mergetools/code
@@ -0,0 +1,7 @@
+diff_cmd () {
+	"$merge_tool_path" --wait --diff "$LOCAL" "$REMOTE"
+}
+
+merge_cmd () {
+	"$merge_tool_path" --wait "$MERGED"
+}
-- 
2.21.0.windows.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] mergetools: add support for VS Code
  2019-06-03 15:03 [PATCH] mergetools: add support for VS Code Wen Bei Li
@ 2019-06-04 13:45 ` Johannes Schindelin
  2019-06-04 23:21   ` Wen Bei Li
  0 siblings, 1 reply; 4+ messages in thread
From: Johannes Schindelin @ 2019-06-04 13:45 UTC (permalink / raw)
  To: Wen Bei Li; +Cc: git

Hi Wen Bei Li,

On Mon, 3 Jun 2019, Wen Bei Li wrote:

> Teach difftool and mergetool about VS Code.
> ---

Even if it is a very short commit message (see e.g.
https://github.com/git-for-windows/git/commit/581d2fd9f2d6 for a typical
commit message in Git's repository), I think it is okay.

Personally, I would have "lost" a few words about Visual Studio Code and
how popular it is, but probably only because I like it so much (and maybe
nobody wants to hear about that anymore).

However, in the Git project we do ask for your Sign-off:
https://git-scm.com/docs/SubmittingPatches#dco

> diff --git a/git-mergetool--lib.sh b/git-mergetool--lib.sh
> index 204a5acd66..59512ae673 100644
> --- a/git-mergetool--lib.sh
> +++ b/git-mergetool--lib.sh
> @@ -283,7 +283,7 @@ list_merge_tool_candidates () {
>  		fi
>  		tools="$tools gvimdiff diffuse diffmerge ecmerge"
>  		tools="$tools p4merge araxis bc codecompare"
> -		tools="$tools smerge"
> +		tools="$tools smerge code"

Do you also want to add support for `code-insiders`? (That's what I run a
lot of the time because it allows me to develop code in my Windows
Subsystem for Linux while the GUI runs on Windows.)

>  	fi
>  	case "${VISUAL:-$EDITOR}" in
>  	*vim*)
> diff --git a/mergetools/code b/mergetools/code
> new file mode 100644
> index 0000000000..566a0d9d63
> --- /dev/null
> +++ b/mergetools/code
> @@ -0,0 +1,7 @@
> +diff_cmd () {
> +	"$merge_tool_path" --wait --diff "$LOCAL" "$REMOTE"
> +}
> +
> +merge_cmd () {
> +	"$merge_tool_path" --wait "$MERGED"
> +}

This looks good to me!

Thanks,
Johannes

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH] mergetools: add support for VS Code
  2019-06-04 13:45 ` Johannes Schindelin
@ 2019-06-04 23:21   ` Wen Bei Li
  2019-06-05 12:08     ` Johannes Schindelin
  0 siblings, 1 reply; 4+ messages in thread
From: Wen Bei Li @ 2019-06-04 23:21 UTC (permalink / raw)
  To: johannes.schindelin; +Cc: git

Teach difftool and mergetool about VS Code and VS Code Insiders

Signed-off-by: Wen Bei Li <wenbei123@gmail.com>
---
Hello Johannes, thank you for reviewing my patch. It's the first time I've done this via email.
I've added `code-insiders` as you suggested, but I wasn't sure if I should send it as a v2.
I used this commit as a reference: 
https://github.com/git/git/commit/5116eab70bf8a0c8b1c29a09c4b932c4d1cf2701

 contrib/completion/git-completion.bash | 2 +-
 git-mergetool--lib.sh                  | 2 +-
 mergetools/code                        | 7 +++++++
 mergetools/code-insiders               | 7 +++++++
 4 files changed, 16 insertions(+), 2 deletions(-)
 create mode 100644 mergetools/code
 create mode 100644 mergetools/code-insiders

diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index 3eefbabdb1..6eaa0df5b2 100644
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -1502,7 +1502,7 @@ _git_diff ()
 
 __git_mergetools_common="diffuse diffmerge ecmerge emerge kdiff3 meld opendiff
 			tkdiff vimdiff gvimdiff xxdiff araxis p4merge bc
-			codecompare smerge
+			codecompare smerge code code-insiders
 "
 
 _git_difftool ()
diff --git a/git-mergetool--lib.sh b/git-mergetool--lib.sh
index 204a5acd66..44f1967c84 100644
--- a/git-mergetool--lib.sh
+++ b/git-mergetool--lib.sh
@@ -283,7 +283,7 @@ list_merge_tool_candidates () {
 		fi
 		tools="$tools gvimdiff diffuse diffmerge ecmerge"
 		tools="$tools p4merge araxis bc codecompare"
-		tools="$tools smerge"
+		tools="$tools smerge code code-insiders"
 	fi
 	case "${VISUAL:-$EDITOR}" in
 	*vim*)
diff --git a/mergetools/code b/mergetools/code
new file mode 100644
index 0000000000..566a0d9d63
--- /dev/null
+++ b/mergetools/code
@@ -0,0 +1,7 @@
+diff_cmd () {
+	"$merge_tool_path" --wait --diff "$LOCAL" "$REMOTE"
+}
+
+merge_cmd () {
+	"$merge_tool_path" --wait "$MERGED"
+}
diff --git a/mergetools/code-insiders b/mergetools/code-insiders
new file mode 100644
index 0000000000..566a0d9d63
--- /dev/null
+++ b/mergetools/code-insiders
@@ -0,0 +1,7 @@
+diff_cmd () {
+	"$merge_tool_path" --wait --diff "$LOCAL" "$REMOTE"
+}
+
+merge_cmd () {
+	"$merge_tool_path" --wait "$MERGED"
+}
-- 
2.21.0.windows.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] mergetools: add support for VS Code
  2019-06-04 23:21   ` Wen Bei Li
@ 2019-06-05 12:08     ` Johannes Schindelin
  0 siblings, 0 replies; 4+ messages in thread
From: Johannes Schindelin @ 2019-06-05 12:08 UTC (permalink / raw)
  To: Wen Bei Li; +Cc: git

Hi Wen Bei Li,

On Tue, 4 Jun 2019, Wen Bei Li wrote:

> Teach difftool and mergetool about VS Code and VS Code Insiders
>
> Signed-off-by: Wen Bei Li <wenbei123@gmail.com>
> ---
> Hello Johannes, thank you for reviewing my patch. It's the first time
> I've done this via email.

Heh, I hear you. It makes me happy that we still can get contributions
despite the slight hurdle to do it by email.

> I've added `code-insiders` as you suggested, but I wasn't sure if I
> should send it as a v2.

Well, since this is the second revision of your patch, it *is* a v2,
whether you mark it as such or not ;-)

> diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
> index 3eefbabdb1..6eaa0df5b2 100644
> --- a/contrib/completion/git-completion.bash
> +++ b/contrib/completion/git-completion.bash
> @@ -1502,7 +1502,7 @@ _git_diff ()
>
>  __git_mergetools_common="diffuse diffmerge ecmerge emerge kdiff3 meld opendiff
>  			tkdiff vimdiff gvimdiff xxdiff araxis p4merge bc
> -			codecompare smerge
> +			codecompare smerge code code-insiders
>  "
>
>  _git_difftool ()
> diff --git a/git-mergetool--lib.sh b/git-mergetool--lib.sh
> index 204a5acd66..44f1967c84 100644
> --- a/git-mergetool--lib.sh
> +++ b/git-mergetool--lib.sh
> @@ -283,7 +283,7 @@ list_merge_tool_candidates () {
>  		fi
>  		tools="$tools gvimdiff diffuse diffmerge ecmerge"
>  		tools="$tools p4merge araxis bc codecompare"
> -		tools="$tools smerge"
> +		tools="$tools smerge code code-insiders"
>  	fi
>  	case "${VISUAL:-$EDITOR}" in
>  	*vim*)
> diff --git a/mergetools/code b/mergetools/code
> new file mode 100644
> index 0000000000..566a0d9d63
> --- /dev/null
> +++ b/mergetools/code
> @@ -0,0 +1,7 @@
> +diff_cmd () {
> +	"$merge_tool_path" --wait --diff "$LOCAL" "$REMOTE"
> +}
> +
> +merge_cmd () {
> +	"$merge_tool_path" --wait "$MERGED"
> +}
> diff --git a/mergetools/code-insiders b/mergetools/code-insiders
> new file mode 100644
> index 0000000000..566a0d9d63
> --- /dev/null
> +++ b/mergetools/code-insiders
> @@ -0,0 +1,7 @@
> +diff_cmd () {
> +	"$merge_tool_path" --wait --diff "$LOCAL" "$REMOTE"
> +}
> +
> +merge_cmd () {
> +	"$merge_tool_path" --wait "$MERGED"
> +}

This looks good to me, thank you!
Johannes

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-06-05 12:09 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-03 15:03 [PATCH] mergetools: add support for VS Code Wen Bei Li
2019-06-04 13:45 ` Johannes Schindelin
2019-06-04 23:21   ` Wen Bei Li
2019-06-05 12:08     ` Johannes Schindelin

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).