diff options
Diffstat (limited to 'git-difftool.perl')
-rwxr-xr-x | git-difftool.perl | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/git-difftool.perl b/git-difftool.perl index ba5e60a45e..8c836e4c76 100755 --- a/git-difftool.perl +++ b/git-difftool.perl @@ -15,13 +15,16 @@ use warnings; use Cwd qw(abs_path); use File::Basename qw(dirname); +require Git; + my $DIR = abs_path(dirname($0)); sub usage { print << 'USAGE'; -usage: git difftool [--tool=<tool>] [-y|--no-prompt] ["git diff" options] +usage: git difftool [-g|--gui] [-t|--tool=<tool>] [-y|--no-prompt] + ["git diff" options] USAGE exit 1; } @@ -63,6 +66,14 @@ sub generate_command $ENV{GIT_DIFF_TOOL} = substr($arg, 7); next; } + if ($arg eq '-g' || $arg eq '--gui') { + my $tool = Git::command_oneline('config', + 'diff.guitool'); + if (length($tool)) { + $ENV{GIT_DIFF_TOOL} = $tool; + } + next; + } if ($arg eq '-y' || $arg eq '--no-prompt') { $ENV{GIT_DIFFTOOL_NO_PROMPT} = 'true'; delete $ENV{GIT_DIFFTOOL_PROMPT}; |