]> oss.titaniummirror.com Git - git-utils.git/commitdiff
Improve git-diffall
authorR. Steve McKown <rsmckown@gmail.com>
Sat, 10 Mar 2012 21:20:38 +0000 (14:20 -0700)
committerR. Steve McKown <rsmckown@gmail.com>
Sat, 10 Mar 2012 21:20:38 +0000 (14:20 -0700)
Use the program listed in the git config variable diff.tool to present the
differences, else fall back to diff.

git-diffall [changed mode: 0755->0644]
git-diffall.1

old mode 100755 (executable)
new mode 100644 (file)
index dd8dd46..990d285
@@ -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
index 48bca6676b3e4afc8a1ead0848a5fa0a5d1c71d4..fa1d55c5e4c8b5f0d67e31079f7e5415f6d62f49 100644 (file)
@@ -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