mirror of
https://github.com/git/git.git
synced 2024-11-05 00:37:55 +01:00
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>
This commit is contained in:
parent
b5cda49040
commit
a8138733fc
1 changed files with 7 additions and 1 deletions
8
gitk
8
gitk
|
@ -7267,8 +7267,13 @@ proc getblobdiffs {ids} {
|
||||||
global ignorespace
|
global ignorespace
|
||||||
global limitdiffs vfilelimit curview
|
global limitdiffs vfilelimit curview
|
||||||
global diffencoding targetline diffnparents
|
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} {
|
if {$ignorespace} {
|
||||||
append cmd " -w"
|
append cmd " -w"
|
||||||
}
|
}
|
||||||
|
@ -11090,6 +11095,7 @@ set nullid2 "0000000000000000000000000000000000000001"
|
||||||
set nullfile "/dev/null"
|
set nullfile "/dev/null"
|
||||||
|
|
||||||
set have_tk85 [expr {[package vcompare $tk_version "8.5"] >= 0}]
|
set have_tk85 [expr {[package vcompare $tk_version "8.5"] >= 0}]
|
||||||
|
set git_version [lindex [exec git version] end]
|
||||||
|
|
||||||
set runq {}
|
set runq {}
|
||||||
set history {}
|
set history {}
|
||||||
|
|
Loading…
Reference in a new issue