git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 2/4] gitweb: bugfix: git_commit and git_commitdiff parents
@ 2006-08-04 22:11 Luben Tuikov
  2006-08-05  0:00 ` Junio C Hamano
  0 siblings, 1 reply; 3+ messages in thread
From: Luben Tuikov @ 2006-08-04 22:11 UTC (permalink / raw)
  To: git

[-- Attachment #1: Type: text/plain, Size: 516 bytes --]

In git_commit() the hash base of $from_id is $parent, not
$hash:
 - If status is "D", then action blob for $from_id wants
   $parent, not $hash.  History needs $parent too.
 - If status is "R", then action blob for $from_id wants
   $parent, not $hash.

In git_commitdiff() the hash base of $from_id is
$hash_parent, not $hash:
 - If status is "D".
 - If status is "M".

Signed-off-by: Luben Tuikov <ltuikov@yahoo.com>
---
 gitweb/gitweb.perl |   16 +++++++++-------
 1 files changed, 9 insertions(+), 7 deletions(-)

[-- Attachment #2: 3952834181-p2.patch --]
[-- Type: application/octet-stream, Size: 3549 bytes --]

diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index 049f27e..69b787f 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -2018,11 +2018,11 @@ sub git_commit {
 			      "<td class=\"link\">" . $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=blob;h=$to_id;hb=$hash;f=$file")}, "blob") . "</td>\n";
 		} elsif ($status eq "D") {
 			print "<td>" .
-			      $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=blob;h=$from_id;hb=$hash;f=$file"), -class => "list"}, esc_html($file)) . "</td>\n" .
+			      $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=blob;h=$from_id;hb=$parent;f=$file"), -class => "list"}, esc_html($file)) . "</td>\n" .
 			      "<td><span class=\"file_status deleted\">[deleted " . file_type($from_mode). "]</span></td>\n" .
 			      "<td class=\"link\">" .
-			      $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=blob;h=$from_id;hb=$hash;f=$file")}, "blob") .
-			      " | " . $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=history;hb=$hash;f=$file")}, "history") .
+			      $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=blob;h=$from_id;hb=$parent;f=$file")}, "blob") .
+			      " | " . $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=history;hb=$parent;f=$file")}, "history") .
 			      "</td>\n"
 		} elsif ($status eq "M" || $status eq "T") {
 			my $mode_chnge = "";
@@ -2064,7 +2064,7 @@ sub git_commit {
 			print "<td>" .
 			      $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=blob;h=$to_id;hb=$hash;f=$to_file"), -class => "list"}, esc_html($to_file)) . "</td>\n" .
 			      "<td><span class=\"file_status moved\">[moved from " .
-			      $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=blob;h=$from_id;hb=$hash;f=$from_file"), -class => "list"}, esc_html($from_file)) .
+			      $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=blob;h=$from_id;hb=$parent;f=$from_file"), -class => "list"}, esc_html($from_file)) .
 			      " with " . (int $similarity) . "% similarity$mode_chng]</span></td>\n" .
 			      "<td class=\"link\">" .
 			      $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=blob;h=$to_id;hb=$hash;f=$to_file")}, "blob");
@@ -2178,15 +2178,17 @@ sub git_commitdiff {
 			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 => "$my_uri?" . esc_param("p=$project;a=blob;h=$from_id;hb=$hash;f=$file")}, $from_id) . "(deleted)" .
+			      $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=blob;h=$from_id;hb=$hash_parent;f=$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 => "$my_uri?" . esc_param("p=$project;a=blob;h=$from_id;hb=$hash;f=$file")}, $from_id) .
+				      file_type($from_mode) . ":" .
+				      $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=blob;h=$from_id;hb=$hash_parent;f=$file")}, $from_id) .
 				      " -> " .
-				      file_type($to_mode) . ":" . $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=blob;h=$to_id;hb=$hash;f=$file")}, $to_id);
+				      file_type($to_mode) . ":" .
+				      $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=blob;h=$to_id;hb=$hash;f=$file")}, $to_id);
 				print "</div>\n";
 				git_diff_print($from_id, "a/$file",  $to_id, "b/$file");
 			}
-- 
1.4.2.rc3.g6df3


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 2/4] gitweb: bugfix: git_commit and git_commitdiff parents
  2006-08-04 22:11 [PATCH 2/4] gitweb: bugfix: git_commit and git_commitdiff parents Luben Tuikov
@ 2006-08-05  0:00 ` Junio C Hamano
  2006-08-05  0:53   ` Luben Tuikov
  0 siblings, 1 reply; 3+ messages in thread
From: Junio C Hamano @ 2006-08-05  0:00 UTC (permalink / raw)
  To: ltuikov; +Cc: git

Luben Tuikov <ltuikov@yahoo.com> writes:

> In git_commit() the hash base of $from_id is $parent, not
> $hash:
>  - If status is "D", then action blob for $from_id wants
>    $parent, not $hash.  History needs $parent too.
>  - If status is "R", then action blob for $from_id wants
>    $parent, not $hash.
>
> In git_commitdiff() the hash base of $from_id is
> $hash_parent, not $hash:
>  - If status is "D".
>  - If status is "M".

... stopped in mid sentence???

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH 2/4] gitweb: bugfix: git_commit and git_commitdiff parents
  2006-08-05  0:00 ` Junio C Hamano
@ 2006-08-05  0:53   ` Luben Tuikov
  0 siblings, 0 replies; 3+ messages in thread
From: Luben Tuikov @ 2006-08-05  0:53 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git

--- Junio C Hamano <junkio@cox.net> wrote:
> Luben Tuikov <ltuikov@yahoo.com> writes:
> 
> > In git_commit() the hash base of $from_id is $parent, not
> > $hash:
> >  - If status is "D", then action blob for $from_id wants
> >    $parent, not $hash.  History needs $parent too.
> >  - If status is "R", then action blob for $from_id wants
> >    $parent, not $hash.
> >
> > In git_commitdiff() the hash base of $from_id is
> > $hash_parent, not $hash:
> >  - If status is "D".
> >  - If status is "M".
> 
> ... stopped in mid sentence???

Sorry.  The meaning is the same as for git_commit() and as
the paragraph text ("In git_commitdiff() the hash base of ...").

   Luben

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2006-08-05  0:54 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-08-04 22:11 [PATCH 2/4] gitweb: bugfix: git_commit and git_commitdiff parents Luben Tuikov
2006-08-05  0:00 ` Junio C Hamano
2006-08-05  0:53   ` Luben Tuikov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).