]> asedeno.scripts.mit.edu Git - git.git/commitdiff
gitweb: Remove git_diff_print subroutine
authorJakub Narebski <jnareb@gmail.com>
Fri, 25 Aug 2006 19:15:27 +0000 (21:15 +0200)
committerJunio C Hamano <junkio@cox.net>
Sat, 26 Aug 2006 02:42:33 +0000 (19:42 -0700)
Remove git_diff_print subroutine, used to print diff in previous
versions of "diff" actions, namely git_commitdiff,
git_commitdiff_plain, git_blobdiff, git_blobdiff_plain.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
gitweb/gitweb.perl

index 11b3fdc178c9a1da5aeab48225bc39fe3d777843..35f0da1ba768193976885b10f6fe81a3e3bdc0a2 100755 (executable)
@@ -1975,77 +1975,6 @@ sub git_heads_body {
        print "</table>\n";
 }
 
-## ----------------------------------------------------------------------
-## functions printing large fragments, format as one of arguments
-
-sub git_diff_print {
-       my $from = shift;
-       my $from_name = shift;
-       my $to = shift;
-       my $to_name = shift;
-       my $format = shift || "html";
-
-       my $from_tmp = "/dev/null";
-       my $to_tmp = "/dev/null";
-       my $pid = $$;
-
-       # create tmp from-file
-       if (defined $from) {
-               $from_tmp = "$git_temp/gitweb_" . $$ . "_from";
-               open my $fd2, "> $from_tmp";
-               open my $fd, "-|", $GIT, "cat-file", "blob", $from;
-               my @file = <$fd>;
-               print $fd2 @file;
-               close $fd2;
-               close $fd;
-       }
-
-       # create tmp to-file
-       if (defined $to) {
-               $to_tmp = "$git_temp/gitweb_" . $$ . "_to";
-               open my $fd2, "> $to_tmp";
-               open my $fd, "-|", $GIT, "cat-file", "blob", $to;
-               my @file = <$fd>;
-               print $fd2 @file;
-               close $fd2;
-               close $fd;
-       }
-
-       open my $fd, "-|", "/usr/bin/diff -u -p -L \'$from_name\' -L \'$to_name\' $from_tmp $to_tmp";
-       if ($format eq "plain") {
-               undef $/;
-               print <$fd>;
-               $/ = "\n";
-       } else {
-               while (my $line = <$fd>) {
-                       chomp $line;
-                       my $char = substr($line, 0, 1);
-                       my $diff_class = "";
-                       if ($char eq '+') {
-                               $diff_class = " add";
-                       } elsif ($char eq "-") {
-                               $diff_class = " rem";
-                       } elsif ($char eq "@") {
-                               $diff_class = " chunk_header";
-                       } elsif ($char eq "\\") {
-                               # skip errors
-                               next;
-                       }
-                       $line = untabify($line);
-                       print "<div class=\"diff$diff_class\">" . esc_html($line) . "</div>\n";
-               }
-       }
-       close $fd;
-
-       if (defined $from) {
-               unlink($from_tmp);
-       }
-       if (defined $to) {
-               unlink($to_tmp);
-       }
-}
-
-
 ## ======================================================================
 ## ======================================================================
 ## actions