{"thread":{"id":"11583","subject":"gitk dev branch: F5 problem again","startedAt":"2008-01-11T13:17:29Z","lastAt":"2008-01-12T10:55:08Z","messageCount":2,"participants":["Johannes Sixt","Paul Mackerras"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"65017","messageId":"47876C69.8070604@viscovery.net","threadId":"11583","inReplyTo":null,"subject":"gitk dev branch: F5 problem again","fromName":"Johannes Sixt","fromEmail":"j.sixt@viscovery.net","sentAt":"2008-01-11T13:17:29Z","receivedAt":"2008-01-11T13:17:29Z","isPatch":false,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"I'm using gitk's dev branch (476ca63d Index [fnvr]highlights by id...) on\nWindows.\n\nStart gitk like this:\n\n   gitk somefile.c\n\nwhile on a branch whose tip touches somefile.c.\n\nNow:\n\n   git commit --amend\n\nThen press F5 in gitk. I get these error reports after which gitk is\nunresponsive:\n\ncan't read \"children(1,)\": no such element in array\ncan't read \"children(1,)\": no such element in array\n    while executing\n\"lindex $children($curview,$id) 0\"\n    (procedure \"ordertoken\" line 15)\n    invoked from within\n\"ordertoken $id\"\n    (procedure \"idcol\" line 2)\n    invoked from within\n\"idcol $idlist $id\"\n    (procedure \"layoutrows\" line 51)\n    invoked from within\n\"layoutrows $rl1 $r\"\n    (procedure \"drawcommits\" line 36)\n    invoked from within\n\"drawcommits $row $endrow\"\n    (procedure \"drawvisible\" line 51)\n    invoked from within\n\"drawvisible\"\n    (procedure \"scrollcanv\" line 3)\n    invoked from within\n\"scrollcanv .tf.histframe.csb 0.00852273 0.146591\"\n\n\n... same as above ...\n\"drawvisible\"\n    (procedure \"scrollcanv\" line 3)\n    invoked from within\n\"scrollcanv .tf.histframe.csb 0.0170455 0.155114\"\n\n\n... same as above ...\n\"drawvisible\"\n    (\"eval\" body line 1)\n    invoked from within\n\"eval $script\"\n    (procedure \"dorunq\" line 9)\n    invoked from within\n\"dorunq\"\n    (\"after\" script)\n\n\n-- Hannes\n"},{"id":"65165","messageId":"18312.40076.179788.88596@cargo.ozlabs.ibm.com","threadId":"11583","inReplyTo":"47876C69.8070604@viscovery.net","subject":"Re: gitk dev branch: F5 problem again","fromName":"Paul Mackerras","fromEmail":"paulus@samba.org","sentAt":"2008-01-12T10:55:08Z","receivedAt":"2008-01-12T10:55:08Z","isPatch":false,"sender":{"key":"paulus@samba.org","avatar":"https://avatars.githubusercontent.com/u/1606439?v=4"},"body":"Johannes Sixt writes:\n\n> I'm using gitk's dev branch (476ca63d Index [fnvr]highlights by id...) on\n> Windows.\n> \n> Start gitk like this:\n> \n>    gitk somefile.c\n> \n> while on a branch whose tip touches somefile.c.\n> \n> Now:\n> \n>    git commit --amend\n> \n> Then press F5 in gitk. I get these error reports after which gitk is\n> unresponsive:\n> \n> can't read \"children(1,)\": no such element in array\n\nThanks.\n\nI found the reason for the Tcl errors - an incorrect optimization in\nmake_disporder - and I have pushed out a fix.\n\nHowever, that shows up another problem, due to the way parent\nrewriting does (or doesn't) work when we are limiting both by\nrevisions and by path.  When you press F5 in the above scenario, you\nwill get the new version of the commit, with its real parent shown as\nan open-circle commit, disconnected from the rest of the graph.\n\nWhat's happening here is that to do the update, gitk first re-reads\nall the references, notices that the head has changed, and does a git\nlog command like:\n\n\tgit log newhead ^oldhead -- somefile.c\n\nThe git log traversal stops as soon as it finds a commit which is an\nancestor of oldhead, which in this case will be oldhead's (and\nnewhead's) real parent.  Because the traversal doesn't go far enough\nto find another commit that touches somefile.c (which would be the\nfake parent that gitk would want to use for the graph), the parent\nrewriting doesn't happen and git log outputs the newhead commit with\nits real parent rather than a fake parent.  Assuming the real parent\ndoesn't touch somefile.c, it is a commit that gitk doesn't have in its\ngraph, so it can't join newhead into the existing graph properly.  I'm\nnot sure how best to fix that.  I'll have to think about it.\n\nPaul.\n"}]}