From: Junio C Hamano Date: Mon, 7 May 2012 20:28:44 +0000 (-0700) Subject: Merge branch 'th/difftool-diffall' X-Git-Tag: v1.7.11-rc0~55 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/cae097722162c852ab81c50efe8b25a84b6a5dff?ds=inline;hp=-c Merge branch 'th/difftool-diffall' Rolls the two-directory-diff logic from diffall script (in contrib/) into "git difftool" framework. By Tim Henigan * th/difftool-diffall: difftool: print list of valid tools with '--tool-help' difftool: teach difftool to handle directory diffs difftool: eliminate setup_environment function difftool: stop appending '.exe' to git difftool: remove explicit change of PATH difftool: exit(0) when usage is printed difftool: add '--no-gui' option difftool: parse options using Getopt::Long --- cae097722162c852ab81c50efe8b25a84b6a5dff diff --combined t/t7800-difftool.sh index 2763d795f0,bbe71e5f73..9c3e997b9d --- a/t/t7800-difftool.sh +++ b/t/t7800-difftool.sh @@@ -83,17 -83,6 +83,17 @@@ test_expect_success PERL 'difftool igno test "$diff" = "" ' +test_expect_success PERL 'difftool forwards arguments to diff' ' + >for-diff && + git add for-diff && + echo changes>for-diff && + git add for-diff && + diff=$(git difftool --cached --no-prompt -- for-diff) && + test "$diff" = "" && + git reset -- for-diff && + rm for-diff +' + test_expect_success PERL 'difftool honors --gui' ' git config merge.tool bogus-tool && git config diff.tool bogus-tool && @@@ -105,6 -94,19 +105,19 @@@ restore_test_defaults ' + test_expect_success PERL 'difftool --gui last setting wins' ' + git config diff.guitool bogus-tool && + git difftool --no-prompt --gui --no-gui && + + git config merge.tool bogus-tool && + git config diff.tool bogus-tool && + git config diff.guitool test-tool && + diff=$(git difftool --no-prompt --no-gui --gui branch) && + test "$diff" = "branch" && + + restore_test_defaults + ' + test_expect_success PERL 'difftool --gui works without configured diff.guitool' ' git config diff.tool test-tool && @@@ -317,4 -319,48 +330,48 @@@ test_expect_success PERL 'say no to th 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 && + echo master >sub/sub && + git add sub/sub && + git commit -m "added sub/sub" && + echo test >>file && + echo test >>sub/sub && + git add . && + git commit -m "modified both" + ' + + test_expect_success PERL 'difftool -d' ' + diff=$(git difftool -d --extcmd ls branch) && + echo "$diff" | stdin_contains sub && + echo "$diff" | stdin_contains file + ' + + test_expect_success PERL 'difftool --dir-diff' ' + diff=$(git difftool --dir-diff --extcmd ls branch) && + echo "$diff" | stdin_contains sub && + echo "$diff" | stdin_contains file + ' + + test_expect_success PERL 'difftool --dir-diff ignores --prompt' ' + diff=$(git difftool --dir-diff --prompt --extcmd ls branch) && + echo "$diff" | stdin_contains sub && + echo "$diff" | stdin_contains file + ' + + test_expect_success PERL 'difftool --dir-diff from subdirectory' ' + ( + cd sub && + diff=$(git difftool --dir-diff --extcmd ls branch) && + echo "$diff" | stdin_contains sub && + echo "$diff" | stdin_contains file + ) + ' + test_done