gitk: Teach gitk to respect log.showroot

In early days, all projects managed by git (except for git itself) had the product of a fairly mature development history in their first commit, and it was deemed unnecessary clutter to show additions of these thousands of paths as a patch. "git log" learned to show the patch for the initial commit without requiring --root command line option at 0f03ca9 (config option log.showroot to show the diff of root commits, 2006-11-23). Teach gitk to respect log.showroot. [paulus@samba.org: Cleaned up the Tcl a bit, use --bool on the git config call] Signed-off-by: Marcus Karlsson <mk@acc.umu.se> Signed-off-by: Paul Mackerras <paulus@samba.org>

Marcus Karlsson committed Oct 4, 2011 at 22:08 UTC b2b76d10696d945bf19318831b64d009d119e051
1 file changed +9 -1
gitk
+9 -1
@@ -7476,7 +7476,7 @@ proc addtocflist {ids} {
7476 }
7477
7478 proc diffcmd {ids flags} {
7479 - global nullid nullid2
7479 + global log_showroot nullid nullid2
7480
7481 set i [lsearch -exact $ids $nullid]
7482 set j [lsearch -exact $ids $nullid2]
@@ -7510,6 +7510,9 @@ proc diffcmd {ids flags} {
7510 lappend cmd HEAD
7511 }
7512 } else {
7513 + if {$log_showroot} {
7514 + lappend flags --root
7515 + }
7516 set cmd [concat | git diff-tree -r $flags $ids]
7517 }
7518 return $cmd
@@ -11559,6 +11562,11 @@ catch {
11562 }
11563 }
11564
11565 +set log_showroot true
11566 +catch {
11567 + set log_showroot [exec git config --bool --get log.showroot]
11568 +}
11569 +
11570 if {[tk windowingsystem] eq "aqua"} {
11571 set mainfont {{Lucida Grande} 9}
11572 set textfont {Monaco 9}