'\" t .\" Title: git-mergetool--lib .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot .\" Date: 02/23/2023 .\" Manual: Git Manual .\" Source: Git 2.39.2 .\" Language: English .\" .TH "GIT\-MERGETOOL\-\-LI" "1" "02/23/2023" "Git 2\&.39\&.2" "Git Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" git-mergetool--lib \- Common Git merge tool shell scriptlets .SH "SYNOPSIS" .sp .nf \fITOOL_MODE=(diff|merge) \&. "$(git \-\-exec\-path)/git\-mergetool\-\-lib"\fR .fi .sp .SH "DESCRIPTION" .sp This is not a command the end user would want to run\&. Ever\&. This documentation is meant for people who are studying the Porcelain\-ish scripts and/or are writing new ones\&. .sp The \fIgit\-mergetool\-\-lib\fR scriptlet is designed to be sourced (using \fB\&.\fR) by other shell scripts to set up functions for working with Git merge tools\&. .sp Before sourcing \fIgit\-mergetool\-\-lib\fR, your script must set \fBTOOL_MODE\fR to define the operation mode for the functions listed below\&. \fIdiff\fR and \fImerge\fR are valid values\&. .SH "FUNCTIONS" .PP get_merge_tool .RS 4 returns a merge tool\&. the return code is 1 if we returned a guessed merge tool, else 0\&. \fI$GIT_MERGETOOL_GUI\fR may be set to \fItrue\fR to search for the appropriate guitool\&. .RE .PP get_merge_tool_cmd .RS 4 returns the custom command for a merge tool\&. .RE .PP get_merge_tool_path .RS 4 returns the custom path for a merge tool\&. .RE .PP initialize_merge_tool .RS 4 bring merge tool specific functions into scope so they can be used or overridden\&. .RE .PP run_merge_tool .RS 4 launches a merge tool given the tool name and a true/false flag to indicate whether a merge base is present\&. \fI$MERGED\fR, \fI$LOCAL\fR, \fI$REMOTE\fR, and \fI$BASE\fR must be defined for use by the merge tool\&. .RE .SH "GIT" .sp Part of the \fBgit\fR(1) suite