summaryrefslogtreecommitdiff
path: root/t/t7800-difftool.sh
AgeCommit message (Collapse)AuthorFilesLines
2012-09-25mergetool--lib: Allow custom commands to override built-insLibravatar David Aguilar1-0/+11
Allow users to override the default commands provided by the mergetools/* scriptlets. Users occasionally run into problems where they expect to be able to override the built-in tool names. The documentation does not explicitly mention that built-ins cannot be overridden, so it's easy to assume that it should work. Lift this restriction so that built-in tools are handled the same way as user-configured tools. Add tests to guarantee this behavior. A nice benefit of this change is that it protects users from having future versions of git trump their custom configuration with a new built-in tool. C.f.: http://stackoverflow.com/questions/7435002/mergetool-from-gitconfig-being-ignored http://thread.gmane.org/gmane.comp.version-control.msysgit/13188 http://thread.gmane.org/gmane.comp.version-control.git/148267 Signed-off-by: David Aguilar <davvid@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-05-07Merge branch 'th/difftool-diffall'Libravatar Junio C Hamano1-0/+57
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
2012-04-23difftool: print list of valid tools with '--tool-help'Libravatar Tim Henigan1-0/+5
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>
2012-04-23difftool: teach difftool to handle directory diffsLibravatar Tim Henigan1-0/+39
When 'difftool' is called to compare a range of commits that modify more than one file, it opens a separate instance of the diff tool for each file that changed. The new '--dir-diff' option copies all the modified files to a temporary location and runs a directory diff on them in a single instance of the diff tool. Signed-off-by: Tim Henigan <tim.henigan@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-03-23difftool: add '--no-gui' optionLibravatar Tim Henigan1-0/+13
This commit teaches difftool to handle the '--no-gui' option. This option negates the existing '--gui' option. The last setting given on the command line wins. This allows a user to configure "[alias] mdt = difftool --gui", but still have the ability to override the setting without error: $ git mdt --no-gui Signed-off-by: Tim Henigan <tim.henigan@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-03-19t7800: Test difftool passing arguments to diffLibravatar David Aguilar1-0/+11
git-difftool relies on the ability to forward unknown arguments to the git-diff command. Add a test to ensure that this works as advertised. Signed-off-by: David Aguilar <davvid@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-10-14t7800: avoid arithmetic expansion notationLibravatar Junio C Hamano1-2/+2
The construct "var=$(( something ..." is interpreted by some shells as arithmetic expansion, even when it clearly is not, e.g. var=$((foo; bar) | baz) Avoid the issue by giving an extra SP to help the parser, i.e. var=$( (foo; bar) | baz ) Noticed by Michael J Gruber. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-10-10git-difftool: allow skipping file by typing 'n' at promptLibravatar Sitaram Chamarty1-1/+42
This is useful if you forgot to restrict the diff to the paths you want to see, or selecting precisely the ones you want is too much typing. [jc: with a change to return from the function upon 'n' by Charles Bailey and a small tweak in stdin_doesnot_contain() in the test] Signed-off-by: Sitaram Chamarty <sitaram@atc.tcs.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-08-11test: consolidate definition of $LFLibravatar Junio C Hamano1-3/+0
As we seem to need this variable that holds a single LF character in many places, define it in test-lib.sh and let the test scripts use it. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-10-06t7800 (difftool): add missing &&Libravatar Elijah Newren1-6/+6
Also remove a call to 'git config --unset difftool.prompt', since that is already unset by restore_test_defaults. Acked-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Reviewed-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Elijah Newren <newren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-08-18t/t7800-difftool.sh: Skip with prereq on no PERLLibravatar Ævar Arnfjörð Bjarmason1-27/+22
Change t/t7800-difftool.sh to to skip with the the three-arg prereq form of test_expect_success instead of bailing out. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-06-25tests: Skip tests in a way that makes sense under TAPLibravatar Ævar Arnfjörð Bjarmason1-1/+1
SKIP messages are now part of the TAP plan. A TAP harness now knows why a particular test was skipped and can report that information. The non-TAP harness built into Git's test-lib did nothing special with these messages, and is unaffected by these changes. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-03-28difftool: Fix '--gui' when diff.guitool is unconfiguredLibravatar David Aguilar1-0/+9
When diff.guitool is unconfigured and "--gui" is specified git-difftool dies with the following error message: config diff.guitool: command returned error: 1 Catch the error so that the "--gui" flag is a no-op when diff.guitool is unconfigured. Signed-off-by: David Aguilar <davvid@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-01-22t7800-difftool.sh: Test mergetool.prompt fallbackLibravatar David Aguilar1-0/+12
4cacc621 made difftool fall back to mergetool.prompt when difftool.prompt is unconfigured. This adds a test. Signed-off-by: David Aguilar <davvid@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-01-15difftool: Update copyright notices to list each year separatelyLibravatar David Aguilar1-1/+1
This is http://www.gnu.org/licenses/gpl-howto.html advises. Signed-off-by: David Aguilar <davvid@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-01-15difftool: Use eval to expand '--extcmd' expressionsLibravatar David Aguilar1-0/+13
It was not possible to pass quoted commands to '--extcmd'. By using 'eval' we ensure that expressions with spaces and quotes are supported. Signed-off-by: David Aguilar <davvid@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-01-15difftool: Add '-x' and as an alias for '--extcmd'Libravatar David Aguilar1-0/+8
This adds '-x' as a shorthand for the '--extcmd' option. Arguments to '--extcmd' can be specified separately, which was not originally possible. This also fixes the brief help text so that it mentions both '-x' and '--extcmd'. Signed-off-by: David Aguilar <davvid@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-01-15t7800-difftool.sh: Simplify the --extcmd testLibravatar David Aguilar1-8/+5
Instead of running 'grep', 'echo', and 'wc' we simply compare git-difftool's output against a known good value. Signed-off-by: David Aguilar <davvid@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-01-09difftool: Allow specifying unconfigured commands with --extcmdLibravatar David Aguilar1-1/+18
git-difftool requires difftool.<tool>.cmd configuration even when tools use the standard "$diffcmd $from $to" form. This teaches git-difftool to run these tools in lieu of configuration by allowing the command to be specified on the command line. Reference: http://article.gmane.org/gmane.comp.version-control.git/133377 Signed-off-by: David Aguilar <davvid@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-01-09difftool--helper: Remove use of the GIT_MERGE_TOOL variableLibravatar David Aguilar1-9/+0
An undocumented mis-feature in git-difftool is that it allows you to specify a default difftool by setting GIT_MERGE_TOOL. This behavior was never documented and was included as an oversight back when git-difftool was maintained outside of git. git-mergetool never honored GIT_MERGE_TOOL so neither should git-difftool. Signed-off-by: David Aguilar <davvid@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-01-03git-difftool: Add '--gui' for selecting a GUI toolLibravatar David Aguilar1-0/+12
Users might prefer to have git-difftool use a different tool when run from a Git GUI. This teaches git-difftool to honor 'diff.guitool' when the '--gui' option is specified. This allows users to configure their preferred command-line diff tool in 'diff.tool' and a GUI diff tool in 'diff.guitool'. Reference: http://article.gmane.org/gmane.comp.version-control.git/133386 Signed-off-by: David Aguilar <davvid@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-01-03t7800-difftool: Set a bogus tool for use by testsLibravatar David Aguilar1-1/+2
If a difftool test has an error then running the git test suite may end up invoking a GUI diff tool. We now guard against this by setting a difftool.bogus-tool.cmd variable. The tests already used --tool=bogus-tool in various places so this is simply ensuring that nothing ever falls back and finds a real diff tool. Signed-off-by: David Aguilar <davvid@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-10-24t7800-difftool: fix the effectless GIT_DIFFTOOL_PROMPT testLibravatar Markus Heidelberg1-1/+1
GIT_DIFFTOOL_PROMPT doesn't have any effect if overridden with --prompt. Signed-off-by: Markus Heidelberg <markus.heidelberg@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-04-24t7800: respect NO_PERLLibravatar Jeff King1-0/+5
Difftool is written in perl, so we don't build it if NO_PERL is set. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-04-07difftool: add support for a difftool.prompt config variableLibravatar David Aguilar1-0/+64
difftool now supports difftool.prompt so that users do not have to pass --no-prompt or hit enter each time a diff tool is launched. The --prompt flag overrides the configuration variable. Signed-off-by: David Aguilar <davvid@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-04-07difftool: add various git-difftool testsLibravatar David Aguilar1-0/+147
t7800-difftool.sh tests the various command-line flags, git-config variables, and environment settings supported by git-difftool. Signed-off-by: David Aguilar <davvid@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>