{"thread":{"id":"2029","subject":"[PATCH] gitk: Add \"Refs\" menu","startedAt":"2005-10-06T00:38:08Z","lastAt":"2005-10-12T17:47:44Z","messageCount":9,"participants":["Pavel Roskin","Paul Mackerras","Sven Verdoolaege","Marco Costalba","H. Peter Anvin"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"9746","messageId":"1128559088.32103.8.camel@dv","threadId":"2029","inReplyTo":null,"subject":"[PATCH] gitk: Add \"Refs\" menu","fromName":"Pavel Roskin","fromEmail":"proski@gnu.org","sentAt":"2005-10-06T00:38:08Z","receivedAt":"2005-10-06T00:38:08Z","isPatch":true,"sender":{"key":"proski@gnu.org","avatar":null},"body":"Hello, Paul!\n\nThis patch adds \"Refs\" menu to gitk.  It makes all branches, tags and\nother ref objects appear as menu items.  Selecting one of the items\nselects the corresponding line in the view.\n\nKnown limitation: it's only possible to go to the refs present in the\ncurrent view.  Otherwise, gitk would have to re-run git-rev-list.\n\nSigned-off-by: Pavel Roskin <proski@gnu.org>\n\ndiff --git a/gitk b/gitk\n--- a/gitk\n+++ b/gitk\n@@ -285,6 +285,7 @@ proc readrefs {} {\n \t}\n     }\n     readotherrefs refs {} {tags heads}\n+    setrefsmenu\n }\n \n proc readotherrefs {base dname excl} {\n@@ -538,6 +539,62 @@ proc makewindow {} {\n     $rowctxmenu add command -label \"Write commit to file\" -command writecommit\n }\n \n+proc gotocommit_menu {sha1} {\n+    global idline\n+\n+    if {[info exists idline($sha1)]} {\n+\tselectline $idline($sha1) 1\n+\treturn\n+    } else {\n+\t# Should we re-run git-rev-list?\n+\terror_popup \"$sha1 is not in the current view\"\n+    }\n+}\n+\n+proc setrefsmenu {} {\n+    global headids tagids otherrefids\n+\n+    if {[winfo exists .bar.refs]} {\n+\tforeach w [winfo children .bar.refs] {\n+\t    destroy $w\n+\t}\n+\t.bar.refs delete 1 3\n+    } else {\n+\t.bar add cascade -label \"Refs\" -menu .bar.refs\n+\tmenu .bar.refs\n+    }\n+\n+    set refids [lsort -unique [concat [array names headids]]]\n+    if {[llength $refids] > 0} {\n+\t.bar.refs add cascade -label \"Branches\" -menu .bar.refs.heads\n+\tmenu .bar.refs.heads\n+\tforeach v $refids {\n+\t    .bar.refs.heads add command -label $v \\\n+\t\t-command \"gotocommit_menu $headids($v)\"\n+\t}\n+    }\n+\n+    set refids [lsort -unique [concat [array names tagids]]]\n+    if {[llength $refids] > 0} {\n+\t.bar.refs add cascade -label \"Tags\" -menu .bar.refs.tags\n+\tmenu .bar.refs.tags\n+\tforeach v $refids {\n+\t    .bar.refs.tags add command -label $v \\\n+\t\t-command \"gotocommit_menu $tagids($v)\"\n+\t}\n+    }\n+\n+    set refids [lsort -unique [concat [array names otherrefids]]]\n+    if {[llength $refids] > 0} {\n+\t.bar.refs add cascade -label \"Other\" -menu .bar.refs.other\n+\tmenu .bar.refs.other\n+\tforeach v $refids {\n+\t    .bar.refs.other add command -label $v \\\n+\t\t-command \"gotocommit_menu $otherrefids($v)\"\n+\t}\n+    }\n+}\n+\n # when we make a key binding for the toplevel, make sure\n # it doesn't get triggered when that key is pressed in the\n # find string entry widget.\n\n\n-- \nRegards,\nPavel Roskin\n"},{"id":"9751","messageId":"1128571883.32103.48.camel@dv","threadId":"2029","inReplyTo":"1128559088.32103.8.camel@dv","subject":"[PATCH] gitk: Add \"Refs\" menu - revised","fromName":"Pavel Roskin","fromEmail":"proski@gnu.org","sentAt":"2005-10-06T04:11:23Z","receivedAt":"2005-10-06T04:11:23Z","isPatch":true,"sender":{"key":"proski@gnu.org","avatar":null},"body":"Hello!\n\nThis is an updated revision of the original patch.  Unneeded concat has\nbeen removed.  Error message uses name, not SHA1 ID.  If there is\ninformation for the tag, it's displayed even in the ID is not in the\nlist.  Thanks to Brett Schwarz for help.\n\n---------------------------------\n\nThis patch adds \"Refs\" menu to gitk.  It makes all branches, tags and\nother ref objects appear as menu items.  Selecting one of the items\nselects the corresponding line in the view.\n\nIt's only possible to go to the refs present in the current view.\nHowever, information for tags is shown even if the corresponding ID is\nnot available.\n\nSigned-off-by: Pavel Roskin <proski@gnu.org>\n\ndiff -u b/gitk b/gitk\n--- b/gitk\n+++ b/gitk\n@@ -285,6 +285,7 @@\n \t}\n     }\n     readotherrefs refs {} {tags heads}\n+    setrefsmenu\n }\n \n proc readotherrefs {base dname excl} {\n@@ -538,6 +539,65 @@\n     $rowctxmenu add command -label \"Write commit to file\" -command writecommit\n }\n \n+proc gotocommit_menu {sha1 name} {\n+    global idline tagids tagcontents\n+\n+    if {[info exists idline($sha1)]} {\n+\tselectline $idline($sha1) 1\n+    } else {\n+\t# Should we re-run git-rev-list?\n+\terror_popup \"$name is not in the current view\"\n+    }\n+\n+    if {[info exists tagcontents($name)]} {\n+\tshowtag $name 1\n+    }\n+}\n+\n+proc setrefsmenu {} {\n+    global headids tagids otherrefids\n+\n+    if {[winfo exists .bar.refs]} {\n+\tforeach w [winfo children .bar.refs] {\n+\t    destroy $w\n+\t}\n+\t.bar.refs delete 1 3\n+    } else {\n+\t.bar add cascade -label \"Refs\" -menu .bar.refs\n+\tmenu .bar.refs\n+    }\n+\n+    set refids [lsort -unique [array names headids]]\n+    if {[llength $refids] > 0} {\n+\t.bar.refs add cascade -label \"Branches\" -menu .bar.refs.heads\n+\tmenu .bar.refs.heads\n+\tforeach v $refids {\n+\t    .bar.refs.heads add command -label $v \\\n+\t\t-command [list gotocommit_menu $headids($v) $v]\n+\t}\n+    }\n+\n+    set refids [lsort -unique [array names tagids]]\n+    if {[llength $refids] > 0} {\n+\t.bar.refs add cascade -label \"Tags\" -menu .bar.refs.tags\n+\tmenu .bar.refs.tags\n+\tforeach v $refids {\n+\t    .bar.refs.tags add command -label $v \\\n+\t\t-command [list gotocommit_menu $tagids($v) $v]\n+\t}\n+    }\n+\n+    set refids [lsort -unique [array names otherrefids]]\n+    if {[llength $refids] > 0} {\n+\t.bar.refs add cascade -label \"Other\" -menu .bar.refs.other\n+\tmenu .bar.refs.other\n+\tforeach v $refids {\n+\t    .bar.refs.other add command -label $v \\\n+\t\t-command [list gotocommit_menu $otherrefids($v) $v]\n+\t}\n+    }\n+}\n+\n # when we make a key binding for the toplevel, make sure\n # it doesn't get triggered when that key is pressed in the\n # find string entry widget.\n\n\n-- \nRegards,\nPavel Roskin\n"},{"id":"9957","messageId":"17227.44393.412591.267878@cargo.ozlabs.ibm.com","threadId":"2029","inReplyTo":"1128559088.32103.8.camel@dv","subject":"Re: [PATCH] gitk: Add \"Refs\" menu","fromName":"Paul Mackerras","fromEmail":"paulus@samba.org","sentAt":"2005-10-11T12:17:45Z","receivedAt":"2005-10-11T12:17:45Z","isPatch":true,"sender":{"key":"paulus@samba.org","avatar":"https://avatars.githubusercontent.com/u/1606439?v=4"},"body":"Pavel Roskin writes:\n\n> This patch adds \"Refs\" menu to gitk.  It makes all branches, tags and\n> other ref objects appear as menu items.  Selecting one of the items\n> selects the corresponding line in the view.\n\nSorry I haven't responded before - I have got way behind with my email\ndue to a vacation and to concentrating on the merge of the ppc32 and\nppc64 kernel sources.  It will probably be a bit longer before I can\nget to look at this.\n\nThanks,\nPaul.\n"},{"id":"9990","messageId":"1129080380.2427.21.camel@dv","threadId":"2029","inReplyTo":"17227.44393.412591.267878@cargo.ozlabs.ibm.com","subject":"Re: [PATCH] gitk: Add \"Refs\" menu","fromName":"Pavel Roskin","fromEmail":"proski@gnu.org","sentAt":"2005-10-12T01:26:20Z","receivedAt":"2005-10-12T01:26:20Z","isPatch":true,"sender":{"key":"proski@gnu.org","avatar":null},"body":"Hi, Paul!\n\nOn Tue, 2005-10-11 at 22:17 +1000, Paul Mackerras wrote:\n> Pavel Roskin writes:\n> \n> > This patch adds \"Refs\" menu to gitk.  It makes all branches, tags and\n> > other ref objects appear as menu items.  Selecting one of the items\n> > selects the corresponding line in the view.\n> \n> Sorry I haven't responded before - I have got way behind with my email\n> due to a vacation and to concentrating on the merge of the ppc32 and\n> ppc64 kernel sources.  It will probably be a bit longer before I can\n> get to look at this.\n\nNo problem.  Thank you for letting me know.\n\nI'm not a GUI designer and I'm not experienced in Tcl/Tk, so I'll\nappreciate critical look at the patches.\n\nI think that gitk should move away from being just a frontend to\ngit-rev-list.  There is more information in the repository, such as\ntags, branches, stgit patches etc.  All this information needs to be\nrepresented in some way, and using the menu was just the first approach.\n\nBrowsing trees and opening files for a given commit would be great and\nhelpful from developers migrating from CVS.\n\nAnd making gitk cooperate with stgit would be a killer application not\njust for gitk and stgit, but for git itself (i.e. it could be the reason\nwhy git is chosen for development over e.g. Mercurial for new projects).\n\nI don't want to distract you from PPC work, but your return to gitk\ndevelopment would be very welcome :-)\n\n-- \nRegards,\nPavel Roskin\n"},{"id":"10004","messageId":"20051012073139.GV8383MdfPADPa@greensroom.kotnet.org","threadId":"2029","inReplyTo":"1129080380.2427.21.camel@dv","subject":"Re: [PATCH] gitk: Add \"Refs\" menu","fromName":"Sven Verdoolaege","fromEmail":"skimo@kotnet.org","sentAt":"2005-10-12T07:31:39Z","receivedAt":"2005-10-12T07:31:39Z","isPatch":true,"sender":{"key":"skimo@kotnet.org","avatar":null},"body":"On Tue, Oct 11, 2005 at 09:26:20PM -0400, Pavel Roskin wrote:\n> Browsing trees and opening files for a given commit would be great and\n> helpful from developers migrating from CVS.\n\nSomething like this ?\n\n    From: Ingo Bormuth <ibormuth@efil.de>\n    To: git@vger.kernel.org\n    Cc: paulus@samba.org\n    Subject: [PATCH] Gitk tree view (correction)\n    Message-ID: <20050824223550.GA23693@kruemel>\n\nskimo\n"},{"id":"10013","messageId":"20051012115559.6546.qmail@web26305.mail.ukl.yahoo.com","threadId":"2029","inReplyTo":"1129080380.2427.21.camel@dv","subject":"Re: [PATCH] gitk: Add \"Refs\" menu","fromName":"Marco Costalba","fromEmail":"mcostalba@yahoo.it","sentAt":"2005-10-12T11:55:59Z","receivedAt":"2005-10-12T11:55:59Z","isPatch":true,"sender":{"key":"mcostalba@gmail.com","avatar":null},"body":" \n> And making gitk cooperate with stgit would be a killer application not\n> just for gitk and stgit, but for git itself (i.e. it could be the reason\n> why git is chosen for development over e.g. Mercurial for new projects).\n> \n\nNot to advertise, but qgit (http://digilander.libero.it/mcostalba/) already offers \nstgit integration, among other things.\n\nI plan to release a new version implementing various suggestion from the list this week, there are\nalso important stgit fixes and upgrades. \n\nTo have a look at new features check the git arcihve: cg-clone\nhttp://digilander.libero.it/mcostalba/qgit.git\n\n\n  Marco\n\n\n\n\n\t\t\n__________________________________ \nYahoo! Music Unlimited \nAccess over 1 million songs. Try it free.\nhttp://music.yahoo.com/unlimited/\n"},{"id":"10023","messageId":"1129127692.31997.10.camel@dv","threadId":"2029","inReplyTo":"20051012073139.GV8383MdfPADPa@greensroom.kotnet.org","subject":"Re: [PATCH] gitk: Add \"Refs\" menu","fromName":"Pavel Roskin","fromEmail":"proski@gnu.org","sentAt":"2005-10-12T14:34:52Z","receivedAt":"2005-10-12T14:34:52Z","isPatch":true,"sender":{"key":"proski@gnu.org","avatar":null},"body":"On Wed, 2005-10-12 at 09:31 +0200, Sven Verdoolaege wrote:\n> On Tue, Oct 11, 2005 at 09:26:20PM -0400, Pavel Roskin wrote:\n> > Browsing trees and opening files for a given commit would be great and\n> > helpful from developers migrating from CVS.\n> \n> Something like this ?\n> \n>     From: Ingo Bormuth <ibormuth@efil.de>\n>     To: git@vger.kernel.org\n>     Cc: paulus@samba.org\n>     Subject: [PATCH] Gitk tree view (correction)\n>     Message-ID: <20050824223550.GA23693@kruemel>\n\nThat's pretty good, thank you.  Although I think \"Tree\" and \"Commit\"\nshould be links on top of the view pane rather than a button.  \"Commit\"\nbutton is especially confusing - one could think that it would commit\nsomething.\n\nAlso, it would be really great to put line numbers in a separate widget\nso that they are never selected with the text.  When done correctly,\nmost users will never want to turn the line numbers off.\n\n-- \nRegards,\nPavel Roskin\n"},{"id":"10032","messageId":"1129132998.31997.32.camel@dv","threadId":"2029","inReplyTo":"20051012115559.6546.qmail@web26305.mail.ukl.yahoo.com","subject":"Re: [PATCH] gitk: Add \"Refs\" menu","fromName":"Pavel Roskin","fromEmail":"proski@gnu.org","sentAt":"2005-10-12T16:03:18Z","receivedAt":"2005-10-12T16:03:18Z","isPatch":true,"sender":{"key":"proski@gnu.org","avatar":null},"body":"On Wed, 2005-10-12 at 04:55 -0700, Marco Costalba wrote:\n>  > And making gitk cooperate with stgit would be a killer application not\n> > just for gitk and stgit, but for git itself (i.e. it could be the reason\n> > why git is chosen for development over e.g. Mercurial for new projects).\n> > \n> \n> Not to advertise, but qgit (http://digilander.libero.it/mcostalba/) already offers \n> stgit integration, among other things.\n\nVery nice.\n\nBut it doesn't show correctly in the qt theme I was using (which must be\nthe default theme in Fedora Core 4 because I never changed it):\n\nhttp://red-bean.com/proski/qgit.png\n\nThe blame for the ugly default gray background should be on Qt or on\nFedora, but it seems to me that qgit is hardcoding white and light gray\n(see ODD_LINE_COL and EVEN_LINE_COL in src/mainimpl.cpp).\n\nThe style selector in kcontrol has \"Standard Background\" and \"Alternate\nBackground for Lists\".  I don't know if it has an equivalent in qt.\nMaybe you could use the standard background and a slightly darkened\nversion.\n\nAlso, please use months names on the homepage.  I thought qgit 0.94 was\nreleased on October 9th.\n\n-- \nRegards,\nPavel Roskin\n"},{"id":"10033","messageId":"434D4C40.5020402@zytor.com","threadId":"2029","inReplyTo":"20051012115559.6546.qmail@web26305.mail.ukl.yahoo.com","subject":"Re: [PATCH] gitk: Add \"Refs\" menu","fromName":"H. Peter Anvin","fromEmail":"hpa@zytor.com","sentAt":"2005-10-12T17:47:44Z","receivedAt":"2005-10-12T17:47:44Z","isPatch":true,"sender":{"key":"hpa@zytor.com","avatar":null},"body":"Marco Costalba wrote:\n>  \n> \n>>And making gitk cooperate with stgit would be a killer application not\n>>just for gitk and stgit, but for git itself (i.e. it could be the reason\n>>why git is chosen for development over e.g. Mercurial for new projects).\n>>\n> \n> \n> Not to advertise, but qgit (http://digilander.libero.it/mcostalba/) already offers \n> stgit integration, among other things.\n> \n> I plan to release a new version implementing various suggestion from the list this week, there are\n> also important stgit fixes and upgrades. \n> \n> To have a look at new features check the git arcihve: cg-clone\n> http://digilander.libero.it/mcostalba/qgit.git\n> \n\nI looked at qgit at one time, and I find its UI to be much less pleasant \nto look at that gitk, which is unfortunate, because it's much faster. \nBoth the graph and the color scheme are much less pleasant, which \ndistracts from the information conveyed.\n\n\t-hpa\n"}]}