* [PATCH 1/5] gitweb: Remove parse_from_to_diffinfo code from git_patchset_body
@ 2007-09-21 21:35 Jakub Narebski
0 siblings, 0 replies; only message in thread
From: Jakub Narebski @ 2007-09-21 21:35 UTC (permalink / raw)
To: git
[-- Attachment #1: Type: text/plain, Size: 704 bytes --]
In commit 90921740bd00029708370673fdc537522aa48e6f
"gitweb: Split git_patchset_body into separate subroutines"
a part of git_patchset_body code was separated into parse_from_to_diffinfo
subroutine. But instead of replacing the separated code by the call to
mentioned subroutine, the call to subroutine was placed before the separated
code. This patch removes parse_from_to_diffinfo code from git_patchset_body
subroutine.
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
---
My bad...
I hope the explanation is clean enough. It does make reading
git_patchset_body code much easier.
gitweb/gitweb.perl | 36 +-----------------------------------
1 files changed, 1 insertions(+), 35 deletions(-)
[-- Attachment #2: 0001-gitweb-Remove-parse_from_to_diffinfo-code-from-git_.patch --]
[-- Type: application/octet-stream, Size: 2986 bytes --]
From 5016a1968b651ca971968f917e22dd7ce988e23d Mon Sep 17 00:00:00 2001
From: Jakub Narebski <jnareb@gmail.com>
Date: Sat, 8 Sep 2007 21:49:11 +0200
Subject: [PATCH 1/5] gitweb: Remove parse_from_to_diffinfo code from git_patchset_body
In commit 90921740bd00029708370673fdc537522aa48e6f
"gitweb: Split git_patchset_body into separate subroutines"
a part of git_patchset_body code was separated into parse_from_to_diffinfo
subroutine. But instead of replacing the separated code by the call to
mentioned subroutine, the call to subroutine was placed before the separated
code. This patch removes parse_from_to_diffinfo code from git_patchset_body
subroutine.
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
---
My bad...
I hope the explanation is clean enough. It does make reading
git_patchset_body code much easier.
gitweb/gitweb.perl | 36 +-----------------------------------
1 files changed, 1 insertions(+), 35 deletions(-)
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index b2bae1b..c18339f 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -3191,44 +3191,10 @@ sub git_patchset_body {
}
} until (!defined $to_name || $to_name eq $diffinfo->{'to_file'} ||
$patch_idx > $#$difftree);
+
# modifies %from, %to hashes
parse_from_to_diffinfo($diffinfo, \%from, \%to, @hash_parents);
- if ($diffinfo->{'nparents'}) {
- # combined diff
- $from{'file'} = [];
- $from{'href'} = [];
- fill_from_file_info($diffinfo, @hash_parents)
- unless exists $diffinfo->{'from_file'};
- for (my $i = 0; $i < $diffinfo->{'nparents'}; $i++) {
- $from{'file'}[$i] = $diffinfo->{'from_file'}[$i] || $diffinfo->{'to_file'};
- if ($diffinfo->{'status'}[$i] ne "A") { # not new (added) file
- $from{'href'}[$i] = href(action=>"blob",
- hash_base=>$hash_parents[$i],
- hash=>$diffinfo->{'from_id'}[$i],
- file_name=>$from{'file'}[$i]);
- } else {
- $from{'href'}[$i] = undef;
- }
- }
- } else {
- $from{'file'} = $diffinfo->{'from_file'} || $diffinfo->{'file'};
- if ($diffinfo->{'status'} ne "A") { # not new (added) file
- $from{'href'} = href(action=>"blob", hash_base=>$hash_parent,
- hash=>$diffinfo->{'from_id'},
- file_name=>$from{'file'});
- } else {
- delete $from{'href'};
- }
- }
- $to{'file'} = $diffinfo->{'to_file'} || $diffinfo->{'file'};
- if (!is_deleted($diffinfo)) { # file exists in result
- $to{'href'} = href(action=>"blob", hash_base=>$hash,
- hash=>$diffinfo->{'to_id'},
- file_name=>$to{'file'});
- } else {
- delete $to{'href'};
- }
# this is first patch for raw difftree line with $patch_idx index
# we index @$difftree array from 0, but number patches from 1
print "<div class=\"patch\" id=\"patch". ($patch_idx+1) ."\">\n";
--
1.5.3
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2007-09-21 21:35 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-09-21 21:35 [PATCH 1/5] gitweb: Remove parse_from_to_diffinfo code from git_patchset_body Jakub Narebski
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
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 read-only IMAP folder(s) and NNTP newsgroup(s).