git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* gitk-1.1 out
@ 2005-06-01 10:09 Paul Mackerras
  2005-06-01 11:19 ` Ingo Molnar
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Paul Mackerras @ 2005-06-01 10:09 UTC (permalink / raw)
  To: git

The latest version of gitk is at:

	http://ozlabs.org/~paulus/gitk/gitk-1.1.tar.gz

(yes, a real tarball this time, with a README even. :)

New features in this version include:

* Commits that are pointed to by a tag in .git/refs/tags are now
  marked with a little yellow "luggage label" shape attached to the
  circle representing the commit.  The tag name is written on the
  label.

* Gitk now uses git-rev-list instead of git-rev-tree.  This means it
  should be faster when looking at just a small range of commits.
  Instead of using "gitk HEAD ^ORIG_HEAD" though, you need to use
  "gitk HEAD ORIG_HEAD"; the arguments are passed to git-rev-list,
  which takes slightly different arguments from git-rev-tree.
  Unfortunately gitk still needs to see the whole git-rev-list output
  before it can start to draw the graph; I plan to address this.

* You can now type a tag name or a SHA1 id in the SHA1 field, and
  press return or the "Goto" button to jump to that commit.

Paul.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: gitk-1.1 out
  2005-06-01 10:09 gitk-1.1 out Paul Mackerras
@ 2005-06-01 11:19 ` Ingo Molnar
  2005-06-02 13:32 ` Sean
  2005-06-08 14:49 ` Linus Torvalds
  2 siblings, 0 replies; 9+ messages in thread
From: Ingo Molnar @ 2005-06-01 11:19 UTC (permalink / raw)
  To: Paul Mackerras; +Cc: git


* Paul Mackerras <paulus@samba.org> wrote:

> The latest version of gitk is at:
> 
> 	http://ozlabs.org/~paulus/gitk/gitk-1.1.tar.gz

works very well for me, and all the bugs of the previous version that i 
could trigger are fixed now.

	Ingo

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: gitk-1.1 out
  2005-06-01 10:09 gitk-1.1 out Paul Mackerras
  2005-06-01 11:19 ` Ingo Molnar
@ 2005-06-02 13:32 ` Sean
  2005-06-08 14:49 ` Linus Torvalds
  2 siblings, 0 replies; 9+ messages in thread
From: Sean @ 2005-06-02 13:32 UTC (permalink / raw)
  To: Paul Mackerras; +Cc: git

On Wed, June 1, 2005 6:09 am, Paul Mackerras said:
> The latest version of gitk is at:
>
> 	http://ozlabs.org/~paulus/gitk/gitk-1.1.tar.gz
>
> (yes, a real tarball this time, with a README even. :)
>

Hi Paul,

Looks really good!  Thought i'd share some homespun rpms that upgrade
Fedora TCL/Tk to use anti-aliased fonts for gitk.   They make the text
displayed in gitk a little nicer to read.  Only tested on Fedora FC3 and
there's no warranty, but they should work for others too.

The rpms and a couple of screenshots are available from:
http://git.homelinux.com

Cheers,
Sean



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: gitk-1.1 out
  2005-06-01 10:09 gitk-1.1 out Paul Mackerras
  2005-06-01 11:19 ` Ingo Molnar
  2005-06-02 13:32 ` Sean
@ 2005-06-08 14:49 ` Linus Torvalds
  2005-06-09  4:46   ` Paul Mackerras
  2005-06-09 12:50   ` Paul Mackerras
  2 siblings, 2 replies; 9+ messages in thread
From: Linus Torvalds @ 2005-06-08 14:49 UTC (permalink / raw)
  To: Paul Mackerras; +Cc: git



On Wed, 1 Jun 2005, Paul Mackerras wrote:
> 
> * Commits that are pointed to by a tag in .git/refs/tags are now
>   marked with a little yellow "luggage label" shape attached to the
>   circle representing the commit.  The tag name is written on the
>   label.

Can you do the same for things in .git/refs/heads? Possibly using another 
color?

I realize that that may sound silly, but a tree that has many branches can 
validly be used with gitk with something like this:

	gitk $(ls .git/refs/heads)

and it results in gitk correctly showing all the different heads, but 
because they aren't marked in the output, it's almost impossible to 
understand what's up.

You can try it out with something like Jeff's tree at 

	rsync://rsync.kernel.org/pub/scm/linux/kernel/git/jgarzik/netdev-2.6.git/

if you want to, but the reason I noticed was that I was trying it out with
the result of "git cvsimport" in a tree that had branches. If it had had
flags for the branches, it would have been an _extremely_ nice
visualization tool, as it was it was just "cool, but I can't tell what
those different tips are" ;)

		Linus

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: gitk-1.1 out
  2005-06-08 14:49 ` Linus Torvalds
@ 2005-06-09  4:46   ` Paul Mackerras
  2005-06-09 14:22     ` Linus Torvalds
  2005-06-09 12:50   ` Paul Mackerras
  1 sibling, 1 reply; 9+ messages in thread
From: Paul Mackerras @ 2005-06-09  4:46 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: git

Linus Torvalds writes:

> Can you do the same for things in .git/refs/heads? Possibly using another 
> color?

Sure - the hardest part is going to be deciding on the shape and color
to use. :)  Perhaps I'll try just using a green rectangle with black
on white text inside and see if that stands out enough.

> I realize that that may sound silly, but a tree that has many branches can 
> validly be used with gitk with something like this:
> 
> 	gitk $(ls .git/refs/heads)

Um, did I break that when I changed to using git-rev-list instead of
git-rev-tree?

Paul.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: gitk-1.1 out
  2005-06-08 14:49 ` Linus Torvalds
  2005-06-09  4:46   ` Paul Mackerras
@ 2005-06-09 12:50   ` Paul Mackerras
  2005-06-09 14:58     ` Linus Torvalds
  1 sibling, 1 reply; 9+ messages in thread
From: Paul Mackerras @ 2005-06-09 12:50 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: git

Linus Torvalds writes:

> Can you do the same for things in .git/refs/heads? Possibly using another 
> color?

Try this patch against gitk-1.1 and let me know what you think.  I
draw the heads as a green rectangle with a black border.

I also added a -t option to gitk which makes it use gitk-rev-tree
instead of git-rev-list, so that you can do

	gitk -t $(ls .git/refs/heads)

Paul.
---

diff -urN gitk-1.1/gitk current/gitk
--- gitk-1.1/gitk	2005-06-01 18:14:51.000000000 +1000
+++ current/gitk	2005-06-09 22:41:56.000000000 +1000
@@ -10,13 +10,18 @@
 # CVS $Revision: 1.20 $
 
 proc getcommits {rargs} {
-    global commits commfd phase canv mainfont
+    global commits commfd phase canv mainfont treemode
     if {$rargs == {}} {
 	set rargs HEAD
     }
     set commits {}
     set phase getcommits
-    if [catch {set commfd [open "|git-rev-list $rargs" r]} err] {
+    if {$treemode} {
+	set cmd "git-rev-tree"
+    } else {
+	set cmd "git-rev-list"
+    }
+    if [catch {set commfd [open "|$cmd $rargs" r]} err] {
 	puts stderr "Error executing git-rev-list: $err"
 	exit 1
     }
@@ -28,7 +33,7 @@
 }
 
 proc getcommitline {commfd}  {
-    global commits parents cdate nparents children nchildren
+    global commits parents cdate nparents children nchildren treemode
     set n [gets $commfd line]
     if {$n < 0} {
 	if {![eof $commfd]} return
@@ -39,8 +44,9 @@
 	    return
 	}
 	if {[string range $err 0 4] == "usage"} {
+	    set cmd [expr {$treemode? "tree": "list"}]
 	    set err "\
-Gitk: error reading commits: bad arguments to git-rev-list.\n\
+Gitk: error reading commits: bad arguments to git-rev-$cmd.\n\
 (Note: arguments to gitk are passed to git-rev-list\
 to allow selection of commits to be displayed.)"
 	} else {
@@ -49,11 +55,19 @@
 	error_popup $err
 	exit 1
     }
-    if {![regexp {^[0-9a-f]{40}$} $line]} {
-	error_popup "Can't parse git-rev-tree output: {$line}"
-	exit 1
+    if {$treemode} {
+	if {![regexp {^[0-9]* ([0-9a-f]{40}):} $line match id]} {
+	    error_popup "Can't parse git-rev-tree output: {$line}"
+	    exit 1
+	}
+	lappend commits $id
+    } else {
+	if {![regexp {^[0-9a-f]{40}$} $line]} {
+	    error_popup "Can't parse git-rev-list output: {$line}"
+	    exit 1
+	}
+	lappend commits $line
     }
-    lappend commits $line
 }
 
 proc readallcommits {} {
@@ -130,7 +144,7 @@
 }
 
 proc readrefs {} {
-    global tagids idtags
+    global tagids idtags headids idheads
     set tags [glob -nocomplain -types f .git/refs/tags/*]
     foreach f $tags {
 	catch {
@@ -154,6 +168,20 @@
 		    lappend idtags($obj) $tag
 		}
 	    }
+	    close $fd
+	}
+    }
+    set heads [glob -nocomplain -types f .git/refs/heads/*]
+    foreach f $heads {
+	catch {
+	    set fd [open $f r]
+	    set line [read $fd 40]
+	    if {[regexp {^[0-9a-f]{40}} $line id]} {
+		set head [file tail $f]
+		set headids($head) $line
+		lappend idheads($line) $head
+	    }
+	    close $fd
 	}
     }
 }
@@ -537,6 +565,7 @@
     global lineid linehtag linentag linedtag commitinfo
     global nextcolor colormap numcommits
     global stopped phase redisplaying selectedline idtags idline
+    global idheads
 
     allcanvs delete all
     set start {}
@@ -616,13 +645,22 @@
 	if {$nparents($id) > 2} {
 	    set xt [expr {$xt + ($nparents($id) - 2) * $linespc}]
 	}
-	if {[info exists idtags($id)] && $idtags($id) != {}} {
+	set marks {}
+	set ntags 0
+	if {[info exists idtags($id)]} {
+	    set marks $idtags($id)
+	    set ntags [llength $marks]
+	}
+	if {[info exists idheads($id)]} {
+	    set marks [concat $marks $idheads($id)]
+	}
+	if {$marks != {}} {
 	    set delta [expr {int(0.5 * ($linespc - $lthickness))}]
 	    set yt [expr $canvy - 0.5 * $linespc]
 	    set yb [expr $yt + $linespc - 1]
 	    set xvals {}
 	    set wvals {}
-	    foreach tag $idtags($id) {
+	    foreach tag $marks {
 		set wid [font measure $mainfont $tag]
 		lappend xvals $xt
 		lappend wvals $wid
@@ -631,12 +669,20 @@
 	    set t [$canv create line $x $canvy [lindex $xvals end] $canvy \
 		       -width $lthickness -fill black]
 	    $canv lower $t
-	    foreach tag $idtags($id) x $xvals wid $wvals {
+	    foreach tag $marks x $xvals wid $wvals {
 		set xl [expr $x + $delta]
 		set xr [expr $x + $delta + $wid + $lthickness]
-		$canv create polygon $x [expr $yt + $delta] $xl $yt\
-		    $xr $yt $xr $yb $xl $yb $x [expr $yb - $delta] \
-		    -width 1 -outline black -fill yellow
+		if {[incr ntags -1] >= 0} {
+		    # draw a tag
+		    $canv create polygon $x [expr $yt + $delta] $xl $yt\
+			$xr $yt $xr $yb $xl $yb $x [expr $yb - $delta] \
+			-width 1 -outline black -fill yellow
+		} else {
+		    # draw a head
+		    set xl [expr $xl - $delta/2]
+		    $canv create polygon $x $yt $xr $yt $xr $yb $x $yb \
+			-width 1 -outline black -fill green
+		}
 		$canv create text $xl $canvy -anchor w -text $tag \
 		    -font $mainfont
 	    }
@@ -1334,7 +1380,8 @@
 set textfont {Courier 9}
 
 set colors {green red blue magenta darkgrey brown orange}
-set colorbycommitter false
+set colorbycommitter 0
+set treemode 0
 
 catch {source ~/.gitk}
 
@@ -1350,6 +1397,7 @@
 	"^-b" { set boldnames 1 }
 	"^-c" { set colorbycommitter 1 }
 	"^-d" { set datemode 1 }
+	"^-t" { set treemode 1 }
 	default {
 	    lappend revtreeargs $arg
 	}

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: gitk-1.1 out
  2005-06-09  4:46   ` Paul Mackerras
@ 2005-06-09 14:22     ` Linus Torvalds
  0 siblings, 0 replies; 9+ messages in thread
From: Linus Torvalds @ 2005-06-09 14:22 UTC (permalink / raw)
  To: Paul Mackerras; +Cc: git



On Thu, 9 Jun 2005, Paul Mackerras wrote:
> 
> > I realize that that may sound silly, but a tree that has many branches can 
> > validly be used with gitk with something like this:
> > 
> > 	gitk $(ls .git/refs/heads)
> 
> Um, did I break that when I changed to using git-rev-list instead of
> git-rev-tree?

No, I fixed git-rev-list to do multiple heads.

		Linus

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: gitk-1.1 out
  2005-06-09 12:50   ` Paul Mackerras
@ 2005-06-09 14:58     ` Linus Torvalds
  2005-06-10  9:56       ` Paul Mackerras
  0 siblings, 1 reply; 9+ messages in thread
From: Linus Torvalds @ 2005-06-09 14:58 UTC (permalink / raw)
  To: Paul Mackerras; +Cc: git



On Thu, 9 Jun 2005, Paul Mackerras wrote:
> 
> Try this patch against gitk-1.1 and let me know what you think.  I
> draw the heads as a green rectangle with a black border.

Works for me. My cvs-import testing "syslinux" tree now has the heads of
the different branches nicely named.

However, I also changed it to allow the "direct" kinds of tags which the 
cvs2git thing creates, where the tag file contains just a direct pointer 
to the commit, rather than a pointer to a tag object.

I'm not a TCL weenie, so this is just a very quick hack, and you may want 
to re-do things properly, but something like the appended works for me..

> I also added a -t option to gitk which makes it use gitk-rev-tree
> instead of git-rev-list, so that you can do
> 
> 	gitk -t $(ls .git/refs/heads)

No need, I think yoy may have an old version of git.

		Linus

--- hacky hack hack ---
--- gitk	2005-06-09 07:26:50.000000000 -0700
+++ gitk	2005-06-09 07:55:00.000000000 -0700
@@ -151,6 +151,11 @@
 	    set fd [open $f r]
 	    set line [read $fd]
 	    if {[regexp {^[0-9a-f]{40}} $line id]} {
+		if {[regexp {[^/]*$} $f direct]} {
+		    set tagids($direct) $id
+		    lappend idtags($id) $direct
+		}
+
 		set contents [split [exec git-cat-file tag $id] "\n"]
 		set obj {}
 		set type {}

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: gitk-1.1 out
  2005-06-09 14:58     ` Linus Torvalds
@ 2005-06-10  9:56       ` Paul Mackerras
  0 siblings, 0 replies; 9+ messages in thread
From: Paul Mackerras @ 2005-06-10  9:56 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: git

Linus Torvalds writes:

> However, I also changed it to allow the "direct" kinds of tags which the 
> cvs2git thing creates, where the tag file contains just a direct pointer 
> to the commit, rather than a pointer to a tag object.
> 
> I'm not a TCL weenie, so this is just a very quick hack, and you may want 
> to re-do things properly, but something like the appended works for me..

I'll use file tail instead of regexp, but apart from that it looks
fine.

> > I also added a -t option to gitk which makes it use gitk-rev-tree
> > instead of git-rev-list, so that you can do
> > 
> > 	gitk -t $(ls .git/refs/heads)
> 
> No need, I think yoy may have an old version of git.

Ah yes, I did.  I'll take the -t option out then.

Paul.

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2005-06-10 10:38 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-06-01 10:09 gitk-1.1 out Paul Mackerras
2005-06-01 11:19 ` Ingo Molnar
2005-06-02 13:32 ` Sean
2005-06-08 14:49 ` Linus Torvalds
2005-06-09  4:46   ` Paul Mackerras
2005-06-09 14:22     ` Linus Torvalds
2005-06-09 12:50   ` Paul Mackerras
2005-06-09 14:58     ` Linus Torvalds
2005-06-10  9:56       ` Paul Mackerras

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).