{"thread":{"id":"23852","subject":"[PATCH v2] gitk: Show notes by default (like git log do)","startedAt":"2010-05-20T09:50:41Z","lastAt":"2010-05-30T02:22:31Z","messageCount":2,"participants":["Kirill Smelkov","Paul Mackerras"],"isPatch":true,"patchVersion":2,"patchTotal":null},"messages":[{"id":"141946","messageId":"1274349041-7886-1-git-send-email-kirr@mns.spb.ru","threadId":"23852","inReplyTo":null,"subject":"[PATCH v2] gitk: Show notes by default (like git log do)","fromName":"Kirill Smelkov","fromEmail":"kirr@mns.spb.ru","sentAt":"2010-05-20T09:50:41Z","receivedAt":"2010-05-20T09:50:41Z","isPatch":true,"sender":{"key":"kirr@navytux.spb.ru","avatar":"https://gravatar.com/avatar/cf3445fdad1849941e17ab25bf1ee7c5ea1be2deb444be25ff5f36b0e50a985f?d=mp&s=160"},"body":"Starting from ~ git-1.6.6, log, show & whatchanged show notes by default.\n\nOn the other hand, gitk does not show notes by default, because under\nthe hood it calls `git log --pretty=raw ...` to get the log, and in\n`git log` notes are turned off, when user specifies format or pretty\nsettings.\n\nYes, it is possible to invoke `gitk --show-notes` explicitly, but since\nfrom user's perspective, gitk is gui enabled git log, it would be\nlogical for gitk to show notes by default too for consistency.\n\nIn git, --show-notes was introduced in 66b2ed (Fix \"log\" family not to\nbe too agressive about showing notes) which predates 1.6.6.2\n\nNotes can still be supressed with `gitk --no-notes`.\n\nCc: Michael J Gruber <git@drmicha.warpmail.net>\nSigned-off-by: Kirill Smelkov <kirr@mns.spb.ru>\n---\n gitk |   15 +++++++++++----\n 1 files changed, 11 insertions(+), 4 deletions(-)\n\nChanges since first post:\n\n o as suggested by Michael, removed --show-notes from do_readcommit\n\n o as suggested by Michael, tried to put --show-notes arg into a central place\n\n o --show-notes is only used for git >= 1.6.6.2 (though because $git_version\n   has only 3 digits, this may turn to be actually activated only from\n   git >= 1.7.0)\n\ndiff --git a/gitk b/gitk\nindex 1b0e09a..45e3380 100755\n--- a/gitk\n+++ b/gitk\n@@ -313,6 +313,7 @@ proc start_rev_list {view} {\n     global viewactive viewinstances vmergeonly\n     global mainheadid viewmainheadid viewmainheadid_orig\n     global vcanopt vflags vrevs vorigargs\n+    global show_notes\n \n     set startmsecs [clock clicks -milliseconds]\n     set commitidx($view) 0\n@@ -361,8 +362,8 @@ proc start_rev_list {view} {\n     }\n \n     if {[catch {\n-\tset fd [open [concat | git log --no-color -z --pretty=raw --parents \\\n-\t\t\t --boundary $args \"--\" $files] r]\n+\tset fd [open [concat | git log --no-color -z --pretty=raw $show_notes \\\n+\t\t\t--parents --boundary $args \"--\" $files] r]\n     } err]} {\n \terror_popup \"[mc \"Error executing git log:\"] $err\"\n \treturn 0\n@@ -456,6 +457,7 @@ proc updatecommits {} {\n     global mainheadid viewmainheadid viewmainheadid_orig pending_select\n     global isworktree\n     global varcid vposids vnegids vflags vrevs\n+    global show_notes\n \n     set isworktree [expr {[exec git rev-parse --is-inside-work-tree] == \"true\"}]\n     rereadrefs\n@@ -508,8 +510,8 @@ proc updatecommits {} {\n \tset args $vorigargs($view)\n     }\n     if {[catch {\n-\tset fd [open [concat | git log --no-color -z --pretty=raw --parents \\\n-\t\t\t  --boundary $args \"--\" $vfilelimit($view)] r]\n+\tset fd [open [concat | git log --no-color -z --pretty=raw $show_notes \\\n+\t\t\t--parents --boundary $args \"--\" $vfilelimit($view)] r]\n     } err]} {\n \terror_popup \"[mc \"Error executing git log:\"] $err\"\n \treturn\n@@ -11521,6 +11523,11 @@ set NS [expr {$use_ttk ? \"ttk\" : \"\"}]\n \n set git_version [join [lrange [split [lindex [exec git version] end] .] 0 2] .]\n \n+set show_notes {}\n+if {[package vcompare $git_version \"1.6.6.2\"] >= 0} {\n+    set show_notes \"--show-notes\"\n+}\n+\n set runq {}\n set history {}\n set historyindex 0\n-- \n1.7.1.91.ga63a7\n"},{"id":"142550","messageId":"20100530022231.GF2538@brick.ozlabs.ibm.com","threadId":"23852","inReplyTo":"1274349041-7886-1-git-send-email-kirr@mns.spb.ru","subject":"Re: [PATCH v2] gitk: Show notes by default (like git log do)","fromName":"Paul Mackerras","fromEmail":"paulus@samba.org","sentAt":"2010-05-30T02:22:31Z","receivedAt":"2010-05-30T02:22:31Z","isPatch":true,"sender":{"key":"paulus@samba.org","avatar":"https://avatars.githubusercontent.com/u/1606439?v=4"},"body":"On Thu, May 20, 2010 at 01:50:41PM +0400, Kirill Smelkov wrote:\n\n> Starting from ~ git-1.6.6, log, show & whatchanged show notes by default.\n> \n> On the other hand, gitk does not show notes by default, because under\n> the hood it calls `git log --pretty=raw ...` to get the log, and in\n> `git log` notes are turned off, when user specifies format or pretty\n> settings.\n> \n> Yes, it is possible to invoke `gitk --show-notes` explicitly, but since\n> from user's perspective, gitk is gui enabled git log, it would be\n> logical for gitk to show notes by default too for consistency.\n> \n> In git, --show-notes was introduced in 66b2ed (Fix \"log\" family not to\n> be too agressive about showing notes) which predates 1.6.6.2\n> \n> Notes can still be supressed with `gitk --no-notes`.\n> \n> Cc: Michael J Gruber <git@drmicha.warpmail.net>\n> Signed-off-by: Kirill Smelkov <kirr@mns.spb.ru>\n\nThanks, applied.\n\nPaul.\n"}]}