Re: gitk "hyperlinks" (was Re: Display of merges in gitk)
On Sat, Aug 06, 2005 at 08:44:10AM -0700, Linus Torvalds wrote: > > > On Sat, 6 Aug 2005, Kay Sievers wrote: > > > > Damn cool? No problem. :) > > > > http://www.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=403fe5ae57c831968c3dbbaba291ae825a1c5aaa > > Goodie. Although when I looked at it first, it wasn't obvious - the link > is same font, same color as the rest. Maybe make them stand out a _bit_ > more? It's blue now, to invite you to click on it. :) Kay - To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: gitk "hyperlinks" (was Re: Display of merges in gitk)
On Sat, Aug 06, 2005 at 09:20:16AM -0700, Linus Torvalds wrote: > Looks good also. I assume the mouse can't change when it hovers? In gitk? This is be possible. My patch[1] does it. The way it's done stinks a little bit, though. and are bound on a tag common to all the "hyperlinks", and change the -cursor of the whole widget---either to hand2 or the empty string. +$ctext tag bind Commit { %W configure -cursor hand2 } +$ctext tag bind Commit { %W configure -cursor {} } My patch also underlines links, as requested in a different message in this thread. +$ctext tag configure Commit -underline yes -foreground blue Jeff [1] http://www.gelato.unsw.edu.au/archives/git/0508/7253.html pgpTyavkb8S8o.pgp Description: PGP signature
Re: gitk "hyperlinks" (was Re: Display of merges in gitk)
On Sat, 6 Aug 2005, Paul Mackerras wrote: > Linus Torvalds writes: > > > > - "clickable" SHA1's in commit messages would be really really cool if > >something like that is even possible with tcl/tk. > > Done, and it was even pretty easy. It took only about a dozen lines. Looks good also. I assume the mouse can't change when it hovers? > Good idea. Also done. :) It's on master.kernel.org now in my gitk.git > directory. Hopefully Junio will pull it into git soon. The current > version also squishes the graph horizontally if it gets too wide > (i.e. more than half the width of the top-left pane). Yeah, that looks weird when the lines start turning soft ans squiggly. Linus - To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: gitk "hyperlinks" (was Re: Display of merges in gitk)
On Sat, 6 Aug 2005, Kay Sievers wrote: > > Damn cool? No problem. :) > > http://www.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=403fe5ae57c831968c3dbbaba291ae825a1c5aaa Goodie. Although when I looked at it first, it wasn't obvious - the link is same font, same color as the rest. Maybe make them stand out a _bit_ more? But yes, works well. Thanks, Linus - To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: gitk "hyperlinks" (was Re: Display of merges in gitk)
Linus Torvalds writes: > - "clickable" SHA1's in commit messages would be really really cool if >something like that is even possible with tcl/tk. Done, and it was even pretty easy. It took only about a dozen lines. > - I'd like to have a "back button". Not just for the above kind of thing, >but in general too: when searching for something, it would just be very >nice if gitk just kept a list of the last commits that have >been selected, and there was a web-browser-like button that went >back/forward in history. Good idea. Also done. :) It's on master.kernel.org now in my gitk.git directory. Hopefully Junio will pull it into git soon. The current version also squishes the graph horizontally if it gets too wide (i.e. more than half the width of the top-left pane). Paul. - To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: gitk "hyperlinks" (was Re: Display of merges in gitk)
On Fri, Aug 05, 2005 at 07:37:41AM -0700, Linus Torvalds wrote: > > [ Also Kay Sievers, because the clickability thing sounds like a > potentially good thing for webgit too.. ] ... > For 2.6.13 we've been reverting some stuff lately, to make sure we get a > stable release. That's fine, and when I revert something I try to mention > the commit ID of the thing I revert in the message. Apparently others do > too, as indicated by a patch I just got from Petr Vandovec. So we've got > for example: > > Undo: d8c4b4195c7d664baf296818bf756775149232d3 > > Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]> ... > and when I use gitk, it would be just too damn cool for words if I could > easily follow the SHA1's mentioned in the commit message. ... Damn cool? No problem. :) http://www.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=403fe5ae57c831968c3dbbaba291ae825a1c5aaa Kay - To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: gitk "hyperlinks" (was Re: Display of merges in gitk)
On Fri, Aug 05, 2005 at 07:37:41AM -0700, Linus Torvalds wrote: > For 2.6.13 we've been reverting some stuff lately, to make sure we get a > stable release. That's fine, and when I revert something I try to mention > the commit ID of the thing I revert in the message. Apparently others do > too, as indicated by a patch I just got from Petr Vandovec. So we've got > for example: [snipped] The following code worked for me on a toy commit. I'm not sure the regular expression in linkcommits is right if the SHA1 is followed by a colon or a comma, as I noticed it was in your examples. If it doesn, then removing the [[:<:]] and [[:>:]] will probably fix it. Things that look like SHA1s are highlighted even if they don't actually exist. There is probably a "more right" place to do the '$ctext tag bind Commit' commands but I didn't find it right away. diff --git a/gitk b/gitk --- a/gitk +++ b/gitk @@ -1753,6 +1753,11 @@ proc selectline {l} { $ctext conf -state disabled set commentend [$ctext index "end - 1c"] +linkcommits $ctext 0.0 $commentend +$ctext tag configure Commit -underline yes -foreground blue +$ctext tag bind Commit { %W configure -cursor hand2 } +$ctext tag bind Commit { %W configure -cursor {} } +$ctext tag bind Commit { linkclick %W %x %y } $cflist delete 0 end $cflist insert end "Comments" if {$nparents($id) == 1} { @@ -1762,6 +1767,30 @@ proc selectline {l} { } } +proc linkclick {w x y} { +set index [$w index @$x,$y] +set tags [$w tag names $index] +foreach c $tags { +if {![string match {C_*} $c]} { continue; } +global sha1string +set sha1string [string range $c 2 end] +gotocommit +} +} + +proc linkcommits {w start end} { +while {1} { +set pos [$w search -regexp {[[:<:]][0-9a-fA-F]{40}[[:>:]]} $start $end] +if {$pos == {}} {break} + +set commit [$w get $pos "$pos+40c"] + +$w tag add Commit $pos "$pos+40c" +$w tag add C_$commit $pos "$pos+40c" +set start [$w index "$pos+40c"] +} +} + proc selnextline {dir} { global selectedline if {![info exists selectedline]} return pgppDwXRz0T1l.pgp Description: PGP signature
gitk "hyperlinks" (was Re: Display of merges in gitk)
[ Also Kay Sievers, because the clickability thing sounds like a potentially good thing for webgit too.. ] For 2.6.13 we've been reverting some stuff lately, to make sure we get a stable release. That's fine, and when I revert something I try to mention the commit ID of the thing I revert in the message. Apparently others do too, as indicated by a patch I just got from Petr Vandovec. So we've got for example: 889371f61fd5bb914d0331268f12432590cf7e85: Author: Linus Torvalds <[EMAIL PROTECTED]> 2005-07-30 13:41:56 Committer: Linus Torvalds <[EMAIL PROTECTED]> 2005-07-30 13:41:56 Revert "yenta free_irq on suspend" ACPI is wrong. Devices should not release their IRQ's on suspend and re-aquire them on resume. ACPI should just re-init the IRQ controller instead of breaking most drivers very subtly. Breakage reported by Hugh Dickins <[EMAIL PROTECTED]> Undo: d8c4b4195c7d664baf296818bf756775149232d3 Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]> and 403fe5ae57c831968c3dbbaba291ae825a1c5aaa: Author: Petr Vandrovec <[EMAIL PROTECTED]> 2005-08-05 06:50:07 Committer: Linus Torvalds <[EMAIL PROTECTED]> 2005-08-05 06:57:44 [PATCH] rtc: msleep() cannot be used from interrupt Since the beginning of July my Opteron box was randomly crashing and being rebooted by hardware watchdog. Today it finally did it in front of me, and this patch will hopefully fix it. The problem is that at the end of June (the 28th, to be exact: commit 47f176fdaf8924bc83fddcf9658f2fd3ef60d573, "[PATCH] Using msleep() instead of HZ") rtc_get_rtc_time ... and when I use gitk, it would be just too damn cool for words if I could easily follow the SHA1's mentioned in the commit message. I can just cut-and-paste the SHA1, and I've verified that it works fine. However, as you'v enoticed, I'm of the whiny kind, and I thought it could be easier. So I'm whining again. Mommy, mommy, can you make my life easier So I noticed that I really would like two things: - "clickable" SHA1's in commit messages would be really really cool if something like that is even possible with tcl/tk. Now, if you can highlight them when showing the message, that would be extra cool, but even without any highlighing, the thing actually _almost_ works fine already: you can double-click the SHA1, and it will select it. You then have to move the mouse to the "goto" window, and paste in the SHA1 there. And this is where it would be good if this sequence could be simplified a bit. Even if it's something as simple as accepting the SHA1 paste into the same window (not having to go to the "goto" window: just double-click on the SHA1, and then right-click to "paste it back"). - I'd like to have a "back button". Not just for the above kind of thing, but in general too: when searching for something, it would just be very nice if gitk just kept a list of the last commits that have been selected, and there was a web-browser-like button that went back/forward in history. But especially when looking at a revert, I just want to first go to the thing we revert, see what's going on there (get the "historical perspective" - commit log for why the original was done etc), and then I'd want to go back (and possibly forth and back again ;). And while the revert mentioned the thing it reverted (so I could cut-and-paste), the thing it reverted obviously does _not_ mention the thing that reverted it, so now I have to manually just scroll back. This same thing happens for a failed search (I search for xyz, and it actually finds it, and I realize that that was the wrong search, but now I'm two months back..) Mommy, mommy, plase Linus - To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html