summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Mackerras <paulus@samba.org>2009-05-16 21:06:01 +1000
committerPaul Mackerras <paulus@samba.org>2009-05-16 21:08:44 +1000
commita8138733fcf4d9c175b53ab0d0f06a3f7c232286 (patch)
tree114ba587b428f1bf8a348c66e780a6083e1f56fa
parentb5cda49040f77334dc08485e3f36ef8c8f2928b4 (diff)
downloadgit-a8138733fcf4d9c175b53ab0d0f06a3f7c232286.tar.gz
gitk: Check git version before using --textconv flag
Commit 785b7535 ("gitk: use --textconv to generate diff text") added the --textconv flag to the git diff commands used to display commit diffs. Since some people use newer gitk with older git installations, this adds a check on the git version to check that it understands --textconv before using it. Signed-off-by: Paul Mackerras <paulus@samba.org>
-rwxr-xr-xgitk8
1 files changed, 7 insertions, 1 deletions
diff --git a/gitk b/gitk
index dcbfdc6538..5710782472 100755
--- a/gitk
+++ b/gitk
@@ -7267,8 +7267,13 @@ proc getblobdiffs {ids} {
global ignorespace
global limitdiffs vfilelimit curview
global diffencoding targetline diffnparents
+ global git_version
- set cmd [diffcmd $ids "-p --textconv -C --cc --no-commit-id -U$diffcontext"]
+ set textconv {}
+ if {[package vcompare $git_version "1.6.1"] >= 0} {
+ set textconv "--textconv"
+ }
+ set cmd [diffcmd $ids "-p $textconv -C --cc --no-commit-id -U$diffcontext"]
if {$ignorespace} {
append cmd " -w"
}
@@ -11090,6 +11095,7 @@ set nullid2 "0000000000000000000000000000000000000001"
set nullfile "/dev/null"
set have_tk85 [expr {[package vcompare $tk_version "8.5"] >= 0}]
+set git_version [lindex [exec git version] end]
set runq {}
set history {}