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

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

From
Junio C Hamano <junkio@cox.net>
Date
Jun 22, 2006, 07:09 UTC
Message-ID
<7vejxhwts4.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<11509591773212-git-send-email-jnareb@gmail.com>
Jakub Narebski <jnareb@gmail.com> writes:
Show 9 quoted lines
> @@ -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.
Show 11 quoted lines
> @@ -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

---
diff --git a/gitweb/gitweb.cgi b/gitweb/gitweb.cgi
index f2e5046..e2ed6db 100755
--- a/gitweb/gitweb.cgi
+++ b/gitweb/gitweb.cgi
@@ -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>" .
Previous: Jakub NarebskiNext: Jakub Narebski
Message 5 of 14 in “gitk lower pane (commit and files view) scrollbar extends past gitk window”
  1. Jakub NarebskiJun 21, 2006
  2. Edgar ToernigJun 22, 2006
  3. gitweb: whitespace cleanup around '='Jakub Narebski, Jun 22, 2006
  4. Jakub NarebskiJun 22, 2006
  5. Junio C HamanoJun 22, 2006
  6. Jakub NarebskiJun 22, 2006
  7. Junio C HamanoJun 22, 2006
  8. Jakub NarebskiJun 22, 2006
  9. Junio C HamanoJun 22, 2006
  10. Jakub NarebskiJun 22, 2006
  11. Santi BéjarJun 22, 2006
  12. Alex RiesenJun 22, 2006
  13. [WORKAROUND] gitk lower pane scrollbar extends past gitk windowJakub Narebski, Jun 22, 2006
  14. Jakub NarebskiJun 22, 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.