{"thread":{"id":"28574","subject":"[PATCH v3] gitk: Teach gitk to respect log.showroot","startedAt":"2011-10-04T20:08:13Z","lastAt":"2012-03-19T11:04:58Z","messageCount":5,"participants":["Marcus Karlsson","Paul Mackerras","Zbigniew Jędrzejewski-Szmek"],"isPatch":true,"patchVersion":3,"patchTotal":null},"messages":[{"id":"176869","messageId":"20111004200813.GA16596@kennedy.acc.umu.se","threadId":"28574","inReplyTo":null,"subject":"[PATCH v3] gitk: Teach gitk to respect log.showroot","fromName":"Marcus Karlsson","fromEmail":"mk@acc.umu.se","sentAt":"2011-10-04T20:08:13Z","receivedAt":"2011-10-04T20:08:13Z","isPatch":true,"sender":{"key":"mk@acc.umu.se","avatar":null},"body":"In early days, all projects managed by git (except for git itself) had the\nproduct of a fairly mature development history in their first commit, and\nit was deemed unnecessary clutter to show additions of these thousands of\npaths as a patch.\n\n\"git log\" learned to show the patch for the initial commit without requiring\n--root command line option at 0f03ca9 (config option log.showroot to show\nthe diff of root commits, 2006-11-23).\n\nTeach gitk to respect log.showroot.\n\nSigned-off-by: Marcus Karlsson <mk@acc.umu.se>\n---\nImproved the commit message after suggestion from Zbigniew\nJedrzejewski-Szmek.\n\n gitk-git/gitk |   13 +++++++++++--\n 1 files changed, 11 insertions(+), 2 deletions(-)\n\ndiff --git a/gitk-git/gitk b/gitk-git/gitk\nindex 4cde0c4..40ea73f 100755\n--- a/gitk-git/gitk\n+++ b/gitk-git/gitk\n@@ -7402,7 +7402,7 @@ proc addtocflist {ids} {\n }\n \n proc diffcmd {ids flags} {\n-    global nullid nullid2\n+    global log_showroot nullid nullid2\n \n     set i [lsearch -exact $ids $nullid]\n     set j [lsearch -exact $ids $nullid2]\n@@ -7436,7 +7436,11 @@ proc diffcmd {ids flags} {\n \t    lappend cmd HEAD\n \t}\n     } else {\n-\tset cmd [concat | git diff-tree -r $flags $ids]\n+\tset cmd [concat | git diff-tree -r]\n+\tif {$log_showroot eq true} {\n+\t    set cmd [concat $cmd --root]\n+\t}\n+\tset cmd [concat $cmd $flags $ids]\n     }\n     return $cmd\n }\n@@ -11403,6 +11407,11 @@ catch {\n     }\n }\n \n+set log_showroot true\n+catch {\n+    set log_showroot [exec git config --get log.showroot]\n+}\n+\n if {[tk windowingsystem] eq \"aqua\"} {\n     set mainfont {{Lucida Grande} 9}\n     set textfont {Monaco 9}\n-- \n1.7.7\n"},{"id":"177214","messageId":"20111008064704.GA27056@bloggs.ozlabs.ibm.com","threadId":"28574","inReplyTo":"20111004200813.GA16596@kennedy.acc.umu.se","subject":"Re: [PATCH v3] gitk: Teach gitk to respect log.showroot","fromName":"Paul Mackerras","fromEmail":"paulus@samba.org","sentAt":"2011-10-08T06:47:04Z","receivedAt":"2011-10-08T06:47:04Z","isPatch":true,"sender":{"key":"paulus@samba.org","avatar":"https://avatars.githubusercontent.com/u/1606439?v=4"},"body":"On Tue, Oct 04, 2011 at 10:08:13PM +0200, Marcus Karlsson wrote:\n> Teach gitk to respect log.showroot.\n\nSounds reasonable, ...\n\n> -\tset cmd [concat | git diff-tree -r $flags $ids]\n> +\tset cmd [concat | git diff-tree -r]\n> +\tif {$log_showroot eq true} {\n> +\t    set cmd [concat $cmd --root]\n> +\t}\n> +\tset cmd [concat $cmd $flags $ids]\n\nbut is there any reason not to do it like this?\n\n\tif {$log_showroot} {\n\t    lappend flags --root\n\t}\n\tset cmd [concat | git diff-tree -r $flags $ids]\n\nI.e., do you particularly want the --root before the other flags?\n\nPaul.\n"},{"id":"177443","messageId":"20111012143639.GA22316@kennedy.acc.umu.se","threadId":"28574","inReplyTo":"20111008064704.GA27056@bloggs.ozlabs.ibm.com","subject":"Re: [PATCH v3] gitk: Teach gitk to respect log.showroot","fromName":"Marcus Karlsson","fromEmail":"mk@acc.umu.se","sentAt":"2011-10-12T14:36:39Z","receivedAt":"2011-10-12T14:36:39Z","isPatch":true,"sender":{"key":"mk@acc.umu.se","avatar":null},"body":"On Sat, Oct 08, 2011 at 05:47:04PM +1100, Paul Mackerras wrote:\n> On Tue, Oct 04, 2011 at 10:08:13PM +0200, Marcus Karlsson wrote:\n> > Teach gitk to respect log.showroot.\n> \n> Sounds reasonable, ...\n> \n> > -\tset cmd [concat | git diff-tree -r $flags $ids]\n> > +\tset cmd [concat | git diff-tree -r]\n> > +\tif {$log_showroot eq true} {\n> > +\t    set cmd [concat $cmd --root]\n> > +\t}\n> > +\tset cmd [concat $cmd $flags $ids]\n> \n> but is there any reason not to do it like this?\n> \n> \tif {$log_showroot} {\n> \t    lappend flags --root\n> \t}\n> \tset cmd [concat | git diff-tree -r $flags $ids]\n> \n> I.e., do you particularly want the --root before the other flags?\n> \n> Paul.\n\nNot really, that would work very well.\n\nMarcus\n"},{"id":"187222","messageId":"20120318225327.GA26977@bloggs.ozlabs.ibm.com","threadId":"28574","inReplyTo":"20111004200813.GA16596@kennedy.acc.umu.se","subject":"Re: [PATCH v3] gitk: Teach gitk to respect log.showroot","fromName":"Paul Mackerras","fromEmail":"paulus@samba.org","sentAt":"2012-03-18T22:53:27Z","receivedAt":"2012-03-18T22:53:27Z","isPatch":true,"sender":{"key":"paulus@samba.org","avatar":"https://avatars.githubusercontent.com/u/1606439?v=4"},"body":"On Tue, Oct 04, 2011 at 10:08:13PM +0200, Marcus Karlsson wrote:\n\n> Teach gitk to respect log.showroot.\n\n> +set log_showroot true\n> +catch {\n> +    set log_showroot [exec git config --get log.showroot]\n> +}\n\nSince I mostly use gitk on the kernel, I'd prefer that log_showroot\ndefaults to false if it isn't specified in the git config file.\nDefaulting to false would also be the smaller change in gitk\nbehaviour.\n\nPaul.\n"},{"id":"187248","messageId":"4F6712DA.6090904@in.waw.pl","threadId":"28574","inReplyTo":"20120318225327.GA26977@bloggs.ozlabs.ibm.com","subject":"Re: [PATCH v3] gitk: Teach gitk to respect log.showroot","fromName":"Zbigniew Jędrzejewski-Szmek","fromEmail":"zbyszek@in.waw.pl","sentAt":"2012-03-19T11:04:58Z","receivedAt":"2012-03-19T11:04:58Z","isPatch":true,"sender":{"key":"zbyszek@in.waw.pl","avatar":"https://avatars.githubusercontent.com/u/349618?v=4"},"body":"On 03/18/2012 11:53 PM, Paul Mackerras wrote:\n> On Tue, Oct 04, 2011 at 10:08:13PM +0200, Marcus Karlsson wrote:\n>\n>> Teach gitk to respect log.showroot.\n>\n>> +set log_showroot true\n>> +catch {\n>> +    set log_showroot [exec git config --get log.showroot]\n>> +}\n>\n> Since I mostly use gitk on the kernel, I'd prefer that log_showroot\n> defaults to false if it isn't specified in the git config file.\n> Defaulting to false would also be the smaller change in gitk\n> behaviour.\n\nI agree that in case of the kernel repo, log.showroot=false is more \nuseful. But this somewhat special use case should not decide the policy. \nFirst of all, as an experienced git user you know how to set the config \noption, if you dislike the default. This new default targets new users. \nSecondly, this option only matters when you scroll all the way down and \nclick on first commit. Probably doesn't happen too often, since the time \nrequired to read in the other ~300000 commit messages is pretty big too. \nIf you want to look at the root commit, it's probably because your \nproject started recently and your history is short. Thirdly, consistency \nbetween git-log and gitk is important.\n\nZbyszek\n"}]}