blob: 3e8f59ac0e46abc35b88723492fa2d411b2756ca [file] [log] [blame]
Junio C Hamano28394782010-08-23 14:20:25 -07001git-mergetool{litdd}lib(1)
2==========================
David Aguilar21d0ba72009-04-08 00:17:20 -07003
4NAME
5----
Thomas Ackermann2de9b712013-01-21 20:17:53 +01006git-mergetool--lib - Common Git merge tool shell scriptlets
David Aguilar21d0ba72009-04-08 00:17:20 -07007
8SYNOPSIS
9--------
Martin von Zweigbergk7791a1d2011-07-01 22:38:26 -040010[verse]
Jonathan Nieder565e1352011-06-29 00:35:10 -050011'TOOL_MODE=(diff|merge) . "$(git --exec-path)/git-mergetool{litdd}lib"'
David Aguilar21d0ba72009-04-08 00:17:20 -070012
13DESCRIPTION
14-----------
15
16This is not a command the end user would want to run. Ever.
17This documentation is meant for people who are studying the
18Porcelain-ish scripts and/or are writing new ones.
19
Junio C Hamano28394782010-08-23 14:20:25 -070020The 'git-mergetool{litdd}lib' scriptlet is designed to be sourced (using
David Aguilar21d0ba72009-04-08 00:17:20 -070021`.`) by other shell scripts to set up functions for working
Thomas Ackermann2de9b712013-01-21 20:17:53 +010022with Git merge tools.
David Aguilar21d0ba72009-04-08 00:17:20 -070023
Junio C Hamano28394782010-08-23 14:20:25 -070024Before sourcing 'git-mergetool{litdd}lib', your script must set `TOOL_MODE`
David Aguilar47d65922009-04-11 20:41:56 -070025to define the operation mode for the functions listed below.
26'diff' and 'merge' are valid values.
David Aguilar21d0ba72009-04-08 00:17:20 -070027
28FUNCTIONS
29---------
30get_merge_tool::
Denton Liu05fb8722019-04-29 02:21:08 -040031 returns a merge tool. the return code is 1 if we returned a guessed
32 merge tool, else 0. '$GIT_MERGETOOL_GUI' may be set to 'true' to
33 search for the appropriate guitool.
David Aguilar21d0ba72009-04-08 00:17:20 -070034
35get_merge_tool_cmd::
36 returns the custom command for a merge tool.
37
38get_merge_tool_path::
39 returns the custom path for a merge tool.
40
Seth Housede8dafb2021-02-09 13:07:11 -070041initialize_merge_tool::
42 bring merge tool specific functions into scope so they can be used or
43 overridden.
44
David Aguilar21d0ba72009-04-08 00:17:20 -070045run_merge_tool::
46 launches a merge tool given the tool name and a true/false
47 flag to indicate whether a merge base is present.
David Aguilar47d65922009-04-11 20:41:56 -070048 '$MERGED', '$LOCAL', '$REMOTE', and '$BASE' must be defined
49 for use by the merge tool.
David Aguilar21d0ba72009-04-08 00:17:20 -070050
David Aguilar21d0ba72009-04-08 00:17:20 -070051GIT
52---
53Part of the linkgit:git[1] suite