From 0166419a197cea0ceef3aed8c72023deb015ecf4 Mon Sep 17 00:00:00 2001 From: Sam Vilain Date: Wed, 17 Oct 2007 11:33:04 +1300 Subject: gitk: disable colours when calling git log If the user specifies 'diff.color = 1' in their configuration file, then gitk will not start. Disable colours when calling git log. Signed-off-by: Sam Vilain Signed-off-by: Shawn O. Pearce --- gitk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gitk b/gitk index 300fdceb35..999e3c2188 100755 --- a/gitk +++ b/gitk @@ -92,7 +92,7 @@ proc start_rev_list {view} { set order "--date-order" } if {[catch { - set fd [open [concat | git log -z --pretty=raw $order --parents \ + set fd [open [concat | git log --no-color -z --pretty=raw $order --parents \ --boundary $viewargs($view) "--" $viewfiles($view)] r] } err]} { error_popup "Error executing git rev-list: $err" -- cgit v1.2.1 From 5dd57d512225bb82aa0010b39aaec0085d471eac Mon Sep 17 00:00:00 2001 From: Jonathan del Strother Date: Mon, 15 Oct 2007 10:33:07 +0100 Subject: gitk: Add support for OS X mouse wheel MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit (Väinö Järvelä supplied this patch a while ago for 1.5.2. It no longer applied cleanly, so I'm reposting it.) MacBook doesn't seem to recognize MouseRelease-4 and -5 events, at all. So i added a support for the MouseWheel event, which i limited to Tcl/tk aqua, as i couldn't test it neither on Linux or Windows. Tcl/tk needs to be updated from the version that is shipped with OS X 10.4 Tiger, for this patch to work. Signed-off-by: Jonathan del Strother Signed-off-by: Shawn O. Pearce --- gitk | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/gitk b/gitk index 999e3c2188..46673e3b9c 100755 --- a/gitk +++ b/gitk @@ -843,6 +843,12 @@ proc makewindow {} { } else { bindall "allcanvs yview scroll -5 units" bindall "allcanvs yview scroll 5 units" + if {[tk windowingsystem] eq "aqua"} { + bindall { + set delta [expr {- (%D)}] + allcanvs yview scroll $delta units + } + } } bindall <2> "canvscan mark %W %x %y" bindall "canvscan dragto %W %x %y" -- cgit v1.2.1 From 5e85ec4cd0658232fa8ee13e8cd9da21e0e4973e Mon Sep 17 00:00:00 2001 From: Johannes Sixt Date: Tue, 2 Oct 2007 16:16:54 +0200 Subject: gitk: Do not pick up file names of "copy from" lines A file copy would be detected only if the original file was modified in the same commit. This implies that there will be a patch listed under the original file name, and we would expect that clicking the original file name in the file list warps the patch window to that file's patch. (If the original file was not modified, the copy would not be detected in the first place, the copied file would be listed as "new file", and this whole matter would not apply.) However, if the name of the copy is sorted after the original file's patch, then the logic introduced by commit d1cb298b0b (which picks up the link information from the "copy from" line) would overwrite the link information that is already present for the original file name, which was parsed earlier. Hence, this patch reverts part of said commit. Signed-off-by: Johannes Sixt Signed-off-by: Shawn O. Pearce --- gitk | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/gitk b/gitk index 46673e3b9c..516e14a8fc 100755 --- a/gitk +++ b/gitk @@ -5221,8 +5221,7 @@ proc getblobdiffline {bdf ids} { set diffinhdr 0 } elseif {$diffinhdr} { - if {![string compare -length 12 "rename from " $line] || - ![string compare -length 10 "copy from " $line]} { + if {![string compare -length 12 "rename from " $line]} { set fname [string range $line [expr 6 + [string first " from " $line] ] end] if {[string index $fname 0] eq "\""} { set fname [lindex $fname 0] -- cgit v1.2.1 From 5d7589d4c43e941563dfa2d096e6d6c184191702 Mon Sep 17 00:00:00 2001 From: Paul Mackerras Date: Sat, 20 Oct 2007 21:21:03 +1000 Subject: gitk: Check that we are running on at least Tcl/Tk 8.4 This checks that we have Tcl/Tk 8.4 or later, and puts up an error message in a window and quits if not. This was prompted by a patch submitted by Steffen Prohaska, but is done a bit differently (this uses package require rather than looking at [info tclversion], and uses show_error to display the error rather than printing it to stderr). Signed-off-by: Paul Mackerras --- gitk | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/gitk b/gitk index 516e14a8fc..06172a434b 100755 --- a/gitk +++ b/gitk @@ -7838,6 +7838,13 @@ proc tcl_encoding {enc} { return {} } +# First check that Tcl/Tk is recent enough +if {[catch {package require Tk 8.4} err]} { + show_error {} . "Sorry, gitk cannot run with this version of Tcl/Tk.\n\ + Gitk requires at least Tcl/Tk 8.4." + exit 1 +} + # defaults... set datemode 0 set diffopts "-U 5 -p" -- cgit v1.2.1 From 3ebba3c724f77d149061c62f4414166649c2e56e Mon Sep 17 00:00:00 2001 From: Paul Mackerras Date: Sat, 20 Oct 2007 22:10:52 +1000 Subject: gitk: Avoid an error when cherry-picking if HEAD has moved on MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This fixes an error reported by Adam Piątyszek: if the current HEAD is not in the graph that gitk knows about when we do a cherry-pick using gitk, then gitk hits an error when trying to update its internal representation of the topology. This avoids the error by not doing that update if the HEAD before the cherry-pick was a commit that gitk doesn't know about. Signed-off-by: Paul Mackerras --- gitk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gitk b/gitk index 06172a434b..f910cba8bf 100755 --- a/gitk +++ b/gitk @@ -6648,7 +6648,7 @@ proc addnewchild {id p} { global arcnos arcids arctags arcout arcend arcstart archeads growing global seeds allcommits - if {![info exists allcommits]} return + if {![info exists allcommits] || ![info exists arcnos($p)]} return lappend allids $id set allparents($id) [list $p] set allchildren($id) {} -- cgit v1.2.1 From e5ef6f952a13342065d44bab53999e8d8529cc3b Mon Sep 17 00:00:00 2001 From: Paul Mackerras Date: Sun, 21 Oct 2007 12:58:42 +1000 Subject: gitk: Fix "can't unset prevlines(...)" Tcl error This fixes the error reported by Michele Ballabio, where gitk will throw a Tcl error "can't unset prevlines(...)" when displaying a commit that has a parent commit listed more than once, and the commit is the first child of that parent. The problem was basically that we had two variables, prevlines and lineends, and were relying on the invariant that prevlines($id) was set iff $id was in the lineends($r) list for some $r. But having a duplicate parent breaks that invariant since we end up with the parent listed twice in lineends. This fixes it by simplifying the logic to use only a single variable, lineend. It also rearranges things a little so that we don't try to draw the line for the duplicated parent twice. Signed-off-by: Paul Mackerras --- gitk | 21 +++++---------------- 1 file changed, 5 insertions(+), 16 deletions(-) diff --git a/gitk b/gitk index f910cba8bf..41a1c69e19 100755 --- a/gitk +++ b/gitk @@ -3695,34 +3695,23 @@ proc drawcommits {row {endrow {}}} { drawcmitrow $r if {$r == $er} break set nextid [lindex $displayorder [expr {$r + 1}]] - if {$wasdrawn && [info exists iddrawn($nextid)]} { - catch {unset prevlines} - continue - } + if {$wasdrawn && [info exists iddrawn($nextid)]} continue drawparentlinks $id $r - if {[info exists lineends($r)]} { - foreach lid $lineends($r) { - unset prevlines($lid) - } - } set rowids [lindex $rowidlist $r] foreach lid $rowids { if {$lid eq {}} continue + if {[info exists lineend($lid)] && $lineend($lid) > $r} continue if {$lid eq $id} { # see if this is the first child of any of its parents foreach p [lindex $parentlist $r] { if {[lsearch -exact $rowids $p] < 0} { # make this line extend up to the child - set le [drawlineseg $p $r $er 0] - lappend lineends($le) $p - set prevlines($p) 1 + set lineend($p) [drawlineseg $p $r $er 0] } } - } elseif {![info exists prevlines($lid)]} { - set le [drawlineseg $lid $r $er 1] - lappend lineends($le) $lid - set prevlines($lid) 1 + } else { + set lineend($lid) [drawlineseg $lid $r $er 1] } } } -- cgit v1.2.1