Merge branch 'da/smerge'

"git mergetool" learned to offer Sublime Merge (smerge) as one of
its backends.

* da/smerge:
  contrib/completion: add smerge to the mergetool completion candidates
  mergetools: add support for smerge (Sublime Merge)
This commit is contained in:
Junio C Hamano 2019-04-22 11:14:48 +09:00
commit 5116eab70b
3 changed files with 15 additions and 1 deletions

View File

@ -1501,7 +1501,8 @@ _git_diff ()
}
__git_mergetools_common="diffuse diffmerge ecmerge emerge kdiff3 meld opendiff
tkdiff vimdiff gvimdiff xxdiff araxis p4merge bc codecompare
tkdiff vimdiff gvimdiff xxdiff araxis p4merge bc
codecompare smerge
"
_git_difftool ()

View File

@ -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*)

12
mergetools/smerge Normal file
View File

@ -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
}