{"thread":{"id":"1459","subject":"\"Child\" information in commit window - and cleanups","startedAt":"2005-08-09T03:04:20Z","lastAt":"2005-08-09T03:09:47Z","messageCount":2,"participants":["Linus Torvalds"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"6978","messageId":"Pine.LNX.4.58.0508081957150.3258@g5.osdl.org","threadId":"1459","inReplyTo":null,"subject":"\"Child\" information in commit window - and cleanups","fromName":"Linus Torvalds","fromEmail":"torvalds@osdl.org","sentAt":"2005-08-09T03:04:20Z","receivedAt":"2005-08-09T03:04:20Z","isPatch":false,"sender":{"key":"torvalds@linux-foundation.org","avatar":"https://avatars.githubusercontent.com/u/1024025?v=4"},"body":"\nThis adds \"Child: \" lines to the commit window, which tells what children \na commit has. \n\nIt also cleans things up: it marks the text widget as no-wrap, which means\nthat it doesn't need to truncate the commit description arbitrarily by\nhand. Also, the description itself is now done by a common helper routine\nthat handles both the parent and the children.\n\nSigned-off-by: Linus Torvalds <torvalds@osdl.org>\n---\n\n[ NOTE! The list of children is \"calculated\" information, since git itself\n  doesn't actually keep any child pointers, and that means that it only\n  lists any children that gitk has seen. There may be other children of a\n  commit in other branches in the same repository, and gitk will not show\n  such children that it doesn't know about.\n\n  But this is useful for walking up and down the links - you get the same \n  information as if you had clicked on a link ]\n\ndiff --git a/gitk b/gitk\n--- a/gitk\n+++ b/gitk\n@@ -387,7 +387,7 @@ proc makewindow {} {\n     set ctext .ctop.cdet.left.ctext\n     text $ctext -bg white -state disabled -font $textfont \\\n \t-width $geometry(ctextw) -height $geometry(ctexth) \\\n-\t-yscrollcommand \".ctop.cdet.left.sb set\"\n+\t-yscrollcommand \".ctop.cdet.left.sb set\" -wrap none\n     scrollbar .ctop.cdet.left.sb -command \"$ctext yview\"\n     pack .ctop.cdet.left.sb -side right -fill y\n     pack $ctext -side left -fill both -expand 1\n@@ -1704,10 +1704,19 @@ proc selcanvline {w x y} {\n     selectline $l 1\n }\n \n+proc commit_descriptor {p} {\n+    global commitinfo\n+    set l \"...\"\n+    if {[info exists commitinfo($p)]} {\n+\tset l [lindex $commitinfo($p) 0]\n+    }\n+    return \"$p ($l)\"\n+}\n+\n proc selectline {l isnew} {\n     global canv canv2 canv3 ctext commitinfo selectedline\n     global lineid linehtag linentag linedtag\n-    global canvy0 linespc parents nparents\n+    global canvy0 linespc parents nparents children nchildren\n     global cflist currentid sha1entry\n     global commentend idtags idline\n \n@@ -1790,15 +1799,15 @@ proc selectline {l isnew} {\n  \n     set commentstart [$ctext index \"end - 1c\"]\n     set comment {}\n-    foreach p $parents($id) {\n-\tset l \"...\"\n-\tif {[info exists commitinfo($p)]} {\n-\t    set l [lindex $commitinfo($p) 0]\n-\t    if {[string length $l] > 32} {\n-\t\tset l \"[string range $l 0 28] ...\"\n-\t    }\n+    if {[info exists parents($id)]} {\n+\tforeach p $parents($id) {\n+\t    append comment \"Parent: [commit_descriptor $p]\\n\"\n+\t}\n+    }\n+    if {[info exists children($id)]} {\n+\tforeach c $children($id) {\n+\t    append comment \"Child:  [commit_descriptor $c]\\n\"\n \t}\n-\tappend comment \"Parent: $p  ($l)\\n\"\n     }\n     append comment \"\\n\"\n     append comment [lindex $info 5]\n"},{"id":"6979","messageId":"Pine.LNX.4.58.0508082007380.3258@g5.osdl.org","threadId":"1459","inReplyTo":"Pine.LNX.4.58.0508081957150.3258@g5.osdl.org","subject":"Re: \"Child\" information in commit window - and cleanups","fromName":"Linus Torvalds","fromEmail":"torvalds@osdl.org","sentAt":"2005-08-09T03:09:47Z","receivedAt":"2005-08-09T03:09:47Z","isPatch":false,"sender":{"key":"torvalds@linux-foundation.org","avatar":"https://avatars.githubusercontent.com/u/1024025?v=4"},"body":"\n\nOn Mon, 8 Aug 2005, Linus Torvalds wrote:\n> \n> It also cleans things up: it marks the text widget as no-wrap, which means\n> that it doesn't need to truncate the commit description arbitrarily by\n> hand.\n\nBtw, in case anybody wondered: there is no x-axis scroll-bar. I don't \nthink one is needed, and if you _really_ want to scroll, you can do so \nby dragging with the middle-mouse-button.\n\nI have to say, with tcl/tk, \"google\" + \"random typing\" can make you appear\nto know what the hell you're doing.\n\n\t\t\tLinus\n"}]}