aboutsummaryrefslogtreecommitdiff
path: root/t/t7800-difftool.sh
diff options
context:
space:
mode:
authorTim Henigan <tim.henigan@gmail.com>2012-03-29 09:39:18 -0400
committerJunio C Hamano <gitster@pobox.com>2012-04-23 12:00:42 -0700
commitbf73fc212a159210398b6d46ed5e9101c650e7db (patch)
tree9f53002fc3812a60ff11368b17cfbcd6d89b76c3 /t/t7800-difftool.sh
parent7e0abcec103b3649943b236881cf88e8fd6cf3a4 (diff)
downloadgit-bf73fc212a159210398b6d46ed5e9101c650e7db.tar.gz
git-bf73fc212a159210398b6d46ed5e9101c650e7db.tar.xz
difftool: print list of valid tools with '--tool-help'
Since bc7a96a (mergetool--lib: Refactor tools into separate files, 2011-08-18), it is possible to add a new diff tool by creating a simple script in the '$(git --exec-path)/mergetools' directory. Updating the difftool help text is still a manual process, and the documentation can easily go out of sync. This commit teaches difftool the '--tool-help' option, which: - Reads the list of valid tools from 'mergetools/*' - Determines which of them are actually installed - Determines which are capable of diffing (i.e. not just a merge tool) - Prints the resulting list for the user Signed-off-by: Tim Henigan <tim.henigan@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t7800-difftool.sh')
-rwxr-xr-xt/t7800-difftool.sh5
1 files changed, 5 insertions, 0 deletions
diff --git a/t/t7800-difftool.sh b/t/t7800-difftool.sh
index 478c1bef3..bbe71e5f7 100755
--- a/t/t7800-difftool.sh
+++ b/t/t7800-difftool.sh
@@ -319,6 +319,11 @@ test_expect_success PERL 'say no to the second file' '
echo "$diff" | stdin_doesnot_contain br2
'
+test_expect_success PERL 'difftool --tool-help' '
+ tool_help=$(git difftool --tool-help) &&
+ echo "$tool_help" | stdin_contains tool
+'
+
test_expect_success PERL 'setup change in subdirectory' '
git checkout master &&
mkdir sub &&