Skip to content

Commit b2b76d1

Browse files
Marcus Karlssonpaulusmack
authored andcommitted
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. [[email protected]: Cleaned up the Tcl a bit, use --bool on the git config call] Signed-off-by: Marcus Karlsson <[email protected]> Signed-off-by: Paul Mackerras <[email protected]>
1 parent 6febded commit b2b76d1

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

gitk

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7476,7 +7476,7 @@ proc addtocflist {ids} {
74767476
}
74777477

74787478
proc diffcmd {ids flags} {
7479-
global nullid nullid2
7479+
global log_showroot nullid nullid2
74807480

74817481
set i [lsearch -exact $ids $nullid]
74827482
set j [lsearch -exact $ids $nullid2]
@@ -7510,6 +7510,9 @@ proc diffcmd {ids flags} {
75107510
lappend cmd HEAD
75117511
}
75127512
} else {
7513+
if {$log_showroot} {
7514+
lappend flags --root
7515+
}
75137516
set cmd [concat | git diff-tree -r $flags $ids]
75147517
}
75157518
return $cmd
@@ -11559,6 +11562,11 @@ catch {
1155911562
}
1156011563
}
1156111564

11565+
set log_showroot true
11566+
catch {
11567+
set log_showroot [exec git config --bool --get log.showroot]
11568+
}
11569+
1156211570
if {[tk windowingsystem] eq "aqua"} {
1156311571
set mainfont {{Lucida Grande} 9}
1156411572
set textfont {Monaco 9}

0 commit comments

Comments
 (0)