{"thread":{"id":"9966","subject":"[PATCH 1/5] gitweb: Remove parse_from_to_diffinfo code from git_patchset_body","startedAt":"2007-09-21T21:35:04Z","lastAt":"2007-09-21T21:35:04Z","messageCount":1,"participants":["Jakub Narebski"],"isPatch":true,"patchVersion":1,"patchTotal":5},"messages":[{"id":"53754","messageId":"8fe92b430709211435x4ac974bg9e938e26310ce9ff@mail.gmail.com","threadId":"9966","inReplyTo":null,"subject":"[PATCH 1/5] gitweb: Remove parse_from_to_diffinfo code from git_patchset_body","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2007-09-21T21:35:04Z","receivedAt":"2007-09-21T21:35:04Z","isPatch":true,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"In commit 90921740bd00029708370673fdc537522aa48e6f\n  \"gitweb: Split git_patchset_body into separate subroutines\"\na part of git_patchset_body code was separated into parse_from_to_diffinfo\nsubroutine.  But instead of replacing the separated code by the call to\nmentioned subroutine, the call to subroutine was placed before the separated\ncode.  This patch removes parse_from_to_diffinfo code from git_patchset_body\nsubroutine.\n\nSigned-off-by: Jakub Narebski <jnareb@gmail.com>\n---\nMy bad...\n\nI hope the explanation is clean enough. It does make reading\ngit_patchset_body code much easier.\n\n gitweb/gitweb.perl |   36 +-----------------------------------\n 1 files changed, 1 insertions(+), 35 deletions(-)\n\n\nFrom 5016a1968b651ca971968f917e22dd7ce988e23d Mon Sep 17 00:00:00 2001\nFrom: Jakub Narebski <jnareb@gmail.com>\nDate: Sat, 8 Sep 2007 21:49:11 +0200\nSubject: [PATCH 1/5] gitweb: Remove parse_from_to_diffinfo code from git_patchset_body\n\nIn commit 90921740bd00029708370673fdc537522aa48e6f\n  \"gitweb: Split git_patchset_body into separate subroutines\"\na part of git_patchset_body code was separated into parse_from_to_diffinfo\nsubroutine.  But instead of replacing the separated code by the call to\nmentioned subroutine, the call to subroutine was placed before the separated\ncode.  This patch removes parse_from_to_diffinfo code from git_patchset_body\nsubroutine.\n\nSigned-off-by: Jakub Narebski <jnareb@gmail.com>\n---\nMy bad...\n\nI hope the explanation is clean enough. It does make reading\ngit_patchset_body code much easier.\n\n gitweb/gitweb.perl |   36 +-----------------------------------\n 1 files changed, 1 insertions(+), 35 deletions(-)\n\ndiff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl\nindex b2bae1b..c18339f 100755\n--- a/gitweb/gitweb.perl\n+++ b/gitweb/gitweb.perl\n@@ -3191,44 +3191,10 @@ sub git_patchset_body {\n \t\t\t\t}\n \t\t\t} until (!defined $to_name || $to_name eq $diffinfo->{'to_file'} ||\n \t\t\t         $patch_idx > $#$difftree);\n+\n \t\t\t# modifies %from, %to hashes\n \t\t\tparse_from_to_diffinfo($diffinfo, \\%from, \\%to, @hash_parents);\n-\t\t\tif ($diffinfo->{'nparents'}) {\n-\t\t\t\t# combined diff\n-\t\t\t\t$from{'file'} = [];\n-\t\t\t\t$from{'href'} = [];\n-\t\t\t\tfill_from_file_info($diffinfo, @hash_parents)\n-\t\t\t\t\tunless exists $diffinfo->{'from_file'};\n-\t\t\t\tfor (my $i = 0; $i < $diffinfo->{'nparents'}; $i++) {\n-\t\t\t\t\t$from{'file'}[$i] = $diffinfo->{'from_file'}[$i] || $diffinfo->{'to_file'};\n-\t\t\t\t\tif ($diffinfo->{'status'}[$i] ne \"A\") { # not new (added) file\n-\t\t\t\t\t\t$from{'href'}[$i] = href(action=>\"blob\",\n-\t\t\t\t\t\t                         hash_base=>$hash_parents[$i],\n-\t\t\t\t\t\t                         hash=>$diffinfo->{'from_id'}[$i],\n-\t\t\t\t\t\t                         file_name=>$from{'file'}[$i]);\n-\t\t\t\t\t} else {\n-\t\t\t\t\t\t$from{'href'}[$i] = undef;\n-\t\t\t\t\t}\n-\t\t\t\t}\n-\t\t\t} else {\n-\t\t\t\t$from{'file'} = $diffinfo->{'from_file'} || $diffinfo->{'file'};\n-\t\t\t\tif ($diffinfo->{'status'} ne \"A\") { # not new (added) file\n-\t\t\t\t\t$from{'href'} = href(action=>\"blob\", hash_base=>$hash_parent,\n-\t\t\t\t\t                     hash=>$diffinfo->{'from_id'},\n-\t\t\t\t\t                     file_name=>$from{'file'});\n-\t\t\t\t} else {\n-\t\t\t\t\tdelete $from{'href'};\n-\t\t\t\t}\n-\t\t\t}\n \n-\t\t\t$to{'file'} = $diffinfo->{'to_file'} || $diffinfo->{'file'};\n-\t\t\tif (!is_deleted($diffinfo)) { # file exists in result\n-\t\t\t\t$to{'href'} = href(action=>\"blob\", hash_base=>$hash,\n-\t\t\t\t                   hash=>$diffinfo->{'to_id'},\n-\t\t\t\t                   file_name=>$to{'file'});\n-\t\t\t} else {\n-\t\t\t\tdelete $to{'href'};\n-\t\t\t}\n \t\t\t# this is first patch for raw difftree line with $patch_idx index\n \t\t\t# we index @$difftree array from 0, but number patches from 1\n \t\t\tprint \"<div class=\\\"patch\\\" id=\\\"patch\". ($patch_idx+1) .\"\\\">\\n\";\n-- \n1.5.3\n\n"}]}