X Tutup
Skip to content

Commit afcbc8e

Browse files
davvidgitster
authored andcommitted
difftool: move 'git-difftool' out of contrib
This prepares 'git-difftool' and its documentation for mainstream use. 'git-difftool-helper' became 'git-difftool--helper' since users should not use it directly. 'git-difftool' was added to the list of commands as an ancillaryinterrogator. Signed-off-by: David Aguilar <davvid@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent 1c0f3d2 commit afcbc8e

File tree

7 files changed

+27
-4
lines changed

7 files changed

+27
-4
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ git-diff
3535
git-diff-files
3636
git-diff-index
3737
git-diff-tree
38+
git-difftool
39+
git-difftool--helper
3840
git-describe
3941
git-fast-export
4042
git-fast-import

Documentation/config.txt

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -667,6 +667,24 @@ diff.suppressBlankEmpty::
667667
A boolean to inhibit the standard behavior of printing a space
668668
before each empty output line. Defaults to false.
669669

670+
diff.tool::
671+
Controls which diff tool is used. `diff.tool` overrides
672+
`merge.tool` when used by linkgit:git-difftool[1] and has
673+
the same valid values as `merge.tool` minus "tortoisemerge"
674+
and plus "kompare".
675+
676+
difftool.<tool>.path::
677+
Override the path for the given tool. This is useful in case
678+
your tool is not in the PATH.
679+
680+
difftool.<tool>.cmd::
681+
Specify the command to invoke the specified diff tool.
682+
The specified command is evaluated in shell with the following
683+
variables available: 'LOCAL' is set to the name of the temporary
684+
file containing the contents of the diff pre-image and 'REMOTE'
685+
is set to the name of the temporary file containing the contents
686+
of the diff post-image.
687+
670688
diff.wordRegex::
671689
A POSIX Extended Regular Expression used to determine what is a "word"
672690
when performing word-by-word difference calculations. Character

Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,7 @@ TEST_PROGRAMS =
277277

278278
SCRIPT_SH += git-am.sh
279279
SCRIPT_SH += git-bisect.sh
280+
SCRIPT_SH += git-difftool--helper.sh
280281
SCRIPT_SH += git-filter-branch.sh
281282
SCRIPT_SH += git-lost-found.sh
282283
SCRIPT_SH += git-merge-octopus.sh
@@ -296,6 +297,7 @@ SCRIPT_SH += git-submodule.sh
296297
SCRIPT_SH += git-web--browse.sh
297298

298299
SCRIPT_PERL += git-add--interactive.perl
300+
SCRIPT_PERL += git-difftool.perl
299301
SCRIPT_PERL += git-archimport.perl
300302
SCRIPT_PERL += git-cvsexportcommit.perl
301303
SCRIPT_PERL += git-cvsimport.perl

command-list.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ git-diff mainporcelain common
3333
git-diff-files plumbinginterrogators
3434
git-diff-index plumbinginterrogators
3535
git-diff-tree plumbinginterrogators
36+
git-difftool ancillaryinterrogators
3637
git-fast-export ancillarymanipulators
3738
git-fast-import ancillarymanipulators
3839
git-fetch mainporcelain common
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/sh
2-
# git-difftool-helper is a GIT_EXTERNAL_DIFF-compatible diff tool launcher.
2+
# git-difftool--helper is a GIT_EXTERNAL_DIFF-compatible diff tool launcher.
33
# This script is typically launched by using the 'git difftool'
44
# convenience command.
55
#
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
# Copyright (c) 2009 David Aguilar
33
#
44
# This is a wrapper around the GIT_EXTERNAL_DIFF-compatible
5-
# git-difftool-helper script. This script exports
5+
# git-difftool--helper script. This script exports
66
# GIT_EXTERNAL_DIFF and GIT_PAGER for use by git, and
7-
# GIT_DIFFTOOL_NO_PROMPT and GIT_DIFF_TOOL for use by git-difftool-helper.
7+
# GIT_DIFFTOOL_NO_PROMPT and GIT_DIFF_TOOL for use by git-difftool--helper.
88
# Any arguments that are unknown to this script are forwarded to 'git diff'.
99

1010
use strict;
@@ -27,7 +27,7 @@ sub setup_environment
2727
{
2828
$ENV{PATH} = "$DIR:$ENV{PATH}";
2929
$ENV{GIT_PAGER} = '';
30-
$ENV{GIT_EXTERNAL_DIFF} = 'git-difftool-helper';
30+
$ENV{GIT_EXTERNAL_DIFF} = 'git-difftool--helper';
3131
}
3232

3333
sub exe

0 commit comments

Comments
 (0)
X Tutup