Skip to content

Commit

Permalink
gitk: Teach gitk to respect log.showroot
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Marcus Karlsson authored and Paul Mackerras committed Mar 24, 2012
1 parent 6febded commit b2b76d1
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion gitk
Original file line number Diff line number Diff line change
Expand Up @@ -7476,7 +7476,7 @@ proc addtocflist {ids} {
}

proc diffcmd {ids flags} {
global nullid nullid2
global log_showroot nullid nullid2

set i [lsearch -exact $ids $nullid]
set j [lsearch -exact $ids $nullid2]
Expand Down Expand Up @@ -7510,6 +7510,9 @@ proc diffcmd {ids flags} {
lappend cmd HEAD
}
} else {
if {$log_showroot} {
lappend flags --root
}
set cmd [concat | git diff-tree -r $flags $ids]
}
return $cmd
Expand Down Expand Up @@ -11559,6 +11562,11 @@ catch {
}
}

set log_showroot true
catch {
set log_showroot [exec git config --bool --get log.showroot]
}

if {[tk windowingsystem] eq "aqua"} {
set mainfont {{Lucida Grande} 9}
set textfont {Monaco 9}
Expand Down

0 comments on commit b2b76d1

Please sign in to comment.