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

[PATCH 1/4] gitweb: Whitespace cleanup - tabs are for indent, spaces are for align (2)

From
Jakub Narebski <jnareb@gmail.com>
Date
Oct 21, 2006, 15:52 UTC
Message-ID
<200610211752.19891.jnareb@gmail.com>
In-Reply-To
<200610211750.49188.jnareb@gmail.com>

Code should be aligned the same way, regardless of tab size. Use tabs for indent, but spaces for align.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
---
 gitweb/gitweb.perl |   60 ++++++++++++++++++++++++++--------------------------
 1 files changed, 30 insertions(+), 30 deletions(-)
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index 035e85e..c457884 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -1722,13 +1722,13 @@ sub git_print_tree_entry {
 	if ($t->{'type'} eq "blob") {
 		print "<td class=\"list\">" .
 			$cgi->a({-href => href(action=>"blob", hash=>$t->{'hash'},
-					       file_name=>"$basedir$t->{'name'}", %base_key),
-				 -class => "list"}, esc_html($t->{'name'})) . "</td>\n";
+			                       file_name=>"$basedir$t->{'name'}", %base_key),
+			        -class => "list"}, esc_html($t->{'name'})) . "</td>\n";
 		print "<td class=\"link\">";
 		if ($have_blame) {
 			print $cgi->a({-href => href(action=>"blame", hash=>$t->{'hash'},
-						     file_name=>"$basedir$t->{'name'}", %base_key)},
-				      "blame");
+				                           file_name=>"$basedir$t->{'name'}", %base_key)},
+				            "blame");
 		}
 		if (defined $hash_base) {
 			if ($have_blame) {
@@ -1740,8 +1740,8 @@ sub git_print_tree_entry {
 		}
 		print " | " .
 			$cgi->a({-href => href(action=>"blob_plain", hash_base=>$hash_base,
-					       file_name=>"$basedir$t->{'name'}")},
-				"raw");
+			                       file_name=>"$basedir$t->{'name'}")},
+			        "raw");
 		print "</td>\n";
 
 	} elsif ($t->{'type'} eq "tree") {
@@ -1809,7 +1809,7 @@ sub git_difftree_body {
 			print "<td>";
 			print $cgi->a({-href => href(action=>"blob", hash=>$diff{'to_id'},
 			                             hash_base=>$hash, file_name=>$diff{'file'}),
-				       -class => "list"}, esc_html($diff{'file'}));
+			              -class => "list"}, esc_html($diff{'file'}));
 			print "</td>\n";
 			print "<td>$mode_chng</td>\n";
 			print "<td class=\"link\">";
@@ -1836,11 +1836,11 @@ sub git_difftree_body {
 				print " | ";
 			}
 			print $cgi->a({-href => href(action=>"blame", hash_base=>$parent,
-						     file_name=>$diff{'file'})},
-				      "blame") . " | ";
+			                             file_name=>$diff{'file'})},
+			              "blame") . " | ";
 			print $cgi->a({-href => href(action=>"history", hash_base=>$parent,
-						     file_name=>$diff{'file'})},
-				      "history");
+			                             file_name=>$diff{'file'})},
+			              "history");
 			print "</td>\n";
 
 		} elsif ($diff{'status'} eq "M" || $diff{'status'} eq "T") { # modified, or type changed
@@ -1861,8 +1861,8 @@ sub git_difftree_body {
 			}
 			print "<td>";
 			print $cgi->a({-href => href(action=>"blob", hash=>$diff{'to_id'},
-						     hash_base=>$hash, file_name=>$diff{'file'}),
-				       -class => "list"}, esc_html($diff{'file'}));
+			                             hash_base=>$hash, file_name=>$diff{'file'}),
+			              -class => "list"}, esc_html($diff{'file'}));
 			print "</td>\n";
 			print "<td>$mode_chnge</td>\n";
 			print "<td class=\"link\">";
@@ -1873,19 +1873,19 @@ sub git_difftree_body {
 					print $cgi->a({-href => "#patch$patchno"}, "patch");
 				} else {
 					print $cgi->a({-href => href(action=>"blobdiff",
-								     hash=>$diff{'to_id'}, hash_parent=>$diff{'from_id'},
-								     hash_base=>$hash, hash_parent_base=>$parent,
-								     file_name=>$diff{'file'})},
-						      "diff");
+					                             hash=>$diff{'to_id'}, hash_parent=>$diff{'from_id'},
+					                             hash_base=>$hash, hash_parent_base=>$parent,
+					                             file_name=>$diff{'file'})},
+					              "diff");
 				}
 				print " | ";
 			}
 			print $cgi->a({-href => href(action=>"blame", hash_base=>$hash,
-						     file_name=>$diff{'file'})},
-				      "blame") . " | ";
+			                             file_name=>$diff{'file'})},
+			              "blame") . " | ";
 			print $cgi->a({-href => href(action=>"history", hash_base=>$hash,
-						     file_name=>$diff{'file'})},
-				      "history");
+			                             file_name=>$diff{'file'})},
+			              "history");
 			print "</td>\n";
 
 		} elsif ($diff{'status'} eq "R" || $diff{'status'} eq "C") { # renamed or copied
@@ -1913,19 +1913,19 @@ sub git_difftree_body {
 					print $cgi->a({-href => "#patch$patchno"}, "patch");
 				} else {
 					print $cgi->a({-href => href(action=>"blobdiff",
-								     hash=>$diff{'to_id'}, hash_parent=>$diff{'from_id'},
-								     hash_base=>$hash, hash_parent_base=>$parent,
-								     file_name=>$diff{'to_file'}, file_parent=>$diff{'from_file'})},
-						      "diff");
+					                             hash=>$diff{'to_id'}, hash_parent=>$diff{'from_id'},
+					                             hash_base=>$hash, hash_parent_base=>$parent,
+					                             file_name=>$diff{'to_file'}, file_parent=>$diff{'from_file'})},
+					              "diff");
 				}
 				print " | ";
 			}
 			print $cgi->a({-href => href(action=>"blame", hash_base=>$parent,
-						     file_name=>$diff{'from_file'})},
-				      "blame") . " | ";
+			                             file_name=>$diff{'from_file'})},
+			              "blame") . " | ";
 			print $cgi->a({-href => href(action=>"history", hash_base=>$parent,
-						     file_name=>$diff{'from_file'})},
-				      "history");
+			                            file_name=>$diff{'from_file'})},
+			              "history");
 			print "</td>\n";
 
 		} # we should not encounter Unmerged (U) or Unknown (X) status
@@ -2851,7 +2851,7 @@ sub git_tree {
 			# FIXME: Should be available when we have no hash base as well.
 			push @views_nav,
 				$cgi->a({-href => href(action=>"snapshot", hash=>$hash)},
-					"snapshot");
+				        "snapshot");
 		}
 		git_print_page_nav('tree','', $hash_base, undef, undef, join(' | ', @views_nav));
 		git_print_header_div('commit', esc_html($co{'title'}) . $ref, $hash_base);
-- 
1.4.2.1
Previous: Jakub NarebskiNext: Junio C Hamano
Message 2 of 11 in “gitweb: Improving tree view (plus some cleanups)”
  1. 0/4 gitweb: Improving tree view (plus some cleanups)Jakub Narebski, Oct 21, 2006
  2. 1/4 gitweb: Whitespace cleanup - tabs are for indent, spaces are for align (2)Jakub Narebski, Oct 21, 2006
  3. Junio C HamanoOct 22, 2006
  4. Jakub NarebskiOct 22, 2006
  5. Linus TorvaldsOct 22, 2006
  6. Jakub NarebskiOct 22, 2006
  7. Junio C HamanoOct 22, 2006
  8. Luben TuikovOct 22, 2006
  9. 2/4 gitweb: Do not esc_html $basedir argument to git_print_tree_entryJakub Narebski, Oct 21, 2006
  10. 3/4 gitweb: Improve git_print_page_pathJakub Narebski, Oct 21, 2006
  11. 4/4 gitweb: Add '..' (up directory) to tree view if applicableJakub Narebski, Oct 21, 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.