From: Jakub Narebski <jnareb@gmail.com>
To: Petr Baudis <pasky@suse.cz>
Cc: Junio C Hamano <junkio@cox.net>, git@vger.kernel.org
Subject: [PATCH 2/1 (amend)] gitweb: Use fixed string for "next" link in commitdiff view
Date: Tue, 24 Oct 2006 11:04:18 +0200 [thread overview]
Message-ID: <200610241104.18517.jnareb@gmail.com> (raw)
In-Reply-To: <20061023232117.GV20017@pasky.or.cz>
Use fixed string instead of shortened SHA1 identifier of commit
as a name for "mext" link in commitdiff view.
While at it make sure that we don't mistake option for a second
commit.
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
---
gitweb/gitweb.perl | 17 +++++++----------
1 files changed, 7 insertions(+), 10 deletions(-)
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index 4241d5c..9c81214 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -3289,17 +3289,14 @@ sub git_commitdiff {
hash=>$hash, hash_parent=>$hash_parent)},
"raw");
- if (defined $hash_parent) {
+ if (defined $hash_parent && $hash_parent !~ m/^-/) {
# commitdiff with two commits given
- my $hash_parent_short = $hash_parent;
- if ($hash_parent =~ m/^[0-9a-fA-F]{40}$/) {
- $hash_parent_short = substr($hash_parent, 0, 7);
- }
+ # second "commit" is not in fact diff option
$formats_nav .=
- ' (from: ' .
+ ' (' .
$cgi->a({-href => href(action=>"commitdiff",
hash=>$hash_parent)},
- esc_html($hash_parent_short)) .
+ 'from') .
')';
} elsif (!$co{'parent'}) {
# --root commitdiff
@@ -3307,10 +3304,10 @@ sub git_commitdiff {
} elsif (scalar @{$co{'parents'}} == 1) {
# single parent commit
$formats_nav .=
- ' (parent: ' .
+ ' (' .
$cgi->a({-href => href(action=>"commitdiff",
hash=>$co{'parent'})},
- esc_html(substr($co{'parent'}, 0, 7))) .
+ 'parent') .
')';
} else {
# merge commit
@@ -3319,7 +3316,7 @@ sub git_commitdiff {
join(' ', map {
$cgi->a({-href => href(action=>"commitdiff",
hash=>$_)},
- esc_html(substr($_, 0, 7)));
+ 'parent');
} @{$co{'parents'}} ) .
')';
}
--
1.4.2.1
next prev parent reply other threads:[~2006-10-24 9:04 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-10-22 22:37 [PATCH] gitweb: Add "next" link to commitdiff view Jakub Narebski
2006-10-22 22:43 ` Jakub Narebski
2006-10-22 23:16 ` Junio C Hamano
2006-10-22 23:41 ` Jakub Narebski
2006-10-23 22:08 ` [PATCH 2/1] gitweb: Use fixed string for "next" link in " Jakub Narebski
2006-10-23 23:21 ` Petr Baudis
2006-10-24 9:04 ` Jakub Narebski [this message]
2006-10-24 9:17 ` [PATCH 2/1 (amend)] " Junio C Hamano
2006-10-24 9:28 ` Jakub Narebski
2006-10-24 11:49 ` [PATCH 2/1] " Petr Baudis
2006-10-24 11:59 ` Jakub Narebski
2006-10-24 15:27 ` Petr Baudis
2006-10-24 17:17 ` Junio C Hamano
2006-10-24 17:26 ` Petr Baudis
2006-10-24 18:27 ` Junio C Hamano
2006-10-24 18:37 ` Jakub Narebski
2006-10-28 16:10 ` [PATCH] gitweb: Add "next" link to " Jakub Narebski
2006-10-28 19:00 ` Junio C Hamano
2006-10-29 1:50 ` Luben Tuikov
2006-10-29 1:58 ` Jakub Narebski
2006-10-29 2:04 ` Luben Tuikov
2006-10-29 2:10 ` Jakub Narebski
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=200610241104.18517.jnareb@gmail.com \
--to=jnareb@gmail.com \
--cc=git@vger.kernel.org \
--cc=junkio@cox.net \
--cc=pasky@suse.cz \
/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).