Skip to contentSkip to conversation

gitk lower pane (commit and files view) scrollbar extends past gitk window

PATCH In review Jakub Narebski 5 participants 14 messages Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

In gitk from the current 'next' branch, post git version 1.4.0 (blob ba4644f) scrollbar for lower pane, i.e. for commitdiff and files (Comments) views extends past the bottom of the gitk window. Therefore I cannnot see lower part of commit diff if it is larger than window height.

gitk window has height lower than 700.

The upper pane, i.e. history graph scrollbar is correct, and works as it should.

This is regression from git 1.3.0, where gitk works correctly.

Below ascii art trying to describe situation.

  _                                _                                  _
  ^  .. upper scrollbar arrow .... ^                                  ^
  #                                #                                  |
  #  .... position indicator ..... #                                  |
  |                                |                                  |
  |                                |    scrolling past window edge -> #
  |      bottom of gitk window --> =                                  =
  v                                  <-- no lower scrollbar arrow
  =  <-- bottom of gitk window
Signature · 3 lines
Jakub Narebski
Warsaw, Poland
ShadeHawk on #git
#1 lore raw
Quoted 5 lines · Jakub Narebski

In gitk from the current 'next' branch, post git version 1.4.0 (blob ba4644f) scrollbar for lower pane, i.e. for commitdiff and files (Comments) views extends past the bottom of the gitk window. Therefore I cannnot see lower part of commit diff if it is larger than window height.

Yes, and the search field at the bottom is invisible too. Removing line 431:

.ctop conf -width $geometry(width) -height $geometry(height)

seems to fix it and the window still gets the right size.

Ciao, ET.

#2 lore raw

PATCH 1/1 gitweb: whitespace cleanup around '='

---

 gitweb/gitweb.cgi |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

82c8812870e9c40fd495e9c3e2eae0eb78ac2759

gitweb/gitweb.cgi +4 -4
index e044c61..adc4a42 100755
@@ -326,7 +326,7 @@ EOF
 		} elsif (defined $hash) {
 			$search_hash = $hash;
 		} else {
-			$search_hash  = "HEAD";
+			$search_hash = "HEAD";
 		}
 		$cgi->param("a", "search");
 		$cgi->param("h", $search_hash);
@@ -1766,8 +1766,8 @@ sub git_opml {
 		}
 
 		my $path = esc_html(chop_str($proj{'path'}, 25, 5));
-		my $rss =  "$my_url?p=$proj{'path'};a=rss";
-		my $html =  "$my_url?p=$proj{'path'};a=summary";
+		my $rss  = "$my_url?p=$proj{'path'};a=rss";
+		my $html = "$my_url?p=$proj{'path'};a=summary";
 		print "<outline type=\"rss\" text=\"$path\" title=\"$path\" xmlUrl=\"$rss\" htmlUrl=\"$html\"/>\n";
 	}
 	print "</outline>\n".
@@ -1942,7 +1942,7 @@ sub git_commit {
 	      "<td class=\"link\">" . $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=tree;h=$co{'tree'};hb=$hash")}, "tree") .
 	      "</td>" .
 	      "</tr>\n";
-	my $parents  = $co{'parents'};
+	my $parents = $co{'parents'};
 	foreach my $par (@$parents) {
 		print "<tr>" .
 		      "<td>parent</td>" .
Signature · 1 line
1.3.0
#3 lore raw

Re: [PATCH] gitweb: whitespace cleanup around '='

Review EOF · line 332

Quoted 9 lines · Jakub Narebski
(quoted diff) +1 -1
@@ -326,7 +326,7 @@ EOF
 		} elsif (defined $hash) {
 			$search_hash = $hash;
 		} else {
-			$search_hash  = "HEAD";
+			$search_hash = "HEAD";
 		}
 		$cgi->param("a", "search");
 		$cgi->param("h", $search_hash);

My copy from "next" has this part like the following:

		if (!defined $searchtext) {
			$searchtext = "";
		}
		my $search_hash;
		if (defined $hash) {
			$search_hash = $hash;
		} else {
			$search_hash  = "HEAD";
		}

I thought we were both reasonably sure that we are now in sync... I could apply it by hand but once I start doing that I'm afraid we will never converge.

It's quite frustrating.

Review sub git_opml { · line 1773

Quoted 11 lines
(quoted diff) +2 -2
@@ -1766,8 +1766,8 @@ sub git_opml {
 		}
 
 		my $path = esc_html(chop_str($proj{'path'}, 25, 5));
-		my $rss =  "$my_url?p=$proj{'path'};a=rss";
-		my $html =  "$my_url?p=$proj{'path'};a=summary";
+		my $rss  = "$my_url?p=$proj{'path'};a=rss";
+		my $html = "$my_url?p=$proj{'path'};a=summary";
 		print "<outline type=\"rss\" text=\"$path\" title=\"$path\" xmlUrl=\"$rss\" htmlUrl=\"$html\"/>\n";
 	}
 	print "</outline>\n".

Are you sure you want to do "my $rss two-spaces equal space"?

I've fixed up the whitespace you missed and will be applying the following on top of what is in "next" tonight.

-- >8 --
gitweb: do not align assignment = with extra whitespaces

---

gitweb/gitweb.cgi +16 -16
index f2e5046..e2ed6db 100755
@@ -55,7 +55,7 @@ my $projects_list = "index/index.aux";
 
 # default blob_plain mimetype and default charset for text/plain blob
 my $default_blob_plain_mimetype = 'text/plain';
-my $default_text_plain_charset  = undef;
+my $default_text_plain_charset = undef;
 
 # file to use for guessing MIME types before trying /etc/mime.types
 # (relative to the current git repository)
@@ -325,7 +325,7 @@ EOF
 		if (defined $hash) {
 			$search_hash = $hash;
 		} else {
-			$search_hash  = "HEAD";
+			$search_hash = "HEAD";
 		}
 		$cgi->param("a", "search");
 		$cgi->param("h", $search_hash);
@@ -1283,21 +1283,21 @@ HTML
 
 		if ($line =~ m/^([0-9a-fA-F]{40})\t\(\s*([^\t]+)\t(\d+) \+\d\d\d\d\t(\d+)\)(.*)$/) {
 			$long_rev = $1;
-			$author   = $2;
-			$time     = $3;
-			$lineno   = $4;
-			$data     = $5;
+			$author = $2;
+			$time = $3;
+			$lineno = $4;
+			$data = $5;
 		} else {
 			print qq(  <tr><td colspan="5" class="error">Unable to parse: $line</td></tr>\n);
 			next;
 		}
-		$short_rev  = substr ($long_rev, 0, 8);
-		$age        = time () - $time;
-		$age_str    = age_string ($age);
-		$age_str    =~ s/ /&nbsp;/g;
-		$age_class  = age_class($age);
-		$author     = esc_html ($author);
-		$author     =~ s/ /&nbsp;/g;
+		$short_rev = substr ($long_rev, 0, 8);
+		$age = time () - $time;
+		$age_str = age_string ($age);
+		$age_str =~ s/ /&nbsp;/g;
+		$age_class = age_class($age);
+		$author = esc_html ($author);
+		$author =~ s/ /&nbsp;/g;
 		# escape tabs
 		while ((my $pos = index($data, "\t")) != -1) {
 			if (my $count = (8 - ($pos % 8))) {
@@ -1765,8 +1765,8 @@ sub git_opml {
 		}
 
 		my $path = esc_html(chop_str($proj{'path'}, 25, 5));
-		my $rss =  "$my_url?p=$proj{'path'};a=rss";
-		my $html =  "$my_url?p=$proj{'path'};a=summary";
+		my $rss = "$my_url?p=$proj{'path'};a=rss";
+		my $html = "$my_url?p=$proj{'path'};a=summary";
 		print "<outline type=\"rss\" text=\"$path\" title=\"$path\" xmlUrl=\"$rss\" htmlUrl=\"$html\"/>\n";
 	}
 	print "</outline>\n".
@@ -1941,7 +1941,7 @@ sub git_commit {
 	      "<td class=\"link\">" . $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=tree;h=$co{'tree'};hb=$hash")}, "tree") .
 	      "</td>" .
 	      "</tr>\n";
-	my $parents  = $co{'parents'};
+	my $parents = $co{'parents'};
 	foreach my $par (@$parents) {
 		print "<tr>" .
 		      "<td>parent</td>" .
#4 lore raw

Re: [PATCH] gitweb: whitespace cleanup around '='

Quoted 24 lines · Junio C Hamano

gitweb/gitweb.cgi EOF · line 332

Quoted 9 lines · Jakub Narebski
gitweb/gitweb.cgi +1 -1
@@ -326,7 +326,7 @@ EOF
             } elsif (defined $hash) {
                     $search_hash = $hash;
             } else {
-                    $search_hash  = "HEAD";
+                    $search_hash = "HEAD";
             }
             $cgi->param("a", "search");
             $cgi->param("h", $search_hash);

My copy from "next" has this part like the following:

              if (!defined $searchtext) {
                      $searchtext = "";
              }
              my $search_hash;
              if (defined $hash) {
                      $search_hash = $hash;
              } else {
                      $search_hash  = "HEAD";
              }
Quoted 5 lines

I thought we were both reasonably sure that we are now in sync... I could apply it by hand but once I start doing that I'm afraid we will never converge.

It's quite frustrating.

I'm very sorry, I forgot that I applied Timo Hirvonen patch

"[PATCH] gitweb: Start search from HEAD"
(<[email protected]>)
http://permalink.gmane.org/gmane.comp.version-control.git/22197>

on top of 'next'.

This patch fixes search quite nicely, reducing significantly number of error messages during search (e.g. starting search from blob or file view).

Any reason not to apply it?

Quoted 6 lines

gitweb/gitweb.cgi sub git_opml { · line 1769

Quoted 5 lines
             my $path = esc_html(chop_str($proj{'path'}, 25, 5));
gitweb/gitweb.cgi +2 -2
-            my $rss =  "$my_url?p=$proj{'path'};a=rss";
-            my $html =  "$my_url?p=$proj{'path'};a=summary";
+            my $rss  = "$my_url?p=$proj{'path'};a=rss";
+            my $html = "$my_url?p=$proj{'path'};a=summary";
Quoted 7 lines

Are you sure you want to do "my $rss two-spaces equal space"?

I've fixed up the whitespace you missed and will be applying the following on top of what is in "next" tonight.

-- >8 --
gitweb: do not align assignment = with extra whitespaces

My idea for coding style is to align assignment = with extra whitespaces, but only where aligned assignments statements are one after another.

The above "my $rss" example was mistyped as " = " instead of " = ", but I think it was meant to be aligned at '='. IMHO aligning at assign makes code more readable.

But that is just my opinion.

Signature · 3 lines
Jakub Narebski
Warsaw, Poland
ShadeHawk on #git
#5 lore raw

Re: [PATCH] gitweb: whitespace cleanup around '='

Quoted 8 lines · Jakub Narebski
Quoted 5 lines · Junio C Hamano

I thought we were both reasonably sure that we are now in sync... I could apply it by hand but once I start doing that I'm afraid we will never converge.

It's quite frustrating.

Quoted 7 lines

I'm very sorry, I forgot that I applied Timo Hirvonen patch

"[PATCH] gitweb: Start search from HEAD"
(<[email protected]>)
http://permalink.gmane.org/gmane.comp.version-control.git/22197>

on top of 'next'.

I remember discussing things with Timo and was putting it on hold since I knew you were also actively futzing on gitweb.

But I think what you have is this one instead:

Message-ID: <[email protected]>

I applied it in jn/gitweb topic and then applied your whitespace fixes on top of the result, after discarding the whitespace cleanup I sent out earlier. So let's make sure we are resync'ed and continue from here. I'll push out the updated "next" soonish.

author Acked-by
#6 lore raw

Re: [PATCH] gitweb: whitespace cleanup around '='

Quoted 2 lines · Junio C Hamano

I remember discussing things with Timo and was putting it on hold since I knew you were also actively futzing on gitweb.

So when I apply someone else patches should I reply to the post with patch I have applied with

to notify of that fact?

Signature · 3 lines
Jakub Narebski
Warsaw, Poland
ShadeHawk on #git
#7 lore raw

Re: [PATCH] gitweb: whitespace cleanup around '='

Quoted 11 lines · Jakub Narebski
Quoted 2 lines · Junio C Hamano

I remember discussing things with Timo and was putting it on hold since I knew you were also actively futzing on gitweb.

So when I apply someone else patches should I reply to the post with patch I have applied with

to notify of that fact?

Acked-by does not mean you've applied it to your tree, and even if it did, it is unfair to expect me to remember that fact when I review your patch later. In this particular case, a note in the patch to say it depends on such and such that _I_ do not seem to have yet would have been more appropriate.

Acked-by would also be helpful when a de-facto owner of the code wants to push acceptance of others' patches, but that is independent from stating what a patch's prerequisites are.

Anyhow, I've reviewed Timo's patch (which made sense to me too), and your whitespace fixes and pushed out the result, which hopefully will be propagating to the mirrors soon. Overall, I would say that the clean-up on gitweb so far is reasonably straightforward. I have been running "next" version of gitweb on my private machine and haven't found regression.

I'll go to bed now. Thanks for the patches.

#8 lore raw

Re: [PATCH] gitweb: whitespace cleanup around '='

In reply to Junio C Hamano
Quoted 10 lines · Junio C Hamano
Quoted 4 lines · Jakub Narebski

I'm very sorry, I forgot that I applied Timo Hirvonen patch

"[PATCH] gitweb: Start search from HEAD"
Message-ID: <[email protected]>

But I think what you have is this one instead:

Message-ID: <[email protected]>

Is the 'note' extension to commit header implemented yet? It it is,then it would be nice if git-am recorded original email message-ids in the note header. Usually it is of no interest to user, so it should be hidden by default.

Signature · 3 lines
Jakub Narebski
Warsaw, Poland
ShadeHawk on #git
#9 lore raw

Re: [PATCH] gitweb: whitespace cleanup around '='

Quoted 9 lines · Jakub Narebski
Quoted 7 lines · Junio C Hamano
Quoted 4 lines · Jakub Narebski

I'm very sorry, I forgot that I applied Timo Hirvonen patch

"[PATCH] gitweb: Start search from HEAD"
Message-ID: <[email protected]>

Quoted 8 lines
Quoted 3 lines

But I think what you have is this one instead:

Message-ID: <[email protected]>

Is the 'note' extension to commit header implemented yet? It it is,then it would be nice if git-am recorded original email message-ids in the note header. Usually it is of no interest to user, so it should be hidden by default.

I put it at the end of the commit message, like the Signed-of-by lines. And, yes, it would be nice if git-am would add it (--message-id flag?). If more people is interested I'll try to send a patch.

Santi

#11 lore raw
In reply to Edgar Toernig
Quoted 7 lines · Edgar Toernig
Quoted 5 lines · Jakub Narebski

In gitk from the current 'next' branch, post git version 1.4.0 (blob ba4644f) scrollbar for lower pane, i.e. for commitdiff and files (Comments) views extends past the bottom of the gitk window. Therefore I cannnot see lower part of commit diff if it is larger than window height.

Quoted 7 lines

Yes, and the search field at the bottom is invisible too. Removing line 431:

.ctop conf -width $geometry(width) -height $geometry(height)

seems to fix it and the window still gets the right size.

No, it does not. It gets the default geometry, not the one it had last time.

#12 lore raw

[WORKAROUND] gitk lower pane scrollbar extends past gitk window

Quoted 12 lines · Alex Riesen
Quoted 11 lines · Edgar Toernig
Quoted 6 lines · Jakub Narebski

In gitk from the current 'next' branch, post git version 1.4.0 (blob ba4644f) scrollbar for lower pane, i.e. for commitdiff and files (Comments) views extends past the bottom of the gitk window. Therefore I cannnot see lower part of commit diff if it is larger than window height.

Yes, and the search field at the bottom is invisible too. Removing line 431:

Quoted 6 lines
Quoted 4 lines

.ctop conf -width $geometry(width) -height $geometry(height)

seems to fix it and the window still gets the right size.

No, it does not. It gets the default geometry, not the one it had last time.

Now I see. It is the case when I used gitk from a computer with a desktop with larger screen height, then on computer with screen height smaller than gitk height was I had mentioned problem.

Workaround for now is to delete old geometry info from ~/.gitk file (or just delete whole file).

I don't know Tcl/Tk to make proper fix, i.e. check if restored size is not larger than available screen size, and use min(saved size, screen size). Another improvement would be to save the fact that gitk window is maximized as a symbol, e.g. as equivalent of

set geometry(height) screen(height)

in ~/.gitk

Signature · 3 lines
Jakub Narebski
Warsaw, Poland
ShadeHawk on #git
#13 lore raw

Re: [WORKAROUND] gitk lower pane scrollbar extends past gitk window

It looks like gitk incorrectly saves the geometry in ~/.gitk I have to remove it before running gitk (well, it would be enough to remove geometry section).

Signature · 3 lines
Jakub Narebski
Warsaw, Poland
ShadeHawk on #git