From: Jakub Narebski <jnareb@gmail.com>
To: git@vger.kernel.org
Cc: Jakub Narebski <jnareb@gmail.com>
Subject: [PATCH 2/6] gitweb: Improve "next" link in commitdiff view
Date: Fri, 08 Jun 2007 13:26:31 +0200 [thread overview]
Message-ID: <20070608112502.3594.68102.stgit@roke.D-201> (raw)
In-Reply-To: <20070608112337.3594.93976.stgit@roke.D-201>
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>
---
This is sort of companion to previous commit, meaning thatI'd like to
see if I came from link to diff to one of parents in a merge commit.
Purely decoration, but I think it is nice.
gitweb/gitweb.perl | 9 ++++++++-
1 files changed, 8 insertions(+), 1 deletions(-)
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index e2d5222..4561d4e 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -4479,7 +4479,14 @@ sub git_commitdiff {
$hash_parent_short = substr($hash_parent, 0, 7);
}
$formats_nav .=
- ' (from: ' .
+ ' (from';
+ for (my $i = 0; $i < @{$co{'parents'}}; $i++) {
+ if ($co{'parents'}[$i] eq $hash_parent) {
+ $formats_nav .= ' parent ' . ($i+1);
+ last;
+ }
+ }
+ $formats_nav .= ': ' .
$cgi->a({-href => href(action=>"commitdiff",
hash=>$hash_parent)},
esc_html($hash_parent_short)) .
next prev parent reply other threads:[~2007-06-08 11:21 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-06-08 11:24 [PATCH 0/6] gitweb: 'commitdiff' view improvements Jakub Narebski
2007-06-08 11:24 ` [PATCH 1/6] gitweb: Provide links to commitdiff to each parent in 'commitdiff' view Jakub Narebski
2007-06-08 11:26 ` Jakub Narebski [this message]
2007-06-08 11:27 ` [PATCH 3/6] gitweb: Split git_patchset_body into separate subroutines Jakub Narebski
2007-06-08 11:29 ` [PATCH 4/6] gitweb: Create special from-file/to-file header for combined diff Jakub Narebski
2007-06-08 11:32 ` [PATCH 5/6] gitweb: Add links to blobdiffs in from-file/to-file header for merges Jakub Narebski
2007-06-08 11:33 ` [PATCH 6/6] gitweb: '--cc' for merges in 'commitdiff' view Jakub Narebski
2007-06-11 0:36 ` [PATCH 0/6] gitweb: 'commitdiff' view improvements Junio C Hamano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20070608112502.3594.68102.stgit@roke.D-201 \
--to=jnareb@gmail.com \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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 NNTP newsgroup(s).