From 5a0964b8bfd750dd118a1b10736ff9541b61b2fd Mon Sep 17 00:00:00 2001 From: "R. Steve McKown" Date: Sat, 10 Mar 2012 14:20:38 -0700 Subject: [PATCH] Improve git-diffall Use the program listed in the git config variable diff.tool to present the differences, else fall back to diff. --- git-diffall | 10 +++++++++- git-diffall.1 | 7 ++++--- 2 files changed, 13 insertions(+), 4 deletions(-) mode change 100755 => 100644 git-diffall diff --git a/git-diffall b/git-diffall old mode 100755 new mode 100644 index dd8dd46..990d285 --- a/git-diffall +++ b/git-diffall @@ -1,5 +1,8 @@ #!/bin/sh +# Thanks to Thomas Rast +# http://thread.gmane.org/gmane.comp.version-control.git/124807 +SUBDIRECTORY_OK=1 . "$(git --exec-path)/git-sh-setup" cd_to_toplevel # for the tar below @@ -35,4 +38,9 @@ done < "$tmp"/filelist cd "$tmp" #meld a b #diff -ur a b -kdiff3 a b +tool="$(git-config diff.tool)" +if [ -n "$tool" ]; then + "$tool" a b +else + diff -urN a b +fi diff --git a/git-diffall.1 b/git-diffall.1 index 48bca66..fa1d55c 100644 --- a/git-diffall.1 +++ b/git-diffall.1 @@ -11,9 +11,10 @@ git-diffall \- Use a visual diff tool to show all differences .PP \fBgit-diffall\fR performs a visual diff using kdiff3 between PRE and POST of the current project. No arguments will show the differences between the -working directory and HEAD. Later this tool can be improved upon to use the -tool listed in the config file (difftool), or if none present fall back to -a 'normal' git diff. +working directory and HEAD. If in the git config diff.tool is set, this +program is passed the name of the two temporary directories containing the +changed files of each revision. If diff.tool is not defined, the fall-back +is to diff. Thanks to Thomas Rast for publishing this script online: http://thread.gmane.org/gmane.comp.version-control.git/124807 -- 2.39.2