gitweb: Improve "next" link in commitdiff view
Check if 'hp' (hash_parent) parameter to 'commitdiff' view is one of 'h' (hash) commit parents, i.e. if commitdiff is of the form "<commit>^<n> <commit>", and mark it as such in the bottom part of navigation bar. The "next" link in commitdiff view was introduced in commit 151602df00b8e5c5b4a8193f59a94b85f9b5aebc If 'hb' is n-th parent of 'h', show the following at the bottom of navigation bar: (from parent n: _commit_) Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Jakub Narebski committed
Jun 8, 2007 at 13:26 UTC
ada3e1f7334b19c98688bcbd7a24d6b559173dfa
1 file changed
+8
-1
gitweb/gitweb.perl
+8
-1
@@ -4479,7 +4479,14 @@ sub git_commitdiff {
4479
$hash_parent_short = substr($hash_parent, 0, 7);
4480
}
4481
$formats_nav .=
4482
- ' (from: ' .
4482
+ ' (from';
4483
+ for (my $i = 0; $i < @{$co{'parents'}}; $i++) {
4484
+ if ($co{'parents'}[$i] eq $hash_parent) {
4485
+ $formats_nav .= ' parent ' . ($i+1);
4486
+ last;
4487
+ }
4488
+ }
4489
+ $formats_nav .= ': ' .
4490
$cgi->a({-href => href(action=>"commitdiff",
4491
hash=>$hash_parent)},
4492
esc_html($hash_parent_short)) .