aboutsummaryrefslogtreecommitdiff
path: root/t/t7800-difftool.sh
Commit message (Collapse)AuthorAge
* Merge branch 'th/difftool-diffall'Junio C Hamano2012-05-07
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * difftool: print list of valid tools with '--tool-help'Tim Henigan2012-04-23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * difftool: teach difftool to handle directory diffsTim Henigan2012-04-23
| | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * difftool: add '--no-gui' optionTim Henigan2012-03-23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | t7800: Test difftool passing arguments to diffDavid Aguilar2012-03-19
|/ | | | | | | | | 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>
* t7800: avoid arithmetic expansion notationJunio C Hamano2011-10-14
| | | | | | | | | | | | | | | 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>
* git-difftool: allow skipping file by typing 'n' at promptSitaram Chamarty2011-10-10
| | | | | | | | | | | 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>
* test: consolidate definition of $LFJunio C Hamano2011-08-11
| | | | | | | | 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>
* t7800 (difftool): add missing &&Elijah Newren2010-10-06
| | | | | | | | | | 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>
* t/t7800-difftool.sh: Skip with prereq on no PERLÆvar Arnfjörð Bjarmason2010-08-18
| | | | | | | | 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>
* tests: Skip tests in a way that makes sense under TAPÆvar Arnfjörð Bjarmason2010-06-25
| | | | | | | | | | 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>
* difftool: Fix '--gui' when diff.guitool is unconfiguredDavid Aguilar2010-03-28
| | | | | | | | | | | | | 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>
* t7800-difftool.sh: Test mergetool.prompt fallbackDavid Aguilar2010-01-22
| | | | | | | | 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>
* difftool: Update copyright notices to list each year separatelyDavid Aguilar2010-01-15
| | | | | | | 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>
* difftool: Use eval to expand '--extcmd' expressionsDavid Aguilar2010-01-15
| | | | | | | | | 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>
* difftool: Add '-x' and as an alias for '--extcmd'David Aguilar2010-01-15
| | | | | | | | | | | | 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>
* t7800-difftool.sh: Simplify the --extcmd testDavid Aguilar2010-01-15
| | | | | | | | 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>
* difftool: Allow specifying unconfigured commands with --extcmdDavid Aguilar2010-01-09
| | | | | | | | | | | 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>
* difftool--helper: Remove use of the GIT_MERGE_TOOL variableDavid Aguilar2010-01-09
| | | | | | | | | | | | | 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>
* git-difftool: Add '--gui' for selecting a GUI toolDavid Aguilar2010-01-03
| | | | | | | | | | | | | | 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>
* t7800-difftool: Set a bogus tool for use by testsDavid Aguilar2010-01-03
| | | | | | | | | | | | | 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>
* t7800-difftool: fix the effectless GIT_DIFFTOOL_PROMPT testMarkus Heidelberg2009-10-24
| | | | | | | 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>
* t7800: respect NO_PERLJeff King2009-04-24
| | | | | | | | 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>
* difftool: add support for a difftool.prompt config variableDavid Aguilar2009-04-07
| | | | | | | | | 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>
* difftool: add various git-difftool testsDavid Aguilar2009-04-07
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>