{"thread":{"id":"28547","subject":"[PATCH v2] gitk: Show patch for initial commit","startedAt":"2011-10-01T19:05:54Z","lastAt":"2011-10-03T17:44:44Z","messageCount":4,"participants":["Marcus Karlsson","Zbigniew Jędrzejewski-Szmek","Junio C Hamano"],"isPatch":true,"patchVersion":2,"patchTotal":null},"messages":[{"id":"176654","messageId":"20111001190554.GA5854@kennedy.acc.umu.se","threadId":"28547","inReplyTo":null,"subject":"[PATCH v2] gitk: Show patch for initial commit","fromName":"Marcus Karlsson","fromEmail":"mk@acc.umu.se","sentAt":"2011-10-01T19:05:54Z","receivedAt":"2011-10-01T19:05:54Z","isPatch":true,"sender":{"key":"mk@acc.umu.se","avatar":null},"body":"Make gitk show the patch for the initial commit by default.\nOverride with log.showroot.\n\nSigned-off-by: Marcus Karlsson <mk@acc.umu.se>\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":"176660","messageId":"4E878016.703@in.waw.pl","threadId":"28547","inReplyTo":"20111001190554.GA5854@kennedy.acc.umu.se","subject":"Re: [PATCH v2] gitk: Show patch for initial commit","fromName":"Zbigniew Jędrzejewski-Szmek","fromEmail":"zbyszek@in.waw.pl","sentAt":"2011-10-01T21:03:18Z","receivedAt":"2011-10-01T21:03:18Z","isPatch":true,"sender":{"key":"zbyszek@in.waw.pl","avatar":"https://avatars.githubusercontent.com/u/349618?v=4"},"body":"[cc: Paul Mackerras]\n\nHi,\nI think that the historical explanation that Junio gave could\nbe used as a basis for a commit message:\n\n  In early days, all projects managed by git (except for git itself) had the\n  product of a fairly mature development history in their first commit, and\n  it was deemed unnecessary clutter to show additions of these thousands of\n  paths 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\n  the diff of root commits, 2006-11-23).\n\n  Teach gitk to respect log.showroot.\n\nAlso the gitk should be mentioned in the man-page for git-config log.showroot.\nThe current description of this option seems suboptimal because it explains\nhow it used to be, which is not really relevant:\n  log.showroot\n    If true, the initial commit will be shown as a big creation event. This is\n    equivalent to a diff against an empty tree. Tools like git-log(1) or git-\n    whatchanged(1), which normally hide the root commit will now show it. True by\n    default.\nThis could be changed to:\n    If true (the default), the root commit will be shown as a big creation\n    event --- a diff against an empty tree. This diff can be very large for\n    a project which was imported into git after some development history.\n    If log.showroot is false tools like git-log(1), git-whatchanged(1), or\n    gitk(1) will not display the added files.\n    \nZbyszek\n\nOn 10/01/2011 09:05 PM, Marcus Karlsson wrote:\n> Make gitk show the patch for the initial commit by default.\n> Override with log.showroot.\n> \n> Signed-off-by: Marcus Karlsson<mk@acc.umu.se>\n> ---\n>   gitk-git/gitk |   13 +++++++++++--\n>   1 files changed, 11 insertions(+), 2 deletions(-)\n> \n> diff --git a/gitk-git/gitk b/gitk-git/gitk\n> index 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"},{"id":"176707","messageId":"20111003063359.GA11391@kennedy.acc.umu.se","threadId":"28547","inReplyTo":"4E878016.703@in.waw.pl","subject":"Re: [PATCH v2] gitk: Show patch for initial commit","fromName":"Marcus Karlsson","fromEmail":"mk@acc.umu.se","sentAt":"2011-10-03T06:33:59Z","receivedAt":"2011-10-03T06:33:59Z","isPatch":true,"sender":{"key":"mk@acc.umu.se","avatar":null},"body":"On Sat, Oct 01, 2011 at 11:03:18PM +0200, Zbigniew J??drzejewski-Szmek wrote:\n> [cc: Paul Mackerras]\n> \n> Hi,\n> I think that the historical explanation that Junio gave could\n> be used as a basis for a commit message:\n> \n>   In early days, all projects managed by git (except for git itself) had the\n>   product of a fairly mature development history in their first commit, and\n>   it was deemed unnecessary clutter to show additions of these thousands of\n>   paths 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\n>   the diff of root commits, 2006-11-23).\n> \n>   Teach gitk to respect log.showroot.\n\nAbsolutely, that would be a much better commit message. I'll wait and\nsee if there are more comments and then resubmit.\n\n> Also the gitk should be mentioned in the man-page for git-config log.showroot.\n> The current description of this option seems suboptimal because it explains\n> how it used to be, which is not really relevant:\n>   log.showroot\n>     If true, the initial commit will be shown as a big creation event. This is\n>     equivalent to a diff against an empty tree. Tools like git-log(1) or git-\n>     whatchanged(1), which normally hide the root commit will now show it. True by\n>     default.\n> This could be changed to:\n>     If true (the default), the root commit will be shown as a big creation\n>     event --- a diff against an empty tree. This diff can be very large for\n>     a project which was imported into git after some development history.\n>     If log.showroot is false tools like git-log(1), git-whatchanged(1), or\n>     gitk(1) will not display the added files.\n\nI agree, but that feels like something that could be made into a\nseparate patch. Or should I include that too?\n\n\tMarcus\n"},{"id":"176758","messageId":"7v7h4mgeb7.fsf@alter.siamese.dyndns.org","threadId":"28547","inReplyTo":"20111003063359.GA11391@kennedy.acc.umu.se","subject":"Re: [PATCH v2] gitk: Show patch for initial commit","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2011-10-03T17:44:44Z","receivedAt":"2011-10-03T17:44:44Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Marcus Karlsson <mk@acc.umu.se> writes:\n\n>> Also the gitk should be mentioned in the man-page for git-config log.showroot.\n>> The current description of this option seems suboptimal because it explains\n>> how it used to be, which is not really relevant:\n>>   log.showroot\n>>     If true, the initial commit will be shown as a big creation event. This is\n>>     equivalent to a diff against an empty tree. Tools like git-log(1) or git-\n>>     whatchanged(1), which normally hide the root commit will now show it. True by\n>>     default.\n>> This could be changed to:\n>>     If true (the default), the root commit will be shown as a big creation\n>>     event --- a diff against an empty tree. This diff can be very large for\n>>     a project which was imported into git after some development history.\n>>     If log.showroot is false tools like git-log(1), git-whatchanged(1), or\n>>     gitk(1) will not display the added files.\n>\n> I agree, but that feels like something that could be made into a\n> separate patch. Or should I include that too?\n\nPlease make it a separate patch. A patch to Documentation/config.txt\nshould go to git.git project, but gitk patch (whose \"diff --git\" line\nshould read \"diff --git a/gitk b/gitk\") should go first to gitk.git\nproject and then merged to my tree.\n"}]}