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

5 messages from 2006-03-30 to 2006-03-30. Participants: Mark Wooding, Junio C Hamano, Christopher Faylor, Johannes Schindelin.
Thread: https://gitlist.dev/t/3756

## Mark Wooding, 2006-03-30 12:31

Subject: [PATCH] gitk: Use git wrapper to run git-ls-remote.
Message-ID: <20060330123151.25779.73775.stgit@metalzone.distorted.org.uk>
URL: https://gitlist.dev/e/20060330123151.25779.73775.stgit%40metalzone.distorted.org.uk

```
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(-)

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, 2006-03-30 18:08

Subject: Re: [PATCH] gitk: Use git wrapper to run git-ls-remote.
Message-ID: <7v8xqr3iwt.fsf@assigned-by-dhcp.cox.net>
URL: https://gitlist.dev/e/7v8xqr3iwt.fsf%40assigned-by-dhcp.cox.net
In-Reply-To: <20060330123151.25779.73775.stgit@metalzone.distorted.org.uk>

```
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, 2006-03-30 18:26

Subject: Re: [PATCH] gitk: Use git wrapper to run git-ls-remote.
Message-ID: <slrne2o8lr.l0.mdw@metalzone.distorted.org.uk>
URL: https://gitlist.dev/e/slrne2o8lr.l0.mdw%40metalzone.distorted.org.uk
In-Reply-To: <7v8xqr3iwt.fsf@assigned-by-dhcp.cox.net>

```
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]

```

## Christopher Faylor, 2006-03-30 20:13

Subject: Re: [PATCH] gitk: Use git wrapper to run git-ls-remote.
Message-ID: <20060330201343.GH28682@trixie.casa.cgf.cx>
URL: https://gitlist.dev/e/20060330201343.GH28682%40trixie.casa.cgf.cx
In-Reply-To: <7v8xqr3iwt.fsf@assigned-by-dhcp.cox.net>

```
On Thu, Mar 30, 2006 at 10:08:02AM -0800, Junio C Hamano wrote:
>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

```

## Johannes Schindelin, 2006-03-30 23:20

Subject: Re: [PATCH] gitk: Use git wrapper to run git-ls-remote.
Message-ID: <Pine.LNX.4.63.0603310115480.2585@wbgn013.biozentrum.uni-wuerzburg.de>
URL: https://gitlist.dev/e/Pine.LNX.4.63.0603310115480.2585%40wbgn013.biozentrum.uni-wuerzburg.de
In-Reply-To: <slrne2o8lr.l0.mdw@metalzone.distorted.org.uk>

```
Hi,

On Thu, 30 Mar 2006, Mark Wooding wrote:

> 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(-)

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) \

```
