[BUG] gitk tree view: lines messed up

2016-08-23 Thread Raimar Sandner
Hi,

I'm having problems with gitk not displaying the history tree correctly. The 
lines representing branches are messed up, circles for the individual commits 
are missing (screenshot attached).

I tried to delete ~/.config/git/gitk, even tried a completely fresh user 
account without success. The strangest thing: in an almost identical 
installation I cannot reproduce the issue.

Arch Linux
$ pacman -Q git tk tcl  

   
git 2.9.3-1
tk 8.6.6-1
tcl 8.6.6-1

I'm running out of ideas. There is no error reported from gitk. Is there any 
way to turn on more verbose debugging output? Thanks for your help!

Regards
Raimar

Re: [PATCH] Gitk tree view (correction)

2005-08-25 Thread Linda Walter
Hey, that's a nice one. Now I can easily go through my code without using the 
web interface. It would be nice if you could mark the lines that have changed 
in bold or whatever. It would also be nice, to add the current uncommitted 
working version as "newest revision".

Stagger (Please CC me, as I'm not on the list)



-- 
___
Sign-up for Ads Free at Mail.com
http://promo.mail.com/adsfreejump.htm

-
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


[PATCH] Gitk tree view (correction)

2005-08-24 Thread Ingo Bormuth

I'm sorry for sending a non-working patch. Apparently I got lost in /tmp.

So here is the patch for gitk that allows you to browse the entire tree for
every revision.

The patched gitk script and some screenshots can be found at:

http://public.efil.de/gitk/

For my personal use it's rather sufficient.
If anybody is interested in using it, I would clean it up.

   - Ingo







Add tree view.

   This allows you to browse the entire tree for every revision.
   You may switch back an forward betweem the two modes at any time.

   Keybindings:  v - toggle view mode (tree/commit)
 l - toggle line numbers

---
commit dbbfcc0cabb8eaaff998dc95957d73867f0e2f35
tree 53d7597f0f42ca1c3f7f01c7ca60d14541077a89
parent ccf1ee327f9a7d51704578fa41ba255abfd3a730
author <[EMAIL PROTECTED](none)> Thu, 25 Aug 2005 00:13:22 +0200
committer <[EMAIL PROTECTED](none)> Thu, 25 Aug 2005 00:13:22 +0200

 gitk |  192 --
 1 files changed, 187 insertions(+), 5 deletions(-)

diff --git a/gitk b/gitk
--- a/gitk
+++ b/gitk
@@ -329,12 +329,13 @@ proc makewindow {} {
 global findtype findtypemenu findloc findstring fstring geometry
 global entries sha1entry sha1string sha1but
 global maincursor textcursor curtextcursor
-global rowctxmenu gaudydiff mergemax
+global rowctxmenu gaudydiff mergemax viewmodebutton
 
 menu .bar
 .bar add cascade -label "File" -menu .bar.file
 menu .bar.file
 .bar.file add command -label "Reread references" -command rereadrefs
+.bar.file add command -label "Toggle line numbers" -command togglelinenum
 .bar.file add command -label "Quit" -command doquit
 menu .bar.help
 .bar add cascade -label "Help" -menu .bar.help
@@ -381,6 +382,9 @@ proc makewindow {} {
 .ctop.top.clist add $canv3
 bind .ctop.top.clist  {resizeclistpanes %W %w}
 
+set viewmodebutton Tree
+button .ctop.top.bar.viewmodebutton -textvariable viewmodebutton -command 
toggleviewmode
+pack .ctop.top.bar.viewmodebutton -side left
 set sha1entry .ctop.top.bar.sha1
 set entries $sha1entry
 set sha1but .ctop.top.bar.sha1label
@@ -493,9 +497,11 @@ proc makewindow {} {
 bindkey  "$ctext yview scroll 1 pages"
 bindkey p "selnextline -1"
 bindkey n "selnextline 1"
+bindkey l "togglelinenum"
 bindkey b "$ctext yview scroll -1 pages"
 bindkey d "$ctext yview scroll 18 units"
 bindkey u "$ctext yview scroll -18 units"
+bindkey v "toggleviewmode"
 bindkey / {findnext 1}
 bindkey  {findnext 0}
 bindkey ? findprev
@@ -2815,10 +2821,178 @@ proc gettreediffline {gdtf ids} {
 lappend treediff $file
 }
 
+proc toggleviewmode {} {
+global treemode viewmodebutton selectedline cflist viewpath ctext
+if { $treemode } {
+set viewmodebutton Tree
+set treemode false
+} else { 
+set viewmodebutton Commit
+set treemode true
+}
+# redraw
+if {![info exists selectedline]} return
+set l [expr $selectedline]
+selectline $l 1
+# select current file 
+if {! $treemode } {
+set commitfiles [ $cflist get 0 end ] 
+set index [ lsearch $commitfiles $viewpath ]
+if { $index > 0 } {
+catch { after 500 $ctext yview fmark.$index }
+}
+}
+}
+
+proc togglelinenum {} {
+global showlinenum selectedline
+if { $showlinenum } { set showlinenum false } else { set showlinenum true }
+if {![info exists selectedline]} return
+set l [expr $selectedline]
+selectline $l 1
+}
+
+proc viewfull { path } {
+global ctext currentid viewpath
+$ctext conf -state normal
+$ctext delete 0.0 end
+
+if { $path != "" } { set viewpath $path }
+if { $viewpath == "Comments" ||  $viewpath == "/" || $viewpath == "" } {
+set path ""
+set viewpath "/"
+set kind root
+set sha $currentid
+} else {
+if [catch {set stream [open "|git-ls-tree $currentid $viewpath" r]}] {
+$ctext insert end "ERROR: viewfull: git-ls-tree $currentid 
$viewpath"
+return
+}
+gets $stream line
+fconfigure $stream -blocking 0
+close $stream
+if { $line == "" } {
+set kind "NOT FOUND !!!"
+} else {
+set kind [lindex $line 1]
+}
+set sha  [lindex $line 2]
+}
+   
+viewheader $viewpath $kind
+
+if { $kind == "blob"} {
+  viewblob $sha
+} elseif { $kind == "tree" || $kind == "root"} {
+  viewtree $sha
+}
+}
+
+proc viewheader { path kind } {
+global ctext
+$ctext insert end "type: $kind\n"
+$ctext insert end "path: "
+
+set splitpath [ linsert [ split [ string trim $path "/" ] "/" ] 0 "ROOT" ]
+set name [ lindex $splitpath end ]
+set splitpath [ lrange $splitpath 0 end-1 ]
+set buildpath "/"
+foreach next $splitpath {
+if { $next != "ROOT" } { 
+append

gitk tree view

2005-08-23 Thread Ingo Bormuth

Hi.

This is a quick hack which allows you to browser the entire tree using gitk.

Keybindings:  n - toggle line numbers
  v - toggle tree view

I know, it should be cleaned up. It needs some locking. 
Colored diffs in the tree would be nice.

Is anybody interested in a propper version ???

Cheers Ingo


-- 
   ++
   | Ingo Bormuth,  voicebox & telefax: +49-12125-10226517  |
   | GnuPG key 86326EC9 at http://ibormuth.efil.de/contact  |
   ++





Added tree view.
This is a rather quick hack.

---
commit 4f697f79d6e82d0d0269eeda5f746174c6ba047e
tree c6f82a184da82ed417f170d1b7e2025a801c879b
parent 792fe559d02e55c12d2d544fd6d6f202cbaab6f4
author <[EMAIL PROTECTED](none)> Tue, 23 Aug 2005 06:08:21 +0200
committer <[EMAIL PROTECTED](none)> Tue, 23 Aug 2005 06:08:21 +0200

 gitk |  189 --
 1 files changed, 183 insertions(+), 6 deletions(-)

diff --git a/gitk b/gitk
--- a/gitk
+++ b/gitk
@@ -329,12 +329,13 @@ proc makewindow {} {
 global findtype findtypemenu findloc findstring fstring geometry
 global entries sha1entry sha1string sha1but
 global maincursor textcursor curtextcursor
-global rowctxmenu gaudydiff mergemax
+global rowctxmenu gaudydiff mergemax viewmodebutton
 
 menu .bar
 .bar add cascade -label "File" -menu .bar.file
 menu .bar.file
 .bar.file add command -label "Reread references" -command rereadrefs
+.bar.file add command -label "Toggle line numbers" -command togglelinenum
 .bar.file add command -label "Quit" -command doquit
 menu .bar.help
 .bar add cascade -label "Help" -menu .bar.help
@@ -381,6 +382,9 @@ proc makewindow {} {
 .ctop.top.clist add $canv3
 bind .ctop.top.clist  {resizeclistpanes %W %w}
 
+set viewmodebutton Tree
+button .ctop.top.bar.viewmodebutton -textvariable viewmodebutton -command 
togglesetviewmode
+pack .ctop.top.bar.viewmodebutton -side left
 set sha1entry .ctop.top.bar.sha1
 set entries $sha1entry
 set sha1but .ctop.top.bar.sha1label
@@ -493,9 +497,11 @@ proc makewindow {} {
 bindkey  "$ctext yview scroll 1 pages"
 bindkey p "selnextline -1"
 bindkey n "selnextline 1"
+bindkey l "togglelinenum"
 bindkey b "$ctext yview scroll -1 pages"
 bindkey d "$ctext yview scroll 18 units"
 bindkey u "$ctext yview scroll -18 units"
+bindkey v "toggleviewmode"
 bindkey / {findnext 1}
 bindkey  {findnext 0}
 bindkey ? findprev
@@ -2056,7 +2062,7 @@ proc selectline {l isnew} {
 global lineid linehtag linentag linedtag
 global canvy0 linespc parents nparents children
 global cflist currentid sha1entry
-global commentend idtags idline linknum
+global commentend idtags idline linknum viewmodebutton
 
 $canv delete hover
 if {![info exists lineid($l)] || ![info exists linehtag($l)]} return
@@ -2815,10 +2821,173 @@ proc gettreediffline {gdtf ids} {
 lappend treediff $file
 }
 
+proc toggleviewmode {} {
+global viewmodebutton selectedline
+if { $viewmodebutton == "Commit" } { 
+set viewmodebutton Tree
+} else { 
+set viewmodebutton Commit
+}
+if {![info exists selectedline]} return
+set l [expr $selectedline]
+selectline $l 1
+}
+
+proc togglelinenum {} {
+global showlinenum selectedline
+if { $showlinenum } { set showlinenum false } else { set showlinenum true }
+if {![info exists selectedline]} return
+set l [expr $selectedline]
+selectline $l 1
+}
+
+proc viewfull { path } {
+global ctext currentid viewpath
+$ctext conf -state normal
+$ctext delete 0.0 end
+
+if { $viewpath == "Comments" || $path == "/" } {
+set path ""
+set viewpath ""
+}
+if { $path != "" } {
+set viewpath $path
+}
+
+if [catch {set stream [open "|git-ls-tree $currentid $viewpath" r]}] {
+$ctext insert end "ERROR: viewfull: git-ls-tree $currentid $viewpath"
+return
+}
+gets $stream line
+close $stream
+
+set kind [lindex $line 1]
+set sha  [lindex $line 2]
+
+if { $viewpath == "" } {
+set kind root
+set sha $currentid
+}
+
+if { $line == "" } {
+  set kind "NOT FOUND !!!"
+}
+
+viewheader $viewpath $kind
+
+if { $kind == "blob"} {
+  viewblob $sha
+} elseif { $kind == "tree" || $kind == "root"} {
+  viewtree $sha
+}
+}
+
+proc viewheader { path kind } {
+global ctext
+$ctext insert end "type: $kind\n"
+$ctext insert end "path: "
+
+set splitpath [ linsert [ split [ string trim $path "/" ] "/" ] 0 "ROOT" ]
+set name [ lindex $splitpath end ]
+set splitpath [ lrange $splitpath 0 end-1 ]
+set buildpath "/"
+foreach next $splitpath {
+if { $next != "ROOT" } { 
+append buildpath "$next/"
+}
+