{"thread":{"id":"5135","subject":"[PATCH 2/4] gitweb: bugfix: git_commit and git_commitdiff parents","startedAt":"2006-08-04T22:11:47Z","lastAt":"2006-08-05T00:53:55Z","messageCount":3,"participants":["Luben Tuikov","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":4},"messages":[{"id":"24764","messageId":"20060804221147.18778.qmail@web31801.mail.mud.yahoo.com","threadId":"5135","inReplyTo":null,"subject":"[PATCH 2/4] gitweb: bugfix: git_commit and git_commitdiff parents","fromName":"Luben Tuikov","fromEmail":"ltuikov@yahoo.com","sentAt":"2006-08-04T22:11:47Z","receivedAt":"2006-08-04T22:11:47Z","isPatch":true,"sender":{"key":"ltuikov@yahoo.com","avatar":null},"body":"In git_commit() the hash base of $from_id is $parent, not\n$hash:\n - If status is \"D\", then action blob for $from_id wants\n   $parent, not $hash.  History needs $parent too.\n - If status is \"R\", then action blob for $from_id wants\n   $parent, not $hash.\n\nIn git_commitdiff() the hash base of $from_id is\n$hash_parent, not $hash:\n - If status is \"D\".\n - If status is \"M\".\n\nSigned-off-by: Luben Tuikov <ltuikov@yahoo.com>\n---\n gitweb/gitweb.perl |   16 +++++++++-------\n 1 files changed, 9 insertions(+), 7 deletions(-)\n\ndiff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl\nindex 049f27e..69b787f 100755\n--- a/gitweb/gitweb.perl\n+++ b/gitweb/gitweb.perl\n@@ -2018,11 +2018,11 @@ sub git_commit {\n \t\t\t      \"<td class=\\\"link\\\">\" . $cgi->a({-href => \"$my_uri?\" . esc_param(\"p=$project;a=blob;h=$to_id;hb=$hash;f=$file\")}, \"blob\") . \"</td>\\n\";\n \t\t} elsif ($status eq \"D\") {\n \t\t\tprint \"<td>\" .\n-\t\t\t      $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\" .\n+\t\t\t      $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\" .\n \t\t\t      \"<td><span class=\\\"file_status deleted\\\">[deleted \" . file_type($from_mode). \"]</span></td>\\n\" .\n \t\t\t      \"<td class=\\\"link\\\">\" .\n-\t\t\t      $cgi->a({-href => \"$my_uri?\" . esc_param(\"p=$project;a=blob;h=$from_id;hb=$hash;f=$file\")}, \"blob\") .\n-\t\t\t      \" | \" . $cgi->a({-href => \"$my_uri?\" . esc_param(\"p=$project;a=history;hb=$hash;f=$file\")}, \"history\") .\n+\t\t\t      $cgi->a({-href => \"$my_uri?\" . esc_param(\"p=$project;a=blob;h=$from_id;hb=$parent;f=$file\")}, \"blob\") .\n+\t\t\t      \" | \" . $cgi->a({-href => \"$my_uri?\" . esc_param(\"p=$project;a=history;hb=$parent;f=$file\")}, \"history\") .\n \t\t\t      \"</td>\\n\"\n \t\t} elsif ($status eq \"M\" || $status eq \"T\") {\n \t\t\tmy $mode_chnge = \"\";\n@@ -2064,7 +2064,7 @@ sub git_commit {\n \t\t\tprint \"<td>\" .\n \t\t\t      $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\" .\n \t\t\t      \"<td><span class=\\\"file_status moved\\\">[moved from \" .\n-\t\t\t      $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)) .\n+\t\t\t      $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)) .\n \t\t\t      \" with \" . (int $similarity) . \"% similarity$mode_chng]</span></td>\\n\" .\n \t\t\t      \"<td class=\\\"link\\\">\" .\n \t\t\t      $cgi->a({-href => \"$my_uri?\" . esc_param(\"p=$project;a=blob;h=$to_id;hb=$hash;f=$to_file\")}, \"blob\");\n@@ -2178,15 +2178,17 @@ sub git_commitdiff {\n \t\t\tgit_diff_print(undef, \"/dev/null\", $to_id, \"b/$file\");\n \t\t} elsif ($status eq \"D\") {\n \t\t\tprint \"<div class=\\\"diff_info\\\">\" . file_type($from_mode) . \":\" .\n-\t\t\t      $cgi->a({-href => \"$my_uri?\" . esc_param(\"p=$project;a=blob;h=$from_id;hb=$hash;f=$file\")}, $from_id) . \"(deleted)\" .\n+\t\t\t      $cgi->a({-href => \"$my_uri?\" . esc_param(\"p=$project;a=blob;h=$from_id;hb=$hash_parent;f=$file\")}, $from_id) . \"(deleted)\" .\n \t\t\t      \"</div>\\n\";\n \t\t\tgit_diff_print($from_id, \"a/$file\", undef, \"/dev/null\");\n \t\t} elsif ($status eq \"M\") {\n \t\t\tif ($from_id ne $to_id) {\n \t\t\t\tprint \"<div class=\\\"diff_info\\\">\" .\n-\t\t\t\t      file_type($from_mode) . \":\" . $cgi->a({-href => \"$my_uri?\" . esc_param(\"p=$project;a=blob;h=$from_id;hb=$hash;f=$file\")}, $from_id) .\n+\t\t\t\t      file_type($from_mode) . \":\" .\n+\t\t\t\t      $cgi->a({-href => \"$my_uri?\" . esc_param(\"p=$project;a=blob;h=$from_id;hb=$hash_parent;f=$file\")}, $from_id) .\n \t\t\t\t      \" -> \" .\n-\t\t\t\t      file_type($to_mode) . \":\" . $cgi->a({-href => \"$my_uri?\" . esc_param(\"p=$project;a=blob;h=$to_id;hb=$hash;f=$file\")}, $to_id);\n+\t\t\t\t      file_type($to_mode) . \":\" .\n+\t\t\t\t      $cgi->a({-href => \"$my_uri?\" . esc_param(\"p=$project;a=blob;h=$to_id;hb=$hash;f=$file\")}, $to_id);\n \t\t\t\tprint \"</div>\\n\";\n \t\t\t\tgit_diff_print($from_id, \"a/$file\",  $to_id, \"b/$file\");\n \t\t\t}\n-- \n1.4.2.rc3.g6df3\n\n"},{"id":"24779","messageId":"7vzmekgigm.fsf@assigned-by-dhcp.cox.net","threadId":"5135","inReplyTo":"20060804221147.18778.qmail@web31801.mail.mud.yahoo.com","subject":"Re: [PATCH 2/4] gitweb: bugfix: git_commit and git_commitdiff parents","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-08-05T00:00:09Z","receivedAt":"2006-08-05T00:00:09Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Luben Tuikov <ltuikov@yahoo.com> writes:\n\n> In git_commit() the hash base of $from_id is $parent, not\n> $hash:\n>  - If status is \"D\", then action blob for $from_id wants\n>    $parent, not $hash.  History needs $parent too.\n>  - If status is \"R\", then action blob for $from_id wants\n>    $parent, not $hash.\n>\n> In git_commitdiff() the hash base of $from_id is\n> $hash_parent, not $hash:\n>  - If status is \"D\".\n>  - If status is \"M\".\n\n... stopped in mid sentence???\n"},{"id":"24785","messageId":"20060805005355.41970.qmail@web31805.mail.mud.yahoo.com","threadId":"5135","inReplyTo":"7vzmekgigm.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH 2/4] gitweb: bugfix: git_commit and git_commitdiff parents","fromName":"Luben Tuikov","fromEmail":"ltuikov@yahoo.com","sentAt":"2006-08-05T00:53:55Z","receivedAt":"2006-08-05T00:53:55Z","isPatch":true,"sender":{"key":"ltuikov@yahoo.com","avatar":null},"body":"--- Junio C Hamano <junkio@cox.net> wrote:\n> Luben Tuikov <ltuikov@yahoo.com> writes:\n> \n> > In git_commit() the hash base of $from_id is $parent, not\n> > $hash:\n> >  - If status is \"D\", then action blob for $from_id wants\n> >    $parent, not $hash.  History needs $parent too.\n> >  - If status is \"R\", then action blob for $from_id wants\n> >    $parent, not $hash.\n> >\n> > In git_commitdiff() the hash base of $from_id is\n> > $hash_parent, not $hash:\n> >  - If status is \"D\".\n> >  - If status is \"M\".\n> \n> ... stopped in mid sentence???\n\nSorry.  The meaning is the same as for git_commit() and as\nthe paragraph text (\"In git_commitdiff() the hash base of ...\").\n\n   Luben\n"}]}