Skip to content

Commit

Permalink
mergetools: add support for smerge (Sublime Merge)
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
davvid authored and gitster committed Apr 4, 2019
1 parent 041f5ea commit eb12adc
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions git-mergetool--lib.sh
Expand Up @@ -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*)
Expand Down
12 changes: 12 additions & 0 deletions 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
}

1 comment on commit eb12adc

@jsbentley34

This comment was marked as off-topic.

Please sign in to comment.