Commit f35ec546 authored by David Aguilar's avatar David Aguilar Committed by Junio C Hamano

doc: generate a list of valid merge tools

Use the show_tool_names() function to build lists of all
the built-in tools supported by difftool and mergetool.
This frees us from needing to update the documentation
whenever a new tool is added.
Signed-off-by: David Aguilar's avatarDavid Aguilar <>
Signed-off-by: 's avatarJunio C Hamano <>
parent 665682c9
......@@ -9,4 +9,5 @@
......@@ -202,7 +202,11 @@ install-html: html
# Determine "include::" file references in asciidoc files.
doc.dep : $(wildcard *.txt) build-docdep.perl
docdep_prereqs = \
mergetools-list.made $(mergetools_txt) \
cmd-list.made $(cmds_txt)
doc.dep : $(docdep_prereqs) $(wildcard *.txt) build-docdep.perl
$(QUIET_GEN)$(RM) $@+ $@ && \
$(PERL_PATH) ./build-docdep.perl >$@+ $(QUIET_STDERR) && \
mv $@+ $@
......@@ -226,13 +230,27 @@ cmd-list.made: cmd-list.perl ../command-list.txt $(MAN1_TXT)
$(PERL_PATH) ./cmd-list.perl ../command-list.txt $(QUIET_STDERR) && \
date >$@
mergetools_txt = mergetools-diff.txt mergetools-merge.txt
$(mergetools_txt): mergetools-list.made
mergetools-list.made: ../ $(wildcard ../mergetools/*)
$(QUIET_GEN)$(RM) $@ && \
$(SHELL_PATH) -c 'MERGE_TOOLS_DIR=../mergetools && \
. ../ && \
show_tool_names can_diff "* " || :' >mergetools-diff.txt && \
$(SHELL_PATH) -c 'MERGE_TOOLS_DIR=../mergetools && \
. ../ && \
show_tool_names can_merge "* " || :' >mergetools-merge.txt && \
date >$@
$(RM) *.xml *.xml+ *.html *.html+ *.1 *.5 *.7
$(RM) *.texi *.texi+ *.texi++
$(RM) *.pdf
$(RM) howto-index.txt howto/*.html doc.dep
$(RM) technical/api-*.html technical/api-index.txt
$(RM) $(cmds_txt) *.made
$(RM) $(cmds_txt) $(mergetools_txt) *.made
$(RM) manpage-base-url.xsl
$(MAN_HTML): %.html : %.txt
......@@ -132,9 +132,10 @@ diff.<driver>.cachetextconv::
conversion outputs. See linkgit:gitattributes[5] for details.
The diff tool to be used by linkgit:git-difftool[1]. This
option overrides `merge.tool`, and has the same valid built-in
values as `merge.tool` minus "tortoisemerge" and plus
"kompare". Any other value is treated as a custom diff tool,
and there must be a corresponding `difftool.<tool>.cmd`
Controls which diff tool is used by linkgit:git-difftool[1].
This variable overrides the value configured in `merge.tool`.
The list below shows the valid built-in values.
Any other value is treated as a custom diff tool and requires
that a corresponding difftool.<tool>.cmd variable is defined.
......@@ -52,12 +52,12 @@ merge.stat::
at the end of the merge. True by default.
Controls which merge resolution program is used by
linkgit:git-mergetool[1]. Valid built-in values are: "araxis",
"bc3", "diffuse", "ecmerge", "emerge", "gvimdiff", "kdiff3", "meld",
"opendiff", "p4merge", "tkdiff", "tortoisemerge", "vimdiff"
and "xxdiff". Any other value is treated is custom merge tool
and there must be a corresponding mergetool.<tool>.cmd option.
Controls which merge tool is used by linkgit:git-mergetool[1].
The list below shows the valid built-in values.
Any other value is treated as a custom merge tool and requires
that a corresponding mergetool.<tool>.cmd variable is defined.
Controls the amount of output shown by the recursive merge
# git-mergetool--lib is a library for common merge tool functions
MERGE_TOOLS_DIR=$(git --exec-path)/mergetools
: ${MERGE_TOOLS_DIR=$(git --exec-path)/mergetools}
mode_ok () {
if diff_mode
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment