{"thread":{"id":"50871","subject":"[PATCH 1/2] mergetools: add support for smerge (Sublime Merge)","startedAt":"2019-04-04T07:34:43Z","lastAt":"2019-04-04T07:34:45Z","messageCount":2,"participants":["David Aguilar"],"isPatch":true,"patchVersion":1,"patchTotal":2},"messages":[{"id":"373093","messageId":"20190404073439.9558-1-davvid@gmail.com","threadId":"50871","inReplyTo":null,"subject":"[PATCH 1/2] mergetools: add support for smerge (Sublime Merge)","fromName":"David Aguilar","fromEmail":"davvid@gmail.com","sentAt":"2019-04-04T07:34:38Z","receivedAt":"2019-04-04T07:34:43Z","isPatch":true,"sender":{"key":"davvid@gmail.com","avatar":"https://avatars.githubusercontent.com/u/13196?v=4"},"body":"Teach difftool and mergetool about the Sublime Merge \"smerge\" command.\n\nSigned-off-by: David Aguilar <davvid@gmail.com>\n---\n git-mergetool--lib.sh |  1 +\n mergetools/smerge     | 12 ++++++++++++\n 2 files changed, 13 insertions(+)\n create mode 100644 mergetools/smerge\n\ndiff --git a/git-mergetool--lib.sh b/git-mergetool--lib.sh\nindex 83bf52494c..aaa4eed0bc 100644\n--- a/git-mergetool--lib.sh\n+++ b/git-mergetool--lib.sh\n@@ -279,6 +279,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 \tfi\n \tcase \"${VISUAL:-$EDITOR}\" in\n \t*vim*)\ndiff --git a/mergetools/smerge b/mergetools/smerge\nnew file mode 100644\nindex 0000000000..9c2e6f6fd7\n--- /dev/null\n+++ b/mergetools/smerge\n@@ -0,0 +1,12 @@\n+diff_cmd () {\n+\t\"$merge_tool_path\" mergetool \"$LOCAL\" \"$REMOTE\" -o \"$MERGED\"\n+}\n+\n+merge_cmd () {\n+\tif $base_present\n+\tthen\n+\t\t\"$merge_tool_path\" mergetool \"$BASE\" \"$LOCAL\" \"$REMOTE\" -o \"$MERGED\"\n+\telse\n+\t\t\"$merge_tool_path\" mergetool \"$LOCAL\" \"$REMOTE\" -o \"$MERGED\"\n+\tfi\n+}\n-- \n2.21.0.198.gfad8868f4e\n\n"},{"id":"373094","messageId":"20190404073439.9558-2-davvid@gmail.com","threadId":"50871","inReplyTo":"20190404073439.9558-1-davvid@gmail.com","subject":"[PATCH 2/2] contrib/completion: add smerge to the mergetool completion candidates","fromName":"David Aguilar","fromEmail":"davvid@gmail.com","sentAt":"2019-04-04T07:34:39Z","receivedAt":"2019-04-04T07:34:45Z","isPatch":true,"sender":{"key":"davvid@gmail.com","avatar":"https://avatars.githubusercontent.com/u/13196?v=4"},"body":"Signed-off-by: David Aguilar <davvid@gmail.com>\n---\n contrib/completion/git-completion.bash | 3 ++-\n 1 file changed, 2 insertions(+), 1 deletion(-)\n\ndiff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash\nindex 976e4a6548..b6d69bcaeb 100644\n--- a/contrib/completion/git-completion.bash\n+++ b/contrib/completion/git-completion.bash\n@@ -1501,7 +1501,8 @@ _git_diff ()\n }\n \n __git_mergetools_common=\"diffuse diffmerge ecmerge emerge kdiff3 meld opendiff\n-\t\t\ttkdiff vimdiff gvimdiff xxdiff araxis p4merge bc codecompare\n+\t\t\ttkdiff vimdiff gvimdiff xxdiff araxis p4merge bc\n+\t\t\tcodecompare smerge\n \"\n \n _git_difftool ()\n-- \n2.21.0.198.gfad8868f4e\n\n"}]}