threads / patch / 3756

patchgitk: Use git wrapper to run git-ls-remote.

Subject: [PATCH] gitk: Use git wrapper to run git-ls-remote.

## tl;dr

5 messages between Mar 30, 2006 and Mar 30, 2006. Diffs are folded; open one to read it.

replies: 4people: 4as markdown or json

Mark Wooding· Mar 30, 2006, 12:31 UTC · lore
From: Mark Wooding <mdw@distorted.org.uk>

For some reason, the Cygwin Tcl's `exec' command has trouble running scripts. Fix this by using the C `git' wrapper. Other GIT programs run by gitk are written in C already, so we don't need to incur a performance hit of going via the wrapper (which I'll bet isn't pretty under Cygwin).

Signed-off-by: Mark Wooding <mdw@distorted.org.uk>
---
 gitk |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
Show changes to gitk +1 −1
diff --git a/gitk b/gitk
index f4c6624..ac85d1c 100755
--- a/gitk
+++ b/gitk
@@ -359,7 +359,7 @@ proc readrefs {} {
     foreach v {tagids idtags headids idheads otherrefids idotherrefs} {
 	catch {unset $v}
     }
-    set refd [open [list | git-ls-remote [gitdir]] r]
+    set refd [open [list | git ls-remote [gitdir]] r]
     while {0 <= [set n [gets $refd line]]} {
 	if {![regexp {^([0-9a-f]{40})	refs/([^^]*)$} $line \
 	    match id path]} {
Junio C Hamano· Mar 30, 2006, 18:08 UTC · re: Mark Wooding · lore

Re: [PATCH] gitk: Use git wrapper to run git-ls-remote.

Mark Wooding <mdw@distorted.org.uk> writes:
> From: Mark Wooding <mdw@distorted.org.uk>
>
> For some reason, the Cygwin Tcl's `exec' command has trouble running
> scripts...

Yup, I've seen this and have a "personal edition" workaround exactly like yours. I haven't bothered to put it in even "pu", because I am reluctant to add an workaround to a problem I do not understand (and I haven't bothered to try understanding the problem which happens only on Windows ;-).

Does anybody know what is going on?
Mark Wooding· Mar 30, 2006, 18:26 UTC · re: Junio C Hamano · lore

Re: [PATCH] gitk: Use git wrapper to run git-ls-remote.

Junio C Hamano <junkio@cox.net> wrote:
> Does anybody know what is going on?

I'll try staring at the Tcl source code some time. I'm rather too busy tonight, though.

There's also some very strange geometry management oddness going on in gitk. I'll try to sort that out too.

-- [mdw]
Johannes Schindelin· Mar 30, 2006, 23:20 UTC · re: Mark Wooding · lore

Re: [PATCH] gitk: Use git wrapper to run git-ls-remote.

Hi,
On Thu, 30 Mar 2006, Mark Wooding wrote:
Show 9 quoted lines
> Junio C Hamano <junkio@cox.net> wrote:
> 
> > Does anybody know what is going on?
> 
> I'll try staring at the Tcl source code some time.  I'm rather too busy
> tonight, though.
> 
> There's also some very strange geometry management oddness going on in
> gitk.  I'll try to sort that out too.

That has been discussed. My feeling is that this is a bug of Tk with regard to rootless X servers. I never came around to do a proper patch, but I have explicit -height and -width arguments to all frames and panedwindows.

If you want to start working on it, I attached my current patch, which is good enough for me, but note that it changes the geometry subtly everytime gitk is called...

Hth, Dscho

[PATCH] gitk: make geometry less weird on cygwin and macosx
Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
---
 gitk |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)
Show changes to gitk +5 −4
diff --git a/gitk b/gitk
index 03cd475..7339069 100755
--- a/gitk
+++ b/gitk
@@ -373,13 +373,13 @@ proc makewindow {rargs} {
 	set geometry(ctexth) [expr {($texth - 8) /
 				    [font metrics $textfont -linespace]}]
     }
-    frame .ctop.top
+    frame .ctop.top -height $geometry(canvh)
     frame .ctop.top.bar
     pack .ctop.top.bar -side bottom -fill x
     set cscroll .ctop.top.csb
     scrollbar $cscroll -command {allcanvs yview} -highlightthickness 0
     pack $cscroll -side right -fill y
-    panedwindow .ctop.top.clist -orient horizontal -sashpad 0 -handlesize 4
+    panedwindow .ctop.top.clist -orient horizontal -sashpad 0 -handlesize 4 -height $geometry(canvh)
     pack .ctop.top.clist -side top -fill both -expand 1
     .ctop add .ctop.top
     set canv .ctop.top.clist.canv
@@ -449,9 +449,10 @@ proc makewindow {rargs} {
     # for making sure type==Exact whenever loc==Pickaxe
     trace add variable findloc write findlocchange
 
-    panedwindow .ctop.cdet -orient horizontal
+    panedwindow .ctop.cdet -orient horizontal \
+	-height [expr $geometry(ctexth)*$linespc+4]
     .ctop add .ctop.cdet
-    frame .ctop.cdet.left
+    frame .ctop.cdet.left -width [expr $geometry(ctextw)*[font measure $textfont "0"]+8]
     set ctext .ctop.cdet.left.ctext
     text $ctext -bg white -state disabled -font $textfont \
 	-width $geometry(ctextw) -height $geometry(ctexth) \
Christopher Faylor· Mar 30, 2006, 20:13 UTC · re: Junio C Hamano · lore

Re: [PATCH] gitk: Use git wrapper to run git-ls-remote.

On Thu, Mar 30, 2006 at 10:08:02AM -0800, Junio C Hamano wrote:
Show 14 quoted lines
>Mark Wooding <mdw@distorted.org.uk> writes:
>
>> From: Mark Wooding <mdw@distorted.org.uk>
>>
>> For some reason, the Cygwin Tcl's `exec' command has trouble running
>> scripts...
>
>Yup, I've seen this and have a "personal edition" workaround
>exactly like yours.  I haven't bothered to put it in even "pu",
>because I am reluctant to add an workaround to a problem I do
>not understand (and I haven't bothered to try understanding the
>problem which happens only on Windows ;-).
>
>Does anybody know what is going on?

Currently, Cygwin's tcl is a pure windows version which uses CreateProcess to run stuff. It doesn't know about scripts and possibly doesn't even know about cygwin paths.

cgf

← back to recent threads