{"thread":{"id":"23776","subject":"[PATCH] gitk: Show notes","startedAt":"2010-05-11T08:26:56Z","lastAt":"2010-05-12T08:56:58Z","messageCount":3,"participants":["Kirill Smelkov","Michael J Gruber"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"141463","messageId":"1273566416-3512-1-git-send-email-kirr@mns.spb.ru","threadId":"23776","inReplyTo":null,"subject":"[PATCH] gitk: Show notes","fromName":"Kirill Smelkov","fromEmail":"kirr@mns.spb.ru","sentAt":"2010-05-11T08:26:56Z","receivedAt":"2010-05-11T08:26:56Z","isPatch":true,"sender":{"key":"kirr@navytux.spb.ru","avatar":"https://gravatar.com/avatar/cf3445fdad1849941e17ab25bf1ee7c5ea1be2deb444be25ff5f36b0e50a985f?d=mp&s=160"},"body":"If in git.git I do\n\n    $ git notes add -m 'This makes status significantly slower with Dokko' \\\n        ee6fc514\n\nthen `git log` shows the note...\n\n    $ git log -1 ee6fc514\n\n    commit ee6fc514f2df821c2719cc49499a56ef2fb136b0\n    Author: Jens Lehmann <Jens.Lehmann@web.de>\n    Date:   Sat Jan 16 18:42:24 2010 +0100\n\n        Show submodules as modified when they contain a dirty work tree\n\n        Until now a submodule only then showed up as modified in the supermodule\n        when the last commit in the submodule differed from the one in the index\n        or the diffed against commit of the superproject. A dirty work tree\n        containing new untracked or modified files in a submodule was\n        undetectable when looking at it from the superproject.\n\n        Now git status and git diff (against the work tree) in the superproject\n        will also display submodules as modified when they contain untracked or\n        modified files, even if the compared ref matches the HEAD of the\n        submodule.\n\n        Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de>\n        Signed-off-by: Nanako Shiraishi <nanako3@lavabit.com>\n        Signed-off-by: Junio C Hamano <gitster@pobox.com>\n\n    Notes:\n        This makes status significantly slower with Dokko\n\n... but unfortunately gitk does not.\n\nLet's fix this and teach gitk to show notes.\n\nSigned-off-by: Kirill Smelkov <kirr@mns.spb.ru>\n---\n gitk |   11 ++++++-----\n 1 files changed, 6 insertions(+), 5 deletions(-)\n\ndiff --git a/gitk b/gitk\nindex 1b0e09a..d537011 100755\n--- a/gitk\n+++ b/gitk\n@@ -361,8 +361,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@@ -508,8 +508,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@@ -1586,7 +1586,8 @@ proc do_readcommit {id} {\n     global tclencoding\n \n     # Invoke git-log to handle automatic encoding conversion\n-    set fd [open [concat | git log --no-color --pretty=raw -1 $id] r]\n+    set fd [open [concat | git log --no-color --pretty=raw --show-notes \\\n+\t\t     -1 $id] r]\n     # Read the results using i18n.logoutputencoding\n     fconfigure $fd -translation lf -eofchar {}\n     if {$tclencoding != {}} {\n-- \n1.7.1.89.g6b35c\n"},{"id":"141481","messageId":"4BE96B41.7010902@drmicha.warpmail.net","threadId":"23776","inReplyTo":"1273566416-3512-1-git-send-email-kirr@mns.spb.ru","subject":"Re: [PATCH] gitk: Show notes","fromName":"Michael J Gruber","fromEmail":"git@drmicha.warpmail.net","sentAt":"2010-05-11T14:35:45Z","receivedAt":"2010-05-11T14:35:45Z","isPatch":true,"sender":{"key":"git@grubix.eu","avatar":"https://avatars.githubusercontent.com/u/233215?v=4"},"body":"Kirill Smelkov venit, vidit, dixit 11.05.2010 10:26:\n> If in git.git I do\n> \n>     $ git notes add -m 'This makes status significantly slower with Dokko' \\\n>         ee6fc514\n> \n> then `git log` shows the note...\n> \n\nbecause --show-notes is the default...\n\n> ... but unfortunately gitk does not.\n\n... unless --pretty is given, and gitk uses --pretty.\n\nBut what is wrong with gitk --show-notes?\n\nIf you mean to adjust gitk's default to log's current default please say\nso in the commit message. There's no need to include a longish sample\noutput for that.\n\nAlso, I don't think proc do_readcommit needs the notes. The other two\nplaces use $args, so it might make sense to prepend --show-notes to the\narg list in a central place.\n\nMichael\n"},{"id":"141516","messageId":"20100512085658.GA22938@tugrik.mns.mnsspb.ru","threadId":"23776","inReplyTo":"4BE96B41.7010902@drmicha.warpmail.net","subject":"Re: gitk: Show notes","fromName":"Kirill Smelkov","fromEmail":"kirr@mns.spb.ru","sentAt":"2010-05-12T08:56:58Z","receivedAt":"2010-05-12T08:56:58Z","isPatch":false,"sender":{"key":"kirr@navytux.spb.ru","avatar":"https://gravatar.com/avatar/cf3445fdad1849941e17ab25bf1ee7c5ea1be2deb444be25ff5f36b0e50a985f?d=mp&s=160"},"body":"On Tue, May 11, 2010 at 04:35:45PM +0200, Michael J Gruber wrote:\n> Kirill Smelkov venit, vidit, dixit 11.05.2010 10:26:\n> > If in git.git I do\n> > \n> >     $ git notes add -m 'This makes status significantly slower with Dokko' \\\n> >         ee6fc514\n> > \n> > then `git log` shows the note...\n> > \n> \n> because --show-notes is the default...\n> \n> > ... but unfortunately gitk does not.\n> \n> ... unless --pretty is given, and gitk uses --pretty.\n> \n> But what is wrong with gitk --show-notes?\n\nSorry, you are right. I learned notes just yesterday and forgot one can\npass such options to gitk.\n\n> If you mean to adjust gitk's default to log's current default please say\n> so in the commit message. There's no need to include a longish sample\n> output for that.\n\nOk, agree.\n\n> Also, I don't think proc do_readcommit needs the notes. The other two\n> places use $args, so it might make sense to prepend --show-notes to the\n> arg list in a central place.\n\nRight.\n\nI've tried to rework the patch -- only I could not find a better way to\nprepend --show-notes to arg, than just define $show_notes based on\n$git_version and use it in 2 appropriate places.\n\nAlso, --show-notes was introduced in git-1.6.6.2, but our $git_version\nis 3 digits only, so this will be really enabled for git-1.7.0 .\n\n\nThanks for the review, and maybe there is a better way to do it?\n\nKirill\n\n\n---- 8< ----\n\nFrom: Kirill Smelkov <kirr@mns.spb.ru>\nDate: Tue, 11 May 2010 12:17:11 +0400\nSubject: [PATCH] gitk: Show notes by default (like git log do)\n\nStarting 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\nSigned-off-by: Kirill Smelkov <kirr@mns.spb.ru>\n---\n gitk |   15 +++++++++++----\n 1 files changed, 11 insertions(+), 4 deletions(-)\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"}]}