summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Aguilar <davvid@gmail.com>2019-04-04 09:34:38 +0200
committerJunio C Hamano <gitster@pobox.com>2019-04-04 11:21:25 +0200
commiteb12adc74cf22add318f884072be2071d181abaa (patch)
tree7ed1a9baea8d2cb6a57472b647f1c009fe9c61bc
parentThe third batch (diff)
downloadgit-eb12adc74cf22add318f884072be2071d181abaa.tar.xz
git-eb12adc74cf22add318f884072be2071d181abaa.zip
mergetools: add support for smerge (Sublime Merge)
Teach difftool and mergetool about the Sublime Merge "smerge" command. Signed-off-by: David Aguilar <davvid@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rw-r--r--git-mergetool--lib.sh1
-rw-r--r--mergetools/smerge12
2 files changed, 13 insertions, 0 deletions
diff --git a/git-mergetool--lib.sh b/git-mergetool--lib.sh
index 83bf52494c..aaa4eed0bc 100644
--- a/git-mergetool--lib.sh
+++ b/git-mergetool--lib.sh
@@ -279,6 +279,7 @@ list_merge_tool_candidates () {
fi
tools="$tools gvimdiff diffuse diffmerge ecmerge"
tools="$tools p4merge araxis bc codecompare"
+ tools="$tools smerge"
fi
case "${VISUAL:-$EDITOR}" in
*vim*)
diff --git a/mergetools/smerge b/mergetools/smerge
new file mode 100644
index 0000000000..9c2e6f6fd7
--- /dev/null
+++ b/mergetools/smerge
@@ -0,0 +1,12 @@
+diff_cmd () {
+ "$merge_tool_path" mergetool "$LOCAL" "$REMOTE" -o "$MERGED"
+}
+
+merge_cmd () {
+ if $base_present
+ then
+ "$merge_tool_path" mergetool "$BASE" "$LOCAL" "$REMOTE" -o "$MERGED"
+ else
+ "$merge_tool_path" mergetool "$LOCAL" "$REMOTE" -o "$MERGED"
+ fi
+}