From: Jakub Narębski Date: Tue, 09 Apr 2013 15:25:59 GMT Subject: Re: [PATCH 4/4] gitweb: Fix broken blob action parameters on blob/commitdiff pages Message-ID: <51643307.9090603@gmail.com> In-Reply-To: W dniu 08.04.2013 22:10, Jürgen Kreileder pisze: > Fix broken blob action parameters on blobdiff and commitdiff pages by > explicitly passing variables instead of relying on global ones. Do I understand it correctly that those variables (e.g. $hash variable in git_patchset_body in second chunk below, after this change passed as parameter to format_diff_cc_simplified()) can be filled in then, or at least adjusted correctly? > (The broken parameters on blob links lead to blob pages which show the > blob but with a hash instead of a commit message and have broken > blob_plain (404 - Cannot find file) and tree links (404 - Reading tree > failed)) > > Signed-off-by: Jürgen Kreileder I wonder how we missed this. Does this happen always, or in some specific conditions? Anyway, this change is a good change. Internal subroutines should not use global variables. I hope that in the future we would get rid of most global variables... Acked-by: Jakub Narebski [not tested] > # create note for patch simplified by combined diff > sub format_diff_cc_simplified { > - my ($diffinfo, @parents) = @_; > + my ($diffinfo, $hash, @parents) = @_; > my $result = ''; > > $result .= "
" . [...] > @@ -5404,7 +5405,7 @@ sub git_patchset_body { > > # generate anchor for "patch" links in difftree / whatchanged part > print "
\n" . > - format_diff_cc_simplified($diffinfo, @hash_parents) . > + format_diff_cc_simplified($diffinfo, $hash, @hash_parents) . > "
\n"; # class="patch" > > $patch_number++; > -- Jakub Narębski