* [PATCH 1/3] gitweb: Whitespace cleanup: realign, reindent
From: Jakub Narebski @ 2006-08-22 14:52 UTC (permalink / raw)
To: git
In-Reply-To: <200608221651.19629.jnareb@gmail.com>
This patch tries (but no too hard) to fit gitweb source in 80 columns,
for 2 columns wide tabs, and indent and align source for better
readibility.
While at it added comment to 'snapshot' entry defaults for %feature
hash, corrected "blobl" action in git_blame2 and git_blame to "blob",
key of argument to $cgi->a from 'class' to '-class'.
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
---
Quite a large patch, but it doesn't change much.
gitweb/gitweb.perl | 257 ++++++++++++++++++++++++++++++++++++----------------
1 files changed, 178 insertions(+), 79 deletions(-)
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index 607b8b7..182fe33 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -69,22 +69,30 @@ our $mimetypes_file = undef;
# You define site-wide feature defaults here; override them with
# $GITWEB_CONFIG as necessary.
-our %feature =
-(
-
-# feature => {'sub' => feature-sub, 'override' => allow-override, 'default' => [ default options...]
-
-'blame' => {'sub' => \&feature_blame, 'override' => 0, 'default' => [0]},
-'snapshot' => {'sub' => \&feature_snapshot, 'override' => 0, 'default' => ['x-gzip', 'gz', 'gzip']},
-
+our %feature = (
+ # feature => {'sub' => feature-sub, 'override' => allow-override, 'default' => [ default options...]
+ # if feature is overridable, feature-sub will be called with default options;
+ # return value indicates if to enable specified feature
+
+ 'blame' => {
+ 'sub' => \&feature_blame,
+ 'override' => 0,
+ 'default' => [0]},
+
+ 'snapshot' => {
+ 'sub' => \&feature_snapshot,
+ 'override' => 0,
+ # => [content-encoding, suffix, program]
+ 'default' => ['x-gzip', 'gz', 'gzip']},
);
sub gitweb_check_feature {
my ($name) = @_;
return undef unless exists $feature{$name};
- my ($sub, $override, @defaults) = ($feature{$name}{'sub'},
- $feature{$name}{'override'},
- @{$feature{$name}{'default'}});
+ my ($sub, $override, @defaults) = (
+ $feature{$name}{'sub'},
+ $feature{$name}{'override'},
+ @{$feature{$name}{'default'}});
if (!$override) { return @defaults; }
return $sub->(@defaults);
}
@@ -463,7 +471,9 @@ sub format_log_line_html {
if ($line =~ m/([0-9a-fA-F]{40})/) {
my $hash_text = $1;
if (git_get_type($hash_text) eq "commit") {
- my $link = $cgi->a({-class => "text", -href => href(action=>"commit", hash=>$hash_text)}, $hash_text);
+ my $link =
+ $cgi->a({-href => href(action=>"commit", hash=>$hash_text),
+ -class => "text"}, $hash_text);
$line =~ s/$hash_text/$link/;
}
}
@@ -734,8 +744,10 @@ sub parse_date {
$date{'mday'} = $mday;
$date{'day'} = $days[$wday];
$date{'month'} = $months[$mon];
- $date{'rfc2822'} = sprintf "%s, %d %s %4d %02d:%02d:%02d +0000", $days[$wday], $mday, $months[$mon], 1900+$year, $hour ,$min, $sec;
- $date{'mday-time'} = sprintf "%d %s %02d:%02d", $mday, $months[$mon], $hour ,$min;
+ $date{'rfc2822'} = sprintf "%s, %d %s %4d %02d:%02d:%02d +0000",
+ $days[$wday], $mday, $months[$mon], 1900+$year, $hour ,$min, $sec;
+ $date{'mday-time'} = sprintf "%d %s %02d:%02d",
+ $mday, $months[$mon], $hour ,$min;
$tz =~ m/^([+\-][0-9][0-9])([0-9][0-9])$/;
my $local = $epoch + ((int $1 + ($2/60)) * 3600);
@@ -792,7 +804,8 @@ sub parse_commit {
@commit_lines = @$commit_text;
} else {
$/ = "\0";
- open my $fd, "-|", $GIT, "rev-list", "--header", "--parents", "--max-count=1", $commit_id or return;
+ open my $fd, "-|", $GIT, "rev-list", "--header", "--parents", "--max-count=1", $commit_id
+ or return;
@commit_lines = split '\n', <$fd>;
close $fd or return;
$/ = "\n";
@@ -1086,12 +1099,15 @@ sub git_header_html {
# 'application/xhtml+xml', otherwise send it as plain old 'text/html'.
# we have to do this because MSIE sometimes globs '*/*', pretending to
# support xhtml+xml but choking when it gets what it asked for.
- if (defined $cgi->http('HTTP_ACCEPT') && $cgi->http('HTTP_ACCEPT') =~ m/(,|;|\s|^)application\/xhtml\+xml(,|;|\s|$)/ && $cgi->Accept('application/xhtml+xml') != 0) {
+ if (defined $cgi->http('HTTP_ACCEPT') &&
+ $cgi->http('HTTP_ACCEPT') =~ m/(,|;|\s|^)application\/xhtml\+xml(,|;|\s|$)/ &&
+ $cgi->Accept('application/xhtml+xml') != 0) {
$content_type = 'application/xhtml+xml';
} else {
$content_type = 'text/html';
}
- print $cgi->header(-type=>$content_type, -charset => 'utf-8', -status=> $status, -expires => $expires);
+ print $cgi->header(-type=>$content_type, -charset => 'utf-8',
+ -status=> $status, -expires => $expires);
print <<EOF;
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
@@ -1271,9 +1287,12 @@ sub git_print_page_path {
} elsif (defined $type && $type eq 'blob') {
print "<div class=\"page_path\">";
if (defined $hb) {
- print $cgi->a({-href => href(action=>"blob_plain", hash_base=>$hb, file_name=>$file_name)}, esc_html($name));
+ print $cgi->a({-href => href(action=>"blob_plain", file_name=>$file_name,
+ hash_base=>$hb)},
+ esc_html($name));
} else {
- print $cgi->a({-href => href(action=>"blob_plain", file_name=>$file_name)}, esc_html($name));
+ print $cgi->a({-href => href(action=>"blob_plain", file_name=>$file_name)},
+ esc_html($name));
}
print "<br/></div>\n";
} else {
@@ -1523,7 +1542,8 @@ sub git_shortlog_body {
print "<td title=\"$co{'age_string_age'}\"><i>$co{'age_string_date'}</i></td>\n" .
"<td><i>" . esc_html(chop_str($co{'author_name'}, 10)) . "</i></td>\n" .
"<td>";
- print format_subject_html($co{'title'}, $co{'title_short'}, href(action=>"commit", hash=>$commit), $ref);
+ print format_subject_html($co{'title'}, $co{'title_short'},
+ href(action=>"commit", hash=>$commit), $ref);
print "</td>\n" .
"<td class=\"link\">" .
$cgi->a({-href => href(action=>"commit", hash=>$commit)}, "commit") . " | " .
@@ -1576,7 +1596,8 @@ sub git_history_body {
"<td><i>" . esc_html(chop_str($co{'author_name'}, 15, 3)) . "</i></td>\n" .
"<td>";
# originally git_history used chop_str($co{'title'}, 50)
- print format_subject_html($co{'title'}, $co{'title_short'}, href(action=>"commit", hash=>$commit), $ref);
+ print format_subject_html($co{'title'}, $co{'title_short'},
+ href(action=>"commit", hash=>$commit), $ref);
print "</td>\n" .
"<td class=\"link\">" .
$cgi->a({-href => href(action=>"commit", hash=>$commit)}, "commit") . " | " .
@@ -1589,7 +1610,8 @@ sub git_history_body {
if (defined $blob_current && defined $blob_parent &&
$blob_current ne $blob_parent) {
print " | " .
- $cgi->a({-href => href(action=>"blobdiff", hash=>$blob_current, hash_parent=>$blob_parent, hash_base=>$commit, file_name=>$file_name)},
+ $cgi->a({-href => href(action=>"blobdiff", hash=>$blob_current, hash_parent=>$blob_parent,
+ hash_base=>$commit, file_name=>$file_name)},
"diff to current");
}
}
@@ -1634,7 +1656,8 @@ sub git_tags_body {
"</td>\n" .
"<td>";
if (defined $comment) {
- print format_subject_html($comment, $comment_short, href(action=>"tag", hash=>$tag{'id'}));
+ print format_subject_html($comment, $comment_short,
+ href(action=>"tag", hash=>$tag{'id'}));
}
print "</td>\n" .
"<td class=\"selflink\">";
@@ -1945,13 +1968,17 @@ sub git_tag {
"<table cellspacing=\"0\">\n" .
"<tr>\n" .
"<td>object</td>\n" .
- "<td>" . $cgi->a({-class => "list", -href => href(action=>$tag{'type'}, hash=>$tag{'object'})}, $tag{'object'}) . "</td>\n" .
- "<td class=\"link\">" . $cgi->a({-href => href(action=>$tag{'type'}, hash=>$tag{'object'})}, $tag{'type'}) . "</td>\n" .
+ "<td>" . $cgi->a({-class => "list", -href => href(action=>$tag{'type'}, hash=>$tag{'object'})},
+ $tag{'object'}) . "</td>\n" .
+ "<td class=\"link\">" . $cgi->a({-href => href(action=>$tag{'type'}, hash=>$tag{'object'})},
+ $tag{'type'}) . "</td>\n" .
"</tr>\n";
if (defined($tag{'author'})) {
my %ad = parse_date($tag{'epoch'}, $tag{'tz'});
print "<tr><td>author</td><td>" . esc_html($tag{'author'}) . "</td></tr>\n";
- print "<tr><td></td><td>" . $ad{'rfc2822'} . sprintf(" (%02d:%02d %s)", $ad{'hour_local'}, $ad{'minute_local'}, $ad{'tz_local'}) . "</td></tr>\n";
+ print "<tr><td></td><td>" . $ad{'rfc2822'} .
+ sprintf(" (%02d:%02d %s)", $ad{'hour_local'}, $ad{'minute_local'}, $ad{'tz_local'}) .
+ "</td></tr>\n";
}
print "</table>\n\n" .
"</div>\n";
@@ -1988,8 +2015,11 @@ sub git_blame2 {
or die_error(undef, "Open git-blame failed");
git_header_html();
my $formats_nav =
- $cgi->a({-href => href(action=>"blobl", hash=>$hash, hash_base=>$hash_base, file_name=>$file_name)}, "blob") .
- " | " . $cgi->a({-href => href(action=>"blame", file_name=>$file_name)}, "head");
+ $cgi->a({-href => href(action=>"blob", hash=>$hash, hash_base=>$hash_base, file_name=>$file_name)},
+ "blob") .
+ " | " .
+ $cgi->a({-href => href(action=>"blame", file_name=>$file_name)},
+ "head");
git_print_page_nav('','', $hash_base,$co{'tree'},$hash_base, $formats_nav);
git_print_header_div('commit', esc_html($co{'title'}), $hash_base);
git_print_page_path($file_name, $ftype, $hash_base);
@@ -2015,14 +2045,17 @@ sub git_blame2 {
}
print "<tr class=\"$rev_color[$current_color]\">\n";
print "<td class=\"sha1\">" .
- $cgi->a({-href => href(action=>"commit", hash=>$full_rev, file_name=>$file_name)}, esc_html($rev)) . "</td>\n";
- print "<td class=\"linenr\"><a id=\"l$lineno\" href=\"#l$lineno\" class=\"linenr\">" . esc_html($lineno) . "</a></td>\n";
+ $cgi->a({-href => href(action=>"commit", hash=>$full_rev, file_name=>$file_name)},
+ esc_html($rev)) . "</td>\n";
+ print "<td class=\"linenr\"><a id=\"l$lineno\" href=\"#l$lineno\" class=\"linenr\">" .
+ esc_html($lineno) . "</a></td>\n";
print "<td class=\"pre\">" . esc_html($data) . "</td>\n";
print "</tr>\n";
}
print "</table>\n";
print "</div>";
- close $fd or print "Reading blob failed\n";
+ close $fd
+ or print "Reading blob failed\n";
git_footer_html();
}
@@ -2045,8 +2078,11 @@ sub git_blame {
or die_error(undef, "Open git-annotate failed");
git_header_html();
my $formats_nav =
- $cgi->a({-href => href(action=>"blobl", hash=>$hash, hash_base=>$hash_base, file_name=>$file_name)}, "blob") .
- " | " . $cgi->a({-href => href(action=>"blame", file_name=>$file_name)}, "head");
+ $cgi->a({-href => href(action=>"blob", hash=>$hash, hash_base=>$hash_base, file_name=>$file_name)},
+ "blob") .
+ " | " .
+ $cgi->a({-href => href(action=>"blame", file_name=>$file_name)},
+ "head");
git_print_page_nav('','', $hash_base,$co{'tree'},$hash_base, $formats_nav);
git_print_header_div('commit', esc_html($co{'title'}), $hash_base);
git_print_page_path($file_name, 'blob', $hash_base);
@@ -2110,7 +2146,8 @@ HTML
HTML
} # while (my $line = <$fd>)
print "</table>\n\n";
- close $fd or print "Reading blob failed.\n";
+ close $fd
+ or print "Reading blob failed.\n";
print "</div>";
git_footer_html();
}
@@ -2197,13 +2234,23 @@ sub git_blob {
if (defined $hash_base && (my %co = parse_commit($hash_base))) {
if (defined $file_name) {
if ($have_blame) {
- $formats_nav .= $cgi->a({-href => href(action=>"blame", hash=>$hash, hash_base=>$hash_base, file_name=>$file_name)}, "blame") . " | ";
+ $formats_nav .=
+ $cgi->a({-href => href(action=>"blame", hash_base=>$hash_base,
+ hash=>$hash, file_name=>$file_name)},
+ "blame") .
+ " | ";
}
$formats_nav .=
- $cgi->a({-href => href(action=>"blob_plain", hash=>$hash, file_name=>$file_name)}, "plain") .
- " | " . $cgi->a({-href => href(action=>"blob", hash_base=>"HEAD", file_name=>$file_name)}, "head");
+ $cgi->a({-href => href(action=>"blob_plain",
+ hash=>$hash, file_name=>$file_name)},
+ "plain") .
+ " | " .
+ $cgi->a({-href => href(action=>"blob",
+ hash_base=>"HEAD", file_name=>$file_name)},
+ "head");
} else {
- $formats_nav .= $cgi->a({-href => href(action=>"blob_plain", hash=>$hash)}, "plain");
+ $formats_nav .=
+ $cgi->a({-href => href(action=>"blob_plain", hash=>$hash)}, "plain");
}
git_print_page_nav('','', $hash_base,$co{'tree'},$hash_base, $formats_nav);
git_print_header_div('commit', esc_html($co{'title'}), $hash_base);
@@ -2219,9 +2266,11 @@ sub git_blob {
chomp $line;
$nr++;
$line = untabify($line);
- printf "<div class=\"pre\"><a id=\"l%i\" href=\"#l%i\" class=\"linenr\">%4i</a> %s</div>\n", $nr, $nr, $nr, esc_html($line);
+ printf "<div class=\"pre\"><a id=\"l%i\" href=\"#l%i\" class=\"linenr\">%4i</a> %s</div>\n",
+ $nr, $nr, $nr, esc_html($line);
}
- close $fd or print "Reading blob failed.\n";
+ close $fd
+ or print "Reading blob failed.\n";
print "</div>";
git_footer_html();
}
@@ -2282,23 +2331,37 @@ sub git_tree {
print "<td class=\"mode\">" . mode_str($t_mode) . "</td>\n";
if ($t_type eq "blob") {
print "<td class=\"list\">" .
- $cgi->a({-href => href(action=>"blob", hash=>$t_hash, file_name=>"$base$t_name", %base_key), -class => "list"}, esc_html($t_name)) .
+ $cgi->a({-href => href(action=>"blob", hash=>$t_hash, file_name=>"$base$t_name", %base_key),
+ -class => "list"}, esc_html($t_name)) .
"</td>\n" .
"<td class=\"link\">" .
- $cgi->a({-href => href(action=>"blob", hash=>$t_hash, file_name=>"$base$t_name", %base_key)}, "blob");
+ $cgi->a({-href => href(action=>"blob", hash=>$t_hash, file_name=>"$base$t_name", %base_key)},
+ "blob");
if ($have_blame) {
- print " | " . $cgi->a({-href => href(action=>"blame", hash=>$t_hash, file_name=>"$base$t_name", %base_key)}, "blame");
+ print " | " .
+ $cgi->a({-href => href(action=>"blame", hash=>$t_hash, file_name=>"$base$t_name", %base_key)},
+ "blame");
}
- print " | " . $cgi->a({-href => href(action=>"history", hash=>$t_hash, hash_base=>$hash_base, file_name=>"$base$t_name")}, "history") .
- " | " . $cgi->a({-href => href(action=>"blob_plain", hash=>$t_hash, file_name=>"$base$t_name")}, "raw") .
+ print " | " .
+ $cgi->a({-href => href(action=>"history", hash_base=>$hash_base,
+ hash=>$t_hash, file_name=>"$base$t_name")},
+ "history") .
+ " | " .
+ $cgi->a({-href => href(action=>"blob_plain",
+ hash=>$t_hash, file_name=>"$base$t_name")},
+ "raw") .
"</td>\n";
} elsif ($t_type eq "tree") {
print "<td class=\"list\">" .
- $cgi->a({-href => href(action=>"tree", hash=>$t_hash, file_name=>"$base$t_name", %base_key)}, esc_html($t_name)) .
+ $cgi->a({-href => href(action=>"tree", hash=>$t_hash, file_name=>"$base$t_name", %base_key)},
+ esc_html($t_name)) .
"</td>\n" .
"<td class=\"link\">" .
- $cgi->a({-href => href(action=>"tree", hash=>$t_hash, file_name=>"$base$t_name", %base_key)}, "tree") .
- " | " . $cgi->a({-href => href(action=>"history", hash_base=>$hash_base, file_name=>"$base$t_name")}, "history") .
+ $cgi->a({-href => href(action=>"tree", hash=>$t_hash, file_name=>"$base$t_name", %base_key)},
+ "tree") .
+ " | " .
+ $cgi->a({-href => href(action=>"history", hash_base=>$hash_base, file_name=>"$base$t_name")},
+ "history") .
"</td>\n";
}
print "</tr>\n";
@@ -2323,10 +2386,9 @@ sub git_snapshot {
my $filename = basename($project) . "-$hash.tar.$suffix";
print $cgi->header(-type => 'application/x-tar',
- -content-encoding => $ctype,
- '-content-disposition' =>
- "inline; filename=\"$filename\"",
- -status => '200 OK');
+ -content-encoding => $ctype,
+ '-content-disposition' => "inline; filename=\"$filename\"",
+ -status => '200 OK');
open my $fd, "-|", "$GIT tar-tree $hash \'$project\' | $command" or
die_error(undef, "Execute git-tar-tree failed.");
@@ -2377,7 +2439,8 @@ sub git_log {
print "<div class=\"title_text\">\n" .
"<div class=\"log_link\">\n" .
$cgi->a({-href => href(action=>"commit", hash=>$commit)}, "commit") .
- " | " . $cgi->a({-href => href(action=>"commitdiff", hash=>$commit)}, "commitdiff") .
+ " | " .
+ $cgi->a({-href => href(action=>"commitdiff", hash=>$commit)}, "commitdiff") .
"<br/>\n" .
"</div>\n" .
"<i>" . esc_html($co{'author_name'}) . " [$ad{'rfc2822'}]</i><br/>\n" .
@@ -2421,12 +2484,14 @@ sub git_commit {
my $formats_nav = '';
if (defined $file_name && defined $co{'parent'}) {
my $parent = $co{'parent'};
- $formats_nav .= $cgi->a({-href => href(action=>"blame", hash_parent=>$parent, file_name=>$file_name)}, "blame");
+ $formats_nav .=
+ $cgi->a({-href => href(action=>"blame", hash_parent=>$parent, file_name=>$file_name)},
+ "blame");
}
git_header_html(undef, $expires);
git_print_page_nav('commit', defined $co{'parent'} ? '' : 'commitdiff',
- $hash, $co{'tree'}, $hash,
- $formats_nav);
+ $hash, $co{'tree'}, $hash,
+ $formats_nav);
if (defined $co{'parent'}) {
git_print_header_div('commitdiff', esc_html($co{'title'}) . $ref, $hash);
@@ -2439,23 +2504,31 @@ sub git_commit {
"<tr>" .
"<td></td><td> $ad{'rfc2822'}";
if ($ad{'hour_local'} < 6) {
- printf(" (<span class=\"atnight\">%02d:%02d</span> %s)", $ad{'hour_local'}, $ad{'minute_local'}, $ad{'tz_local'});
+ printf(" (<span class=\"atnight\">%02d:%02d</span> %s)",
+ $ad{'hour_local'}, $ad{'minute_local'}, $ad{'tz_local'});
} else {
- printf(" (%02d:%02d %s)", $ad{'hour_local'}, $ad{'minute_local'}, $ad{'tz_local'});
+ printf(" (%02d:%02d %s)",
+ $ad{'hour_local'}, $ad{'minute_local'}, $ad{'tz_local'});
}
print "</td>" .
"</tr>\n";
print "<tr><td>committer</td><td>" . esc_html($co{'committer'}) . "</td></tr>\n";
- print "<tr><td></td><td> $cd{'rfc2822'}" . sprintf(" (%02d:%02d %s)", $cd{'hour_local'}, $cd{'minute_local'}, $cd{'tz_local'}) . "</td></tr>\n";
+ print "<tr><td></td><td> $cd{'rfc2822'}" .
+ sprintf(" (%02d:%02d %s)", $cd{'hour_local'}, $cd{'minute_local'}, $cd{'tz_local'}) .
+ "</td></tr>\n";
print "<tr><td>commit</td><td class=\"sha1\">$co{'id'}</td></tr>\n";
print "<tr>" .
"<td>tree</td>" .
"<td class=\"sha1\">" .
- $cgi->a({-href => href(action=>"tree", hash=>$co{'tree'}, hash_base=>$hash), class => "list"}, $co{'tree'}) .
+ $cgi->a({-href => href(action=>"tree", hash=>$co{'tree'}, hash_base=>$hash),
+ class => "list"}, $co{'tree'}) .
"</td>" .
- "<td class=\"link\">" . $cgi->a({-href => href(action=>"tree", hash=>$co{'tree'}, hash_base=>$hash)}, "tree");
+ "<td class=\"link\">" .
+ $cgi->a({-href => href(action=>"tree", hash=>$co{'tree'}, hash_base=>$hash)},
+ "tree");
if ($have_snapshot) {
- print " | " . $cgi->a({-href => href(action=>"snapshot", hash=>$hash)}, "snapshot");
+ print " | " .
+ $cgi->a({-href => href(action=>"snapshot", hash=>$hash)}, "snapshot");
}
print "</td>" .
"</tr>\n";
@@ -2463,10 +2536,14 @@ sub git_commit {
foreach my $par (@$parents) {
print "<tr>" .
"<td>parent</td>" .
- "<td class=\"sha1\">" . $cgi->a({-href => href(action=>"commit", hash=>$par), class => "list"}, $par) . "</td>" .
+ "<td class=\"sha1\">" .
+ $cgi->a({-href => href(action=>"commit", hash=>$par),
+ class => "list"}, $par) .
+ "</td>" .
"<td class=\"link\">" .
$cgi->a({-href => href(action=>"commit", hash=>$par)}, "commit") .
- " | " . $cgi->a({-href => href(action=>"commitdiff", hash=>$hash, hash_parent=>$par)}, "commitdiff") .
+ " | " .
+ $cgi->a({-href => href(action=>"commitdiff", hash=>$hash, hash_parent=>$par)}, "commitdiff") .
"</td>" .
"</tr>\n";
}
@@ -2487,7 +2564,9 @@ sub git_blobdiff {
git_header_html();
if (defined $hash_base && (my %co = parse_commit($hash_base))) {
my $formats_nav =
- $cgi->a({-href => href(action=>"blobdiff_plain", hash=>$hash, hash_parent=>$hash_parent)}, "plain");
+ $cgi->a({-href => href(action=>"blobdiff_plain",
+ hash=>$hash, hash_parent=>$hash_parent)},
+ "plain");
git_print_page_nav('','', $hash_base,$co{'tree'},$hash_base, $formats_nav);
git_print_header_div('commit', esc_html($co{'title'}), $hash_base);
} else {
@@ -2498,12 +2577,16 @@ sub git_blobdiff {
git_print_page_path($file_name, "blob", $hash_base);
print "<div class=\"page_body\">\n" .
"<div class=\"diff_info\">blob:" .
- $cgi->a({-href => href(action=>"blob", hash=>$hash_parent, hash_base=>$hash_base, file_name=>($file_parent || $file_name))}, $hash_parent) .
+ $cgi->a({-href => href(action=>"blob", hash=>$hash_parent,
+ hash_base=>$hash_base, file_name=>($file_parent || $file_name))},
+ $hash_parent) .
" -> blob:" .
- $cgi->a({-href => href(action=>"blob", hash=>$hash, hash_base=>$hash_base, file_name=>$file_name)}, $hash) .
+ $cgi->a({-href => href(action=>"blob", hash=>$hash,
+ hash_base=>$hash_base, file_name=>$file_name)},
+ $hash) .
"</div>\n";
git_diff_print($hash_parent, $file_name || $hash_parent, $hash, $file_name || $hash);
- print "</div>";
+ print "</div>"; # page_body
git_footer_html();
}
@@ -2535,7 +2618,8 @@ sub git_commitdiff {
my $refs = git_get_references();
my $ref = format_ref_marker($refs, $co{'id'});
my $formats_nav =
- $cgi->a({-href => href(action=>"commitdiff_plain", hash=>$hash, hash_parent=>$hash_parent)}, "plain");
+ $cgi->a({-href => href(action=>"commitdiff_plain", hash=>$hash, hash_parent=>$hash_parent)},
+ "plain");
git_header_html(undef, $expires);
git_print_page_nav('commitdiff','', $hash,$co{'tree'},$hash, $formats_nav);
git_print_header_div('commit', esc_html($co{'title'}) . $ref, $hash);
@@ -2556,22 +2640,30 @@ sub git_commitdiff {
my $file = validate_input(unquote($6));
if ($status eq "A") {
print "<div class=\"diff_info\">" . file_type($to_mode) . ":" .
- $cgi->a({-href => href(action=>"blob", hash=>$to_id, hash_base=>$hash, file_name=>$file)}, $to_id) . "(new)" .
+ $cgi->a({-href => href(action=>"blob", hash_base=>$hash,
+ hash=>$to_id, file_name=>$file)},
+ $to_id) . "(new)" .
"</div>\n";
git_diff_print(undef, "/dev/null", $to_id, "b/$file");
} elsif ($status eq "D") {
print "<div class=\"diff_info\">" . file_type($from_mode) . ":" .
- $cgi->a({-href => href(action=>"blob", hash=>$from_id, hash_base=>$hash_parent, file_name=>$file)}, $from_id) . "(deleted)" .
+ $cgi->a({-href => href(action=>"blob", hash_base=>$hash_parent,
+ hash=>$from_id, file_name=>$file)},
+ $from_id) . "(deleted)" .
"</div>\n";
git_diff_print($from_id, "a/$file", undef, "/dev/null");
} elsif ($status eq "M") {
if ($from_id ne $to_id) {
print "<div class=\"diff_info\">" .
file_type($from_mode) . ":" .
- $cgi->a({-href => href(action=>"blob", hash=>$from_id, hash_base=>$hash_parent, file_name=>$file)}, $from_id) .
+ $cgi->a({-href => href(action=>"blob", hash_base=>$hash_parent,
+ hash=>$from_id, file_name=>$file)},
+ $from_id) .
" -> " .
file_type($to_mode) . ":" .
- $cgi->a({-href => href(action=>"blob", hash=>$to_id, hash_base=>$hash, file_name=>$file)}, $to_id);
+ $cgi->a({-href => href(action=>"blob", hash_base=>$hash,
+ hash=>$to_id, file_name=>$file)},
+ $to_id);
print "</div>\n";
git_diff_print($from_id, "a/$file", $to_id, "b/$file");
}
@@ -2611,7 +2703,9 @@ sub git_commitdiff_plain {
}
}
- print $cgi->header(-type => "text/plain", -charset => 'utf-8', '-content-disposition' => "inline; filename=\"git-$hash.patch\"");
+ print $cgi->header(-type => "text/plain",
+ -charset => 'utf-8',
+ '-content-disposition' => "inline; filename=\"git-$hash.patch\"");
my %ad = parse_date($co{'author_epoch'}, $co{'author_tz'});
my $comment = $co{'comment'};
print "From: $co{'author'}\n" .
@@ -2791,7 +2885,8 @@ sub git_search {
print "</td>\n" .
"<td class=\"link\">" .
$cgi->a({-href => href(action=>"commit", hash=>$co{'id'})}, "commit") .
- " | " . $cgi->a({-href => href(action=>"tree", hash=>$co{'tree'}, hash_base=>$co{'id'})}, "tree");
+ " | " .
+ $cgi->a({-href => href(action=>"tree", hash=>$co{'tree'}, hash_base=>$co{'id'})}, "tree");
print "</td>\n" .
"</tr>\n";
}
@@ -2828,18 +2923,22 @@ sub git_search {
print "<td title=\"$co{'age_string_age'}\"><i>$co{'age_string_date'}</i></td>\n" .
"<td><i>" . esc_html(chop_str($co{'author_name'}, 15, 5)) . "</i></td>\n" .
"<td>" .
- $cgi->a({-href => href(action=>"commit", hash=>$co{'id'}), -class => "list subject"},
+ $cgi->a({-href => href(action=>"commit", hash=>$co{'id'}),
+ -class => "list subject"},
esc_html(chop_str($co{'title'}, 50)) . "<br/>");
while (my $setref = shift @files) {
my %set = %$setref;
- print $cgi->a({-href => href(action=>"blob", hash=>$set{'id'}, hash_base=>$co{'id'}, file_name=>$set{'file'}), class => "list"},
- "<span class=\"match\">" . esc_html($set{'file'}) . "</span>") .
+ print $cgi->a({-href => href(action=>"blob", hash_base=>$co{'id'},
+ hash=>$set{'id'}, file_name=>$set{'file'}),
+ -class => "list"},
+ "<span class=\"match\">" . esc_html($set{'file'}) . "</span>") .
"<br/>\n";
}
print "</td>\n" .
"<td class=\"link\">" .
$cgi->a({-href => href(action=>"commit", hash=>$co{'id'})}, "commit") .
- " | " . $cgi->a({-href => href(action=>"tree", hash=>$co{'tree'}, hash_base=>$co{'id'})}, "tree");
+ " | " .
+ $cgi->a({-href => href(action=>"tree", hash=>$co{'tree'}, hash_base=>$co{'id'})}, "tree");
print "</td>\n" .
"</tr>\n";
}
--
1.4.1.1
^ permalink raw reply related
* [PATCH 2/3] gitweb: Use underscore instead of hyphen to separate words in HTTP headers names
From: Jakub Narebski @ 2006-08-22 14:55 UTC (permalink / raw)
To: git
In-Reply-To: <200608221651.19629.jnareb@gmail.com>
Use underscore (which will be turned into hyphen) to separate words in
HTTP header names, in keys to CGI header() method, consistently.
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
---
Sometimes using quites for header() keys and sometimes not was not
a good practice.
Excerpt from CGI(3pm):
The last example shows the named argument style for passing arguments to
the CGI methods using named parameters. Recognized parameters are -type,
-status, -expires, and -cookie. Any other named parameters will be
stripped of their initial hyphens and turned into header fields, allowing
you to specify any HTTP header you desire. Internal underscores will be
turned into hyphens:
print header(-Content_length=>3002);
gitweb/gitweb.perl | 9 +++++----
1 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index 182fe33..f59213e 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -2202,7 +2202,8 @@ sub git_blob_plain {
$save_as .= '.txt';
}
- print $cgi->header(-type => "$type", '-content-disposition' => "inline; filename=\"$save_as\"");
+ print $cgi->header(-type => "$type",
+ -content_disposition => "inline; filename=\"$save_as\"");
undef $/;
binmode STDOUT, ':raw';
print <$fd>;
@@ -2386,8 +2387,8 @@ sub git_snapshot {
my $filename = basename($project) . "-$hash.tar.$suffix";
print $cgi->header(-type => 'application/x-tar',
- -content-encoding => $ctype,
- '-content-disposition' => "inline; filename=\"$filename\"",
+ -content_encoding => $ctype,
+ -content_disposition => "inline; filename=\"$filename\"",
-status => '200 OK');
open my $fd, "-|", "$GIT tar-tree $hash \'$project\' | $command" or
@@ -2705,7 +2706,7 @@ sub git_commitdiff_plain {
print $cgi->header(-type => "text/plain",
-charset => 'utf-8',
- '-content-disposition' => "inline; filename=\"git-$hash.patch\"");
+ -content_disposition => "inline; filename=\"git-$hash.patch\"");
my %ad = parse_date($co{'author_epoch'}, $co{'author_tz'});
my $comment = $co{'comment'};
print "From: $co{'author'}\n" .
--
1.4.1.1
^ permalink raw reply related
* Re: recur status on linux-2.6
From: Johannes Schindelin @ 2006-08-22 13:57 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git
In-Reply-To: <7virklp438.fsf@assigned-by-dhcp.cox.net>
Hi,
On Tue, 22 Aug 2006, Junio C Hamano wrote:
> Maybe we should welcome Linus back with a surprise change that
> makes recur take over recursive ;-).
*holds his breath*
> Well, maybe not *that* fast.
Puh!
I still have not had the time to figure out why 10a6653c goes bad. So I do
not know if that is a show stopper or not.
Ciao,
Dscho
^ permalink raw reply
* [PATCH] git-send-email: Don't set author_not_sender from Cc: lines
From: Haavard Skinnemoen @ 2006-08-22 13:38 UTC (permalink / raw)
To: git; +Cc: Haavard Skinnemoen, Junio C Hamano
When an mbox-style patch contains a Cc: line in the header,
git-send-email will check the address against the sender specified
on the command line. If they don't match, sender_not_author will
be set to the address obtained from the Cc line.
When this happens, git-send-email inserts a From: line at the
beginning of the message body with the address obtained from the
Cc line in the header, and the sender might be accused of forging
patch authors.
This patch fixes this by only updating sender_not_author when
processing From: lines, not when processing Cc: lines.
Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com>
---
This email was sent using git-send-email with the patch applied. Junio
was Cc'ed by editing the patch header -- let's see if it works...
git-send-email.perl | 7 +++++--
1 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/git-send-email.perl b/git-send-email.perl
index a83c7e9..0197454 100755
--- a/git-send-email.perl
+++ b/git-send-email.perl
@@ -506,7 +506,7 @@ foreach my $t (@files) {
if (/^Subject:\s+(.*)$/) {
$subject = $1;
- } elsif (/^(Cc|From):\s+(.*)$/) {
+ } elsif (/^(From):\s+(.*)$/) {
if ($2 eq $from) {
next if ($suppress_from);
}
@@ -516,8 +516,11 @@ foreach my $t (@files) {
printf("(mbox) Adding cc: %s from line '%s'\n",
$2, $_) unless $quiet;
push @cc, $2;
+ } elsif (/^(Cc):\s+(.*)$/) {
+ printf("(mbox) Adding cc: %s from line '%s'\n",
+ $2, $_) unless $quiet;
+ push @cc, $2;
}
-
} else {
# In the traditional
# "send lots of email" format,
--
1.4.0
^ permalink raw reply related
* Be delighted with Imagine that this is bigger and moreover, stays big forever!
From: Ana @ 2006-08-22 12:18 UTC (permalink / raw)
To: glenda
New
Imagine that this is bigger and moreover, stays big forever! A month or less will pass, and you will forget what it feels like to doubt your size and performance.
Just show her how big it is, and she will forget everybody she met before. Expect an explosion in your intimate life very soon - guaranteed! Just take a look: http://www.caseyjul.com/gall/ms/
Just imagine how wonderful your life would become with a bigger size and increased duration.
Admiration is the daughter of ignorance Middle age is when broadness of the mind and narrowness of the waist change places A good tree brings forth good fruit. Fight fire with fire A watched pot never boils. A Growing Youth Has a Wolf in His Belly.
^ permalink raw reply
* Re: [RFD] gitweb: href() function to generate URLs for CGI
From: Jakub Narebski @ 2006-08-22 10:47 UTC (permalink / raw)
To: git
In-Reply-To: <7vodudno88.fsf@assigned-by-dhcp.cox.net>
Junio C Hamano wrote:
> Semicolons and equals are used as separators between key-value
> pairs (i.e. syntactic elements) so if we have a value
> $params{$name} that happens to contain a ';' or '=' character I
> suspect we would want to quote that but not the one we use
> before the value or between tuples. Otherwise, how is a search
> text that is "a = b;" encoded in the resulting href?
URL for search is created and encoded by browser I think, so search
for "a = b" generates
gitweb.cgi?p=git.git&a=search&h=HEAD&s=a+%3D+b
URI (notice it uses '&' as parameter separator, not ';'),
but because '=' is not on the list of valid $searchtext characters,
due to
if ($searchtext =~ m/[^a-zA-Z0-9_\.\/\-\+\:\@ ]/)
gitweb returns "403 Forbidden - Invalid search parameter".
--
Jakub Narebski
Warsaw, Poland
ShadeHawk on #git
^ permalink raw reply
* [PATCH] gitweb: Replace some presentational HTML by CSS
From: Jakub Narebski @ 2006-08-22 10:38 UTC (permalink / raw)
To: git; +Cc: Luben Tuikov, Junio C Hamano, Jakub Narebski
In-Reply-To: <20060822085739.75519.qmail@web31810.mail.mud.yahoo.com>
From: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
---
Follows "gitweb: bugfix: a.list formatting regression" patch.
gitweb/gitweb.css | 3 ++-
gitweb/gitweb.perl | 19 ++++++++++---------
2 files changed, 12 insertions(+), 10 deletions(-)
diff --git a/gitweb/gitweb.css b/gitweb/gitweb.css
index 6c13d9e..4821022 100644
--- a/gitweb/gitweb.css
+++ b/gitweb/gitweb.css
@@ -42,6 +42,7 @@ div.page_nav a:visited {
div.page_path {
padding: 8px;
+ font-weight: bold;
border: solid #d9d8d1;
border-width: 0px 0px 1px;
}
@@ -120,7 +121,7 @@ a.list {
color: #000000;
}
-a.subject {
+a.subject, a.name {
font-weight: bold;
}
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index 40c5177..607b8b7 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -1267,17 +1267,17 @@ sub git_print_page_path {
my $hb = shift;
if (!defined $name) {
- print "<div class=\"page_path\"><b>/</b></div>\n";
+ print "<div class=\"page_path\">/</div>\n";
} elsif (defined $type && $type eq 'blob') {
- print "<div class=\"page_path\"><b>";
+ print "<div class=\"page_path\">";
if (defined $hb) {
print $cgi->a({-href => href(action=>"blob_plain", hash_base=>$hb, file_name=>$file_name)}, esc_html($name));
} else {
print $cgi->a({-href => href(action=>"blob_plain", file_name=>$file_name)}, esc_html($name));
}
- print "</b><br/></div>\n";
+ print "<br/></div>\n";
} else {
- print "<div class=\"page_path\"><b>" . esc_html($name) . "</b><br/></div>\n";
+ print "<div class=\"page_path\">" . esc_html($name) . "<br/></div>\n";
}
}
@@ -1630,7 +1630,7 @@ sub git_tags_body {
print "<td><i>$tag{'age'}</i></td>\n" .
"<td>" .
$cgi->a({-href => href(action=>$tag{'reftype'}, hash=>$tag{'refid'}),
- -class => "list"}, "<b>" . esc_html($tag{'name'}) . "</b>") .
+ -class => "list name"}, esc_html($tag{'name'})) .
"</td>\n" .
"<td>";
if (defined $comment) {
@@ -1684,7 +1684,7 @@ sub git_heads_body {
print "<td><i>$tag{'age'}</i></td>\n" .
($tag{'id'} eq $head ? "<td class=\"current_head\">" : "<td>") .
$cgi->a({-href => href(action=>"shortlog", hash=>$tag{'name'}),
- -class => "list"}, "<b>" . esc_html($tag{'name'}) . "</b>") .
+ -class => "list name"},esc_html($tag{'name'})) .
"</td>\n" .
"<td class=\"link\">" .
$cgi->a({-href => href(action=>"shortlog", hash=>$tag{'name'})}, "shortlog") . " | " .
@@ -2774,7 +2774,8 @@ sub git_search {
print "<td title=\"$co{'age_string_age'}\"><i>$co{'age_string_date'}</i></td>\n" .
"<td><i>" . esc_html(chop_str($co{'author_name'}, 15, 5)) . "</i></td>\n" .
"<td>" .
- $cgi->a({-href => href(action=>"commit", hash=>$co{'id'}) -class => "list"}, "<b>" . esc_html(chop_str($co{'title'}, 50)) . "</b><br/>");
+ $cgi->a({-href => href(action=>"commit", hash=>$co{'id'}), -class => "list subject"},
+ esc_html(chop_str($co{'title'}, 50)) . "<br/>");
my $comment = $co{'comment'};
foreach my $line (@$comment) {
if ($line =~ m/^(.*)($searchtext)(.*)$/i) {
@@ -2827,8 +2828,8 @@ sub git_search {
print "<td title=\"$co{'age_string_age'}\"><i>$co{'age_string_date'}</i></td>\n" .
"<td><i>" . esc_html(chop_str($co{'author_name'}, 15, 5)) . "</i></td>\n" .
"<td>" .
- $cgi->a({-href => href(action=>"commit", hash=>$co{'id'}), -class => "list"}, "<b>" .
- esc_html(chop_str($co{'title'}, 50)) . "</b><br/>");
+ $cgi->a({-href => href(action=>"commit", hash=>$co{'id'}), -class => "list subject"},
+ esc_html(chop_str($co{'title'}, 50)) . "<br/>");
while (my $setref = shift @files) {
my %set = %$setref;
print $cgi->a({-href => href(action=>"blob", hash=>$set{'id'}, hash_base=>$co{'id'}, file_name=>$set{'file'}), class => "list"},
--
1.4.1.1
^ permalink raw reply related
* [PATCH] gitweb: bugfix: a.list formatting regression
From: Jakub Narebski @ 2006-08-22 10:02 UTC (permalink / raw)
To: git; +Cc: Luben Tuikov, Junio C Hamano, Jakub Narebski
In-Reply-To: <20060822085540.1104.qmail@web31812.mail.mud.yahoo.com>
From: Jakub Narebski <jnareb@gmail.com>
Fix regression introduced by
commit 17d07443188909ef5f8b8c24043cb6d9fef51bca.
"a.list" being "bold", makes a myriad of things shown by
gitweb in bold font-weight, which is a regression from
pre-17d07443188909ef5f8b8c24043cb6d9fef51bca behavior.
The fix is to add "subject" class and use this class
to replace pre-format_subject_html formatting of subject
(comment) via using (or not) <b>...</b> element. This
should go back to the pre-17d0744318... style.
Regression noticed by Luben Tuikov.
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Luben Tuikov <ltuikov@yahoo.com>
---
Luben Tuikov wrote:
> 1. Commit 17d07443188909ef5f8b8c24043cb6d9fef51bca defines
> "a.list" twice in gitweb.css, once with bold and once with
> normal font-weight.
"table.tags a.list" means "a.list" inside "table.tags",
so it is not redefinition of "a.list", but override
(more specific CSS rule wins). It is for subject of tags
list ("summary" and "tags" actions) to be in normal
weight, as in such list the tag itself (ref) is in bold,
not the tag comment (first line of free form part of tag).
gitweb/gitweb.css | 7 +++++--
gitweb/gitweb.perl | 4 ++--
2 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/gitweb/gitweb.css b/gitweb/gitweb.css
index 9013895..6c13d9e 100644
--- a/gitweb/gitweb.css
+++ b/gitweb/gitweb.css
@@ -117,11 +117,14 @@ div.list_head {
a.list {
text-decoration: none;
- font-weight: bold;
color: #000000;
}
-table.tags a.list {
+a.subject {
+ font-weight: bold;
+}
+
+table.tags a.subject {
font-weight: normal;
}
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index 90157d5..40c5177 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -504,11 +504,11 @@ sub format_subject_html {
$extra = '' unless defined($extra);
if (length($short) < length($long)) {
- return $cgi->a({-href => $href, -class => "list",
+ return $cgi->a({-href => $href, -class => "list subject",
-title => $long},
esc_html($short) . $extra);
} else {
- return $cgi->a({-href => $href, -class => "list"},
+ return $cgi->a({-href => $href, -class => "list subject"},
esc_html($long) . $extra);
}
}
--
1.4.1.1
^ permalink raw reply related
* Re: [RFD] gitweb: href() function to generate URLs for CGI
From: Jakub Narebski @ 2006-08-22 9:34 UTC (permalink / raw)
To: git
In-Reply-To: <7vodudno88.fsf@assigned-by-dhcp.cox.net>
Junio C Hamano wrote:
> So the last part of the above should perhaps read:
>
> my @result = ();
> for (my $i = 0; $i < @mapping; $i += 2) {
> my ($name, $symbol) = ($mapping[$i], $mapping[$i+1]);
> if (defined $params{$name}) {
> push @result, join('=', esc_param($symbol),
> esc_param($params{$name}));
> }
> }
There is really no need to escape $symbol; we control this,
and it is CGI param safe.
BTW. why use join? The following
push @result, "$symbol=" . esc_param($params{$name});
would be simplier... we could even use
$href .= ($i > 0? ";" : "") . "$symbol=" . esc_param($params{$name});
although probably this isn't best idea (worse readibility).
--
Jakub Narebski
Warsaw, Poland
ShadeHawk on #git
^ permalink raw reply
* Re: [PATCH] gitweb: all bold lists are "list_bold" style
From: Jakub Narebski @ 2006-08-22 9:30 UTC (permalink / raw)
To: git
In-Reply-To: <20060822085739.75519.qmail@web31810.mail.mud.yahoo.com>
This should be reply to
[PATCH] gitweb: bugfix: list regression
(or at least it should be mentioned that this patch is needed).
--
Jakub Narebski
Warsaw, Poland
ShadeHawk on #git
^ permalink raw reply
* Re: [PATCH] gitweb: bugfix: list regression
From: Jakub Narebski @ 2006-08-22 9:30 UTC (permalink / raw)
To: git
In-Reply-To: <20060822085540.1104.qmail@web31812.mail.mud.yahoo.com>
Luben Tuikov wrote:
> Fix regression introduced by
> commit 17d07443188909ef5f8b8c24043cb6d9fef51bca.
>
> 1. Commit 17d07443188909ef5f8b8c24043cb6d9fef51bca defines
> "a.list" twice in gitweb.css, once with bold and once with
> normal font-weight.
>
> 2. "a.list" being "bold", makes a myriad of things shown by
> gitweb in bold font-weight, which is a regression from
> pre-17d07443188909ef5f8b8c24043cb6d9fef51bca behavior.
>
> The fix is to define separately "a.list_bold" and use
> that style in format_subject_html().
This fix is counter to what I wanted to do. I thought that
"list" class is used only in "subject" links, so I defaulted
it to bold (all such elements except one were inside <b>...</b>),
and encoded exceptions; notice
+table.tags a.list {
+ font-weight: normal;
+}
+
We could as well define "bold" class for "a", i.e.
+a.bold {
+ font-weight: bold;
+}
but this is presentational CSS, no better than <b>...</b> element.
The correct solution would be to add "subject" class perhaps,
and do exceptions for it.
--
Jakub Narebski
Warsaw, Poland
ShadeHawk on #git
^ permalink raw reply
* Re: [PATCH] gitweb: bugfix: list regression
From: Junio C Hamano @ 2006-08-22 9:19 UTC (permalink / raw)
To: Luben Tuikov; +Cc: git, Jakub Narebski
In-Reply-To: <20060822085540.1104.qmail@web31812.mail.mud.yahoo.com>
Luben Tuikov <ltuikov@yahoo.com> writes:
> Fix regression introduced by
> commit 17d07443188909ef5f8b8c24043cb6d9fef51bca.
>
> 1. Commit 17d07443188909ef5f8b8c24043cb6d9fef51bca defines
> "a.list" twice in gitweb.css, once with bold and once with
> normal font-weight.
The normal one is limited to a.list that is inside table.tags
isn't it? I had an impression that this was done on purpose.
> 2. "a.list" being "bold", makes a myriad of things shown by
> gitweb in bold font-weight, which is a regression from
> pre-17d07443188909ef5f8b8c24043cb6d9fef51bca behavior.
The only difference I see offhand is that Jakub's version shows
the tag text in normal weight in summary pane (tags section),
while yours show it in bold. Also clickable object names in
many views are shown in bold in Jakub's version while yours do
not distinguish them from unclickable ones.
I tend to agree that bold looks too loud in tree view, but
showing tree and parent diffently from commit itself in commit
view may be a good thing. I am not sure bold is a good choice,
though. Usually people underline clickable links not type in
bold.
I do not case either way myself that much. Could you battle
this out with the guilty party?
^ permalink raw reply
* [PATCH] gitweb: all bold lists are "list_bold" style
From: Luben Tuikov @ 2006-08-22 8:57 UTC (permalink / raw)
To: git
[-- Attachment #1: Type: text/plain, Size: 140 bytes --]
Signed-off-by: Luben Tuikov <ltuikov@yahoo.com>
---
gitweb/gitweb.perl | 10 +++++-----
1 files changed, 5 insertions(+), 5 deletions(-)
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 1207600725-p1.txt --]
[-- Type: text/inline; name="p1.txt", Size: 2475 bytes --]
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index 5237f25..4caf69e 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -1583,7 +1583,7 @@ sub git_tags_body {
print "<td><i>$tag{'age'}</i></td>\n" .
"<td>" .
$cgi->a({-href => href(action=>$tag{'reftype'}, hash=>$tag{'refid'}),
- -class => "list"}, "<b>" . esc_html($tag{'name'}) . "</b>") .
+ -class => "list_bold"}, esc_html($tag{'name'})) .
"</td>\n" .
"<td>";
if (defined $comment) {
@@ -1637,7 +1637,7 @@ sub git_heads_body {
print "<td><i>$tag{'age'}</i></td>\n" .
($tag{'id'} eq $head ? "<td class=\"current_head\">" : "<td>") .
$cgi->a({-href => href(action=>"shortlog", hash=>$tag{'name'}),
- -class => "list"}, "<b>" . esc_html($tag{'name'}) . "</b>") .
+ -class => "list_bold"}, esc_html($tag{'name'})) .
"</td>\n" .
"<td class=\"link\">" .
$cgi->a({-href => href(action=>"shortlog", hash=>$tag{'name'})}, "shortlog") . " | " .
@@ -2686,7 +2686,7 @@ sub git_search {
print "<td title=\"$co{'age_string_age'}\"><i>$co{'age_string_date'}</i></td>\n" .
"<td><i>" . esc_html(chop_str($co{'author_name'}, 15, 5)) . "</i></td>\n" .
"<td>" .
- $cgi->a({-href => href(action=>"commit", hash=>$co{'id'}) -class => "list"}, "<b>" . esc_html(chop_str($co{'title'}, 50)) . "</b><br/>");
+ $cgi->a({-href => href(action=>"commit", hash=>$co{'id'}) -class => "list_bold"}, esc_html(chop_str($co{'title'}, 50)) . "<br/>");
my $comment = $co{'comment'};
foreach my $line (@$comment) {
if ($line =~ m/^(.*)($searchtext)(.*)$/i) {
@@ -2739,8 +2739,8 @@ sub git_search {
print "<td title=\"$co{'age_string_age'}\"><i>$co{'age_string_date'}</i></td>\n" .
"<td><i>" . esc_html(chop_str($co{'author_name'}, 15, 5)) . "</i></td>\n" .
"<td>" .
- $cgi->a({-href => href(action=>"commit", hash=>$co{'id'}), -class => "list"}, "<b>" .
- esc_html(chop_str($co{'title'}, 50)) . "</b><br/>");
+ $cgi->a({-href => href(action=>"commit", hash=>$co{'id'}), -class => "list_bold"},
+ esc_html(chop_str($co{'title'}, 50)) . "<br/>");
while (my $setref = shift @files) {
my %set = %$setref;
print $cgi->a({-href => href(action=>"blob", hash=>$set{'id'}, hash_base=>$co{'id'}, file_name=>$set{'file'}), class => "list"},
--
1.4.2.g3851f
^ permalink raw reply related
* Re: [RFD] gitweb: href() function to generate URLs for CGI
From: Junio C Hamano @ 2006-08-22 8:55 UTC (permalink / raw)
To: Jakub Narebski; +Cc: git
In-Reply-To: <eceekl$b0l$2@sea.gmane.org>
Jakub Narebski <jnareb@gmail.com> writes:
> So perhaps
>
> my %mapping = @mapping;
> my @params_keys_sorted;
> for (my $i = 0; $i < @mapping; $i += 2) {
> if (exists $params{$mapping[$i]}) {
> push @params_keys_sorted, $mapping[$i];
> }
> }
>
> This way we have only one loop over all valid parameter names,
> and we wouldn't need grep nor conditional expression in map,
> and map would loop over all (valid) params keys only.
At that point I suspect that loop can do everything your map {}
did, and would look simpler (albeit perhaps a little bit less
Perlish) like this:
sub href(%) {
my %params = @_;
$params{"project"} ||= $project;
my @mapping = ( project => "p",
action => "a",
hash => "h",
hash_parent => "hp",
hash_base => "hb",
file_name => "f",
file_parent => "fp",
page => "pg",
searchtext => "s",
);
my @result = ();
for (my $i = 0; $i < @mapping; $i += 2) {
my ($name, $symbol) = ($mapping[$i], $mapping[$i+1]);
if (defined $params{$name}) {
push @result, "$symbol=$params{$name}";
}
}
return "$my_uri?" . esc_param(join(';', @result));
}
By the way, is it really what we want to do to call esc_param()
on joined result?
Maybe I am not reading this code correctly, but this feels quite
counter-intuitive. Actually, it feels downright wrong.
Semicolons and equals are used as separators between key-value
pairs (i.e. syntactic elements) so if we have a value
$params{$name} that happens to contain a ';' or '=' character I
suspect we would want to quote that but not the one we use
before the value or between tuples. Otherwise, how is a search
text that is "a = b;" encoded in the resulting href?
So the last part of the above should perhaps read:
my @result = ();
for (my $i = 0; $i < @mapping; $i += 2) {
my ($name, $symbol) = ($mapping[$i], $mapping[$i+1]);
if (defined $params{$name}) {
push @result, join('=', esc_param($symbol),
esc_param($params{$name}));
}
}
return "$my_uri?" . join(';', @result);
We would also need to fix esc_param to quote ';' and '=' as
well, which does not seem to quote them.
^ permalink raw reply
* [PATCH] gitweb: bugfix: list regression
From: Luben Tuikov @ 2006-08-22 8:55 UTC (permalink / raw)
To: git
Fix regression introduced by
commit 17d07443188909ef5f8b8c24043cb6d9fef51bca.
1. Commit 17d07443188909ef5f8b8c24043cb6d9fef51bca defines
"a.list" twice in gitweb.css, once with bold and once with
normal font-weight.
2. "a.list" being "bold", makes a myriad of things shown by
gitweb in bold font-weight, which is a regression from
pre-17d07443188909ef5f8b8c24043cb6d9fef51bca behavior.
The fix is to define separately "a.list_bold" and use
that style in format_subject_html().
Signed-off-by: Luben Tuikov <ltuikov@yahoo.com>
---
gitweb/gitweb.css | 9 +++++++--
gitweb/gitweb.perl | 4 ++--
2 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/gitweb/gitweb.css b/gitweb/gitweb.css
index 9013895..db58629 100644
--- a/gitweb/gitweb.css
+++ b/gitweb/gitweb.css
@@ -115,13 +115,18 @@ div.list_head {
font-style: italic;
}
-a.list {
+a.list_bold {
text-decoration: none;
font-weight: bold;
color: #000000;
}
-table.tags a.list {
+a.list {
+ text-decoration: none;
+ color: #000000;
+}
+
+table.tags {
font-weight: normal;
}
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index 063735d..5237f25 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -504,11 +504,11 @@ sub format_subject_html {
$extra = '' unless defined($extra);
if (length($short) < length($long)) {
- return $cgi->a({-href => $href, -class => "list",
+ return $cgi->a({-href => $href, -class => "list_bold",
-title => $long},
esc_html($short) . $extra);
} else {
- return $cgi->a({-href => $href, -class => "list"},
+ return $cgi->a({-href => $href, -class => "list_bold"},
esc_html($long) . $extra);
}
}
--
1.4.2.g3851f
^ permalink raw reply related
* Re: stgit: deleting a branch doesn't seem to work
From: Catalin Marinas @ 2006-08-22 8:34 UTC (permalink / raw)
To: Torgil Svensson; +Cc: git
In-Reply-To: <e7bda7770608211027m298ca361pdd78e164b9a524a5@mail.gmail.com>
"Torgil Svensson" <torgil.svensson@gmail.com> wrote:
> I have three branches and want my "gst10" to be "master" instead
>
> $ stg branch --delete master
> Deleting branch "master"... done
> $ stg branch -l
> Available branches:
> s gst10 |
> master |
>> origin |
> $ stg branch --delete master
> Deleting branch "master"... done
> $ stg branch -r gst10 master
> stg branch: Branch "master" already exists
>
> Is there something i'm missing in my logic?
It's not actually documented but it looks like the master branch is
not completely deleted by StGIT. If you have StGIT-managed patches in
"master", they are removed but the GIT branch is kept as this is
usually the default branch.
You could do a "git branch -d master" but maybe I should change StGIT
to fully delete the "master" branch as well.
--
Catalin
^ permalink raw reply
* Re: recur status on linux-2.6
From: Junio C Hamano @ 2006-08-22 8:27 UTC (permalink / raw)
To: Johannes Schindelin; +Cc: git, Fredrik Kuivinen
In-Reply-To: <20060819104630.GA5213@c165.ib.student.liu.se>
Fredrik Kuivinen <freku045@student.liu.se> writes:
> On Sun, Aug 13, 2006 at 03:54:19PM +0200, Johannes Schindelin wrote:
>> Hi,
>>
>> I tested git-merge-recur vs. git-merge-recursive on the linux-2.6
>> repository last night. It contains 2298 two-head merges. _All_ of them
>> come out identically with -recur as compared to -recursive (looking at
>> the resulting index only).
>
> After the latest updates to git-merge-recur it passes all the tests I
> have too.
>
>> That was the good news. The bad news is: it _seems_, that -recur is only
>> about 6x faster than -recursive, not 10x, and this number becomes smaller,
>> the longer the merge takes. So I see a startup effect here, probably.
>
> That is a quite nice improvement anyway :)
Maybe we should welcome Linus back with a surprise change that
makes recur take over recursive ;-).
Well, maybe not *that* fast.
Here is what I have in mind.
* Not in too distant future, like this weekend, we would:
- remove "TEST" at toplevel;
- merge the C merge-recur work in "master".
At this stage, people still have to ask for "recur" by either
explicitly saying "-s recur" or by exporting the environment
variable GIT_USE_RECUR_FOR_RECURSIVE=YesPlease; git
developers are encouraged to use this while running tests and
production.
* Before stabilization for 1.4.3, we would:
- rename merge-recursive to merge-recursive-old and
merge-recur to merge-recursive.
- we remove GIT_USE_RECUR_FOR_RECURSIVE hack.
- we make --no-python in t/ directory no-op and only test C
recursive implementation by default.
After this, people who would want to keep using the original
recursive have to ask for it by "-s recursive-old".
* We release 1.4.3 with C recursive as the default merge
strategy.
I am not at this moment thinking about removing recursive in
Python altogether. We still have a few contrib scripts
(p4import and gitview) that are in Python, so doing that would
not remove our dependency on Python anyway.
^ permalink raw reply
* Re: [RFD] gitweb: href() function to generate URLs for CGI
From: Jakub Narebski @ 2006-08-22 8:18 UTC (permalink / raw)
To: git
In-Reply-To: <7vlkphqmac.fsf@assigned-by-dhcp.cox.net>
Junio C Hamano wrote:
> Jakub Narebski <jnareb@gmail.com> writes:
>
>> This doesn't work as expected. Map works on _every_ element of list; if
>> expression doesn't return anything it just puts undef I think. For example
>> while
>>
>> print join(";",
>> map {
>> "a/$_" if ($_ eq lc($_))
>> } ("a", "b", "C", "d")),
>> "\n";'
>>
>> returns "a/a;a/b;;a/d" (notice the doubled ';'), the correct way would be to
>
> ... say this, than using extra grep {}.
>
> print join(";",
> map {
> ($_ eq lc($_)) ? "a/$_" : ()
> } ("a", "b", "C", "d")),
> "\n";
That's better. I didn't know about this trick. Patch will follow.
BTW. I have encountered this error in true situation, while doing history
pagination because I forgot in parse_difftree_raw_line that the
map(function, list) works only for prototyped functions, and had undef fed
to href.
>> What about my proposed solution? Don't sort, use sorted keys instead, i.e.
>> something like (after unmangling whitespace)
>>
>> sub href(%) {
>> my @mapping = ( project => "p",
>> action => "a",
>> hash => "h",
>> hash_parent => "hp",
>> hash_base => "hb",
>> file_name => "f",
>> file_parent => "fp",
>> page => "pg",
>> searchtext => "s",
>> );
>> my %mapping;
>> my @mapping_keys;
>> for (my $i = 0; $i < @mapping; $i += 2) {
>> my ($k, $v) = ($mapping[$i], $mapping[$i+1]);
>> $mapping{$k} = $v;
>> push @mapping_keys, $k;
>> }
>
> Now this loop got an expensive way to say %mapping = @mapping
> plus assigning @mapping_keys, so I would do only the push part
> in the loop for readability while changing the name of the
> variable a bit more meaningful.
>
> my %mapping = @mapping;
> my @valid_params;
> for (my $i = 0; $i < @mapping; $i += 2) {
> push @valid_params, $mapping[$i];
> }
>
> But aside from that, I very much prefer your version that loops
> over what _we_ define (i.e. @valid_params), rather than what the
> user happens to throw at us (i.e. keys %params).
So perhaps
my %mapping = @mapping;
my @params_keys_sorted;
for (my $i = 0; $i < @mapping; $i += 2) {
if (exists $params{$mapping[$i]}) {
push @params_keys_sorted, $mapping[$i];
}
}
This way we have only one loop over all valid parameter names,
and we wouldn't need grep nor conditional expression in map,
and map would loop over all (valid) params keys only.
--
Jakub Narebski
Warsaw, Poland
ShadeHawk on #git
^ permalink raw reply
* Re: [PATCH] gitweb: Paginate history output
From: Jakub Narebski @ 2006-08-22 8:08 UTC (permalink / raw)
To: git
In-Reply-To: <7vveols3c7.fsf@assigned-by-dhcp.cox.net>
Junio C Hamano wrote:
> Jakub Narebski <jnareb@gmail.com> writes:
>
>> @@ -1559,6 +1562,7 @@ sub git_history_body {
>> next;
>> }
>>
>> + #my $ref = defined $refs ? format_ref_marker($refs, $commit) : '';
>> my $ref = format_ref_marker($refs, $commit);
>>
>> if ($alternate) {
>
> Do you want to change this or not? Make up your mind.
I'm not sure. This is an internal function, so $refs should
be defined. I'm not sure checking here is worth it.
This whole hunk could be removed.
>> + $paging_nav .= " ⋅ " .
>> + $cgi->a({-href => href(action=>"history", hash=>$hash, hash_base=>$hash_base,
>> + file_name=>$file_name, page=>$page-1),
>> + -accesskey => "p", -title => "Alt-p"}, "prev");
>
> This is something you inherited from the original and not your
> fault, but I am not sure if these -title entries are of good
> taste (we have corresponding "Alt-n" for "next"). Something
> more descriptive like "<Alt-p> for 100 newer changes", perhaps?
That would be better.
> Also, "first", "prev" and "next" have always confused me. Maybe
> "latest", "older" and "newer" are better labels for them?
"first" is only for pagination of "history" action, "shortlog",
"heads" and "tags" have "HEAD" there instead.
> Is 100 a good default? It feels a bit unbalanced compared to
> the height of the default summary page with descriptions, 16
> shortlog entries, 16 tags and 12 heads.
It's 16 heads (if you have that many), from what I remember
from source.
The purpose of summary page is to have everything at glance (it means
that it should be contained in one, two pages. The pagination of
output is to not send too much at once.
--
Jakub Narebski
Warsaw, Poland
ShadeHawk on #git
^ permalink raw reply
* Re: [RFD] gitweb: href() function to generate URLs for CGI
From: Junio C Hamano @ 2006-08-22 7:09 UTC (permalink / raw)
To: Jakub Narebski; +Cc: git
In-Reply-To: <eccujr$90h$1@sea.gmane.org>
Jakub Narebski <jnareb@gmail.com> writes:
> This doesn't work as expected. Map works on _every_ element of list; if
> expression doesn't return anything it just puts undef I think. For example
> while
>
> print join(";",
> map {
> "a/$_" if ($_ eq lc($_))
> } ("a", "b", "C", "d")),
> "\n";'
>
> returns "a/a;a/b;;a/d" (notice the doubled ';'), the correct way would be to
... say this, than using extra grep {}.
print join(";",
map {
($_ eq lc($_)) ? "a/$_" : ()
} ("a", "b", "C", "d")),
"\n";
> What about my proposed solution? Don't sort, use sorted keys instead, i.e.
> something like (after unmangling whitespace)
>
> sub href(%) {
> my @mapping = ( project => "p",
> action => "a",
> hash => "h",
> hash_parent => "hp",
> hash_base => "hb",
> file_name => "f",
> file_parent => "fp",
> page => "pg",
> searchtext => "s",
> );
> my %mapping;
> my @mapping_keys;
> for (my $i = 0; $i < @mapping; $i += 2) {
> my ($k, $v) = ($mapping[$i], $mapping[$i+1]);
> $mapping{$k} = $v;
> push @mapping_keys, $k;
> }
Now this loop got an expensive way to say %mapping = @mapping
plus assigning @mapping_keys, so I would do only the push part
in the loop for readability while changing the name of the
variable a bit more meaningful.
my %mapping = @mapping;
my @valid_params;
for (my $i = 0; $i < @mapping; $i += 2) {
push @valid_params, $mapping[$i];
}
But aside from that, I very much prefer your version that loops
over what _we_ define (i.e. @valid_params), rather than what the
user happens to throw at us (i.e. keys %params).
^ permalink raw reply
* Re: [PATCH] branch as a builtin (again)
From: Junio C Hamano @ 2006-08-22 7:00 UTC (permalink / raw)
To: Kristian Høgsberg; +Cc: git
In-Reply-To: <59ad55d30608211345k7956a219m8ab450c6f2023461@mail.gmail.com>
"Kristian Høgsberg" <krh@bitplanet.net> writes:
> Ok, once more without the spaces. I have to state that it's against
> my personal beliefs using pointers as boolean values, but I can go
> with the flow here. For extra bonus, I'm using xrealloc instead of
> plain realloc now.
My preferences (pretty much procedural):
- Documentation/SubmittingPatches
- Attachments discouraged;
- With a proper commit log message;
- With a proper signed-off line;
- Names in source encoded in utf8 if needed (I think you got
this one right, but application/octet-stream does not give
charset information so I cannot really tell).
- No spaces between a function name and open parenthesis.
Some nitpicks.
> static void create_reflog(struct ref_lock *lock)
> {
>...
> }
Probably reflog interface should supply ways to create new ones
(and delete or truncate existing ones) to users like this
program. Please work with Shawn Pearce to refactor this part.
> static void create_branch(const char *name, const char *start,
> int force, int reflog)
> {
> struct ref_lock *lock;
> unsigned char sha1[20];
> char ref[PATH_MAX], msg[PATH_MAX + 20];
You are using snprintf so I think it is safe, but I think using
PATH_MAX for msg length is wrong. start can be an arbitrary
extended object name expression (HEAD^12~24^2~4^^2~13...) and
does not have much to do with pathname.
> snprintf(ref, sizeof ref, "refs/heads/%s", name);
Maybe barf if snprintf steps over the buffer?
^ permalink raw reply
* Re: [PATCH 2/2] Look for a commit's parents in the standard way.
From: Junio C Hamano @ 2006-08-22 6:42 UTC (permalink / raw)
To: git
In-Reply-To: <b0943d9e0608200343t517ec29dw2b6b49d9d69dbad5@mail.gmail.com>
"Catalin Marinas" <catalin.marinas@gmail.com> writes:
> On 14/08/06, Yann Dirson <ydirson@altern.org> wrote:
>> This has the direct effect of taking info/grafts into account, since
>> ignoring it only causes confusion.
>
> I don't know the difference but is there any between parsing the
> commit file and using git-rev-list --parents?
If you mean parsing "cat-file commit" output vs "rev-list
--parents" output, the former shows the true parents while the
latter shows a list of parents adjusted with information in the
grafts file.
If you are using pathspec then the latter further simplifies the
parent list, but you know that already and you are not using
that form here.
^ permalink raw reply
* Re: [PATCH] Added support for dropping privileges to git-daemon.
From: Junio C Hamano @ 2006-08-22 6:38 UTC (permalink / raw)
To: Tilman Sauerbeck; +Cc: git
In-Reply-To: <1156079371.28098@hammerfest>
Tilman Sauerbeck <tilman@code-monkey.de> writes:
> + [--reuseaddr] [--detach] [--pid-file=file]
> + [--user=u [--group=g]] [directory...]
>
> DESCRIPTION
> -----------
> @@ -93,6 +94,14 @@ OPTIONS
> --pid-file=file::
> Save the process id in 'file'.
>
> +--user=u::
> +--group=g::
> + These two options may be used to make `git-daemon` change its uid and
> + gid before entering the server loop.
> + The uid that's used is the one of 'u'. If `group` is specified,
> + the gid is set to the one of 'g', otherwise, the default gid
> + of 'u' is used.
> +
> <directory>::
> A directory to add to the whitelist of allowed directories. Unless
> --strict-paths is specified this will also include subdirectories
I'd prefer to spell <u> and <g> out, and clarify the description
that the parameter parsing code would do getpwent() for the
user, and the user does not have to supply numeric user and
group ids, and what happens if numeric ids are given.
How well does this interact with --inetd (inetd_mode)? Do we
want to have some notes in the documentation on that topic?
> diff --git a/daemon.c b/daemon.c
> index 012936f..70be10f 100644
> --- a/daemon.c
> +++ b/daemon.c
> @@ -7,6 +7,8 @@ #include <netdb.h>
> #include <netinet/in.h>
> #include <arpa/inet.h>
> #include <syslog.h>
> +#include <pwd.h>
> +#include <grp.h>
> #include "pkt-line.h"
> #include "cache.h"
> #include "exec_cmd.h"
> @@ -14,12 +16,15 @@ #include "exec_cmd.h"
> static int log_syslog;
> static int verbose;
> static int reuseaddr;
> +static const char *user;
> +static const char *group;
Do these have to be file-level global?
Do we want to do getpwnam/getgrnam lookup in drop_privileges()?
"Gaaaah, no such username/groupname!" would be needed anyway,
and I have a feeling that it might be better done once
immediately after argument parsing. Then you can pass whatever
is needed for initgroups/setgid/setuid down as parameters to
serve() and drop_privileges().
Do we want to use initgroups(), which is _BSD_SOURCE? I guess
it is perhaps Ok.
> +static void drop_privileges()
> +{
> + struct passwd *p;
> + struct group *g;
> + gid_t gid;
> +
> + p = getpwnam (user);
No space between function name and open parenthesis, please.
> @@ -709,6 +738,9 @@ static int serve(int port)
> if (socknum == 0)
> die("unable to allocate any listen sockets on port %u", port);
>
> + if (user)
> + drop_privileges();
> +
> return service_loop(socknum, socklist);
> }
Makes one wonder why it checks only user and not group, and then
makes one realize that the argument parsing code enforces that
group is never supplied without user, which leaves funny taste
in the mouth, but that is Ok, I guess.
^ permalink raw reply
* Re: [RFC] adding support for md5
From: Junio C Hamano @ 2006-08-22 6:18 UTC (permalink / raw)
To: Chris Wedgwood; +Cc: git
In-Reply-To: <20060821204430.GA2700@tuatara.stupidest.org>
Chris Wedgwood <cw@f00f.org> writes:
> On Sat, Aug 19, 2006 at 01:50:32PM -0700, Linus Torvalds wrote:
>
>> I can see the point of configurable hashes, but it would be for a
>> stronger hash than sha1, not for a (much) weaker one.
>
> Why any configuration option at all? What in practice does it really
> buy?
I personally am not interested in making this configurable at
all. The hashcmp() change on the other hand to abstract out 20
was a good preparation, if we ever want to switch to longer
hashes we would know where to look.
^ permalink raw reply
* Re: [PATCH] gitweb: Paginate history output
From: Junio C Hamano @ 2006-08-22 6:15 UTC (permalink / raw)
To: Jakub Narebski; +Cc: git
In-Reply-To: <200608220053.10741.jnareb@gmail.com>
Jakub Narebski <jnareb@gmail.com> writes:
> @@ -1559,6 +1562,7 @@ sub git_history_body {
> next;
> }
>
> + #my $ref = defined $refs ? format_ref_marker($refs, $commit) : '';
> my $ref = format_ref_marker($refs, $commit);
>
> if ($alternate) {
Do you want to change this or not? Make up your mind.
> + $paging_nav .= " ⋅ " .
> + $cgi->a({-href => href(action=>"history", hash=>$hash, hash_base=>$hash_base,
> + file_name=>$file_name, page=>$page-1),
> + -accesskey => "p", -title => "Alt-p"}, "prev");
This is something you inherited from the original and not your
fault, but I am not sure if these -title entries are of good
taste (we have corresponding "Alt-n" for "next"). Something
more descriptive like "<Alt-p> for 100 newer changes", perhaps?
Also, "first", "prev" and "next" have always confused me. Maybe
"latest", "older" and "newer" are better labels for them?
Is 100 a good default? It feels a bit unbalanced compared to
the height of the default summary page with descriptions, 16
shortlog entries, 16 tags and 12 heads.
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox