]> Lady’s Gitweb - Gitweb/blobdiff - gitweb.cgi
v234
[Gitweb] / gitweb.cgi
index b099a5c329f598dcbf00117b065fd37be07cc107fcb04ab64f3bd8ece0e75adf..0698b744b567476fbb6962e4b40edb2d9ff7110050a93383769d6ef4b5459464 100755 (executable)
@@ -15,7 +15,7 @@ use CGI::Carp qw(fatalsToBrowser);
 use Fcntl ':mode';
 
 my $cgi = new CGI;
 use Fcntl ':mode';
 
 my $cgi = new CGI;
-my $version =          "232";
+my $version =          "234";
 my $my_url =           $cgi->url();
 my $my_uri =           $cgi->url(-absolute => 1);
 my $rss_link = "";
 my $my_url =           $cgi->url();
 my $my_uri =           $cgi->url(-absolute => 1);
 my $rss_link = "";
@@ -607,6 +607,21 @@ sub file_type {
        }
 }
 
        }
 }
 
+sub format_log_line_html {
+       my $line = shift;
+
+       $line = escapeHTML($line);
+       $line =~ s/ / /g;
+       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 => "list", -href => "$my_uri?p=$project;a=commit;h=$hash_text"}, $hash_text);
+                       $line =~ s/$hash_text/$link/;
+               }
+       }
+       return $line;
+}
+
 sub date_str {
        my $epoch = shift;
        my $tz = shift || "-0000";
 sub date_str {
        my $epoch = shift;
        my $tz = shift || "-0000";
@@ -1395,7 +1410,7 @@ sub git_log {
                        } else {
                                $empty = 0;
                        }
                        } else {
                                $empty = 0;
                        }
-                       print escapeHTML($line) . "<br/>\n";
+                       print format_log_line_html($line) . "<br/>\n";
                }
                if (!$empty) {
                        print "<br/>\n";
                }
                if (!$empty) {
                        print "<br/>\n";
@@ -1496,7 +1511,7 @@ sub git_commit {
                        print "<span style=\"color: #888888\">" . escapeHTML($line) . "</span><br/>\n";
                } else {
                        $signed = 0;
                        print "<span style=\"color: #888888\">" . escapeHTML($line) . "</span><br/>\n";
                } else {
                        $signed = 0;
-                       print escapeHTML($line) . "<br/>\n";
+                       print format_log_line_html($line) . "<br/>\n";
                }
        }
        print "</div>\n";
                }
        }
        print "</div>\n";
@@ -1525,7 +1540,7 @@ sub git_commit {
                        print "<tr class=\"light\">\n";
                }
                $alternate ^= 1;
                        print "<tr class=\"light\">\n";
                }
                $alternate ^= 1;
-               if ($status eq "N") {
+               if ($status eq "A") {
                        my $mode_chng = "";
                        if (S_ISREG(oct $to_mode)) {
                                $mode_chng = sprintf(" with mode: %04o", (oct $to_mode) & 0777);
                        my $mode_chng = "";
                        if (S_ISREG(oct $to_mode)) {
                                $mode_chng = sprintf(" with mode: %04o", (oct $to_mode) & 0777);
@@ -1687,7 +1702,7 @@ sub git_commitdiff {
                } else {
                        $empty = 0;
                }
                } else {
                        $empty = 0;
                }
-               print escapeHTML($line) . "<br/>\n";
+               print format_log_line_html($line) . "<br/>\n";
        }
        print "<br/>\n";
        foreach my $line (@difftree) {
        }
        print "<br/>\n";
        foreach my $line (@difftree) {
@@ -1700,7 +1715,7 @@ sub git_commitdiff {
                my $to_id = $4;
                my $status = $5;
                my $file = $6;
                my $to_id = $4;
                my $status = $5;
                my $file = $6;
-               if ($status eq "N") {
+               if ($status eq "A") {
                        print "<div class=\"diff_info\">" .  file_type($to_mode) . ":" .
                              $cgi->a({-href => "$my_uri?p=$project;a=blob;h=$to_id;hb=$hash;f=$file"}, $to_id) . "(new)" .
                              "</div>\n";
                        print "<div class=\"diff_info\">" .  file_type($to_mode) . ":" .
                              $cgi->a({-href => "$my_uri?p=$project;a=blob;h=$to_id;hb=$hash;f=$file"}, $to_id) . "(new)" .
                              "</div>\n";
@@ -1776,7 +1791,7 @@ sub git_commitdiff_plain {
                my $to_id = $4;
                my $status = $5;
                my $file = $6;
                my $to_id = $4;
                my $status = $5;
                my $file = $6;
-               if ($status eq "N") {
+               if ($status eq "A") {
                        git_diff_print(undef, "/dev/null", $to_id, "b/$file", "plain");
                } elsif ($status eq "D") {
                        git_diff_print($from_id, "a/$file", undef, "/dev/null", "plain");
                        git_diff_print(undef, "/dev/null", $to_id, "b/$file", "plain");
                } elsif ($status eq "D") {
                        git_diff_print($from_id, "a/$file", undef, "/dev/null", "plain");
This page took 0.211401 seconds and 4 git commands to generate.