git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: What's in git.git

From
Junio C Hamano <junkio@cox.net>
Date
Aug 3, 2006, 08:39 UTC
Message-ID
<7vvepaqkki.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<20060803073636.GA12755@prophet.net-ronin.org>
carbonated beverage <ramune@net-ronin.org> writes:
Show 15 quoted lines
> Wheee...
>
> Found it.
>
> diff --git a/gitk b/gitk
> index ba4644f..5ae28ef 100755
> --- a/gitk
> +++ b/gitk
> @@ -770,6 +770,9 @@ proc savestuff {w} {
>  	set wid [expr {([winfo width $ctext] - 8) \
>  			   / [font measure $textfont "0"]}]
>  	puts $f "set geometry(ctextw) $wid"
> +	set geometry(ctexth) [expr {($texth - 8) /
> +			   / [font metrics $textfont -linespace]}]
> +	puts $f "set geometry(ctexth) $wid"
Are you sure about this?
	* $texth is not global, and set geometry(ctexth)
          expression has a syntax error (the slash at the end of
          the line should be backslash for continuation) -- I do
          not see how this could have worked.
	* you are setting geometry(ctexth) but trying to write
          out $wid (which is geometry(ctextw) for the next
          round).
	* but because of the first problem, I suspect the entire
          catch {} clause would have silently failed, perhaps
          leaving the old ~/.gitk around, or more likely not
          creating ~/.gitk at all, which essentially is
          "removing ~/.gitk every time you run it" ;-).

Did your ~/.gitk change after exiting your gitk session? I somehow doubt it.

The following _might_ have a better chance of success...
---
diff --git a/gitk b/gitk
index ba4644f..b06e022 100755
--- a/gitk
+++ b/gitk
@@ -761,17 +761,25 @@ proc savestuff {w} {
 	puts $f [list set cmitmode $cmitmode]
 	puts $f [list set wrapcomment $wrapcomment]
 	puts $f [list set showneartags $showneartags]
+
+	set g_height [winfo height .ctop]
+	set g_canvh [expr {[winfo height $canv]-2}]
+
 	puts $f "set geometry(width) [winfo width .ctop]"
-	puts $f "set geometry(height) [winfo height .ctop]"
+	puts $f "set geometry(height) $g_height"
 	puts $f "set geometry(canv1) [expr {[winfo width $canv]-2}]"
 	puts $f "set geometry(canv2) [expr {[winfo width $canv2]-2}]"
 	puts $f "set geometry(canv3) [expr {[winfo width $canv3]-2}]"
-	puts $f "set geometry(canvh) [expr {[winfo height $canv]-2}]"
+	puts $f "set geometry(canvh) $g_canvh"
 	set wid [expr {([winfo width $ctext] - 8) \
 			   / [font measure $textfont "0"]}]
 	puts $f "set geometry(ctextw) $wid"
 	set wid [expr {([winfo width $cflist] - 11) \
 			   / [font measure [$cflist cget -font] "0"]}]
+	set texth [expr {$g_height - $g_canvh - 56}]
+	set g_ctexth [expr {($texth - 8) \
+			   / [font metrics $textfont -linespace]}]
+	puts $f "set geometry(ctexth) $g_ctexth"
 	puts $f "set geometry(cflistw) $wid"
 	puts -nonewline $f "set permviews {"
 	for {set v 0} {$v < $nextviewnum} {incr v} {
Previous: carbonated beverageNext: carbonated beverage
Message 17 of 20 in “What's in git.git”
  1. Junio C HamanoAug 1, 2006
  2. Johannes SchindelinAug 2, 2006
  3. Junio C HamanoAug 2, 2006
  4. Alex RiesenAug 2, 2006
  5. Junio C HamanoAug 3, 2006
  6. Alex RiesenAug 3, 2006
  7. Junio C HamanoAug 3, 2006
  8. Alex RiesenAug 3, 2006
  9. Alex RiesenAug 3, 2006
  10. carbonated beverageAug 2, 2006
  11. Junio C HamanoAug 3, 2006
  12. A Large Angry SCMAug 3, 2006
  13. carbonated beverageAug 3, 2006
  14. carbonated beverageAug 3, 2006
  15. carbonated beverageAug 3, 2006
  16. carbonated beverageAug 3, 2006
  17. Junio C HamanoAug 3, 2006
  18. carbonated beverageAug 3, 2006
  19. carbonated beverageAug 3, 2006
  20. Jakub NarebskiAug 3, 2006

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.