From: Timo Hirvonen <tihirvon@gmail.com>
To: Junio C Hamano <junkio@cox.net>
Cc: git@vger.kernel.org
Subject: [PATCH] gitweb: Use $hash_base as $search_hash if possible
Date: Tue, 20 Jun 2006 16:41:05 +0300 [thread overview]
Message-ID: <20060620164105.7276a45f.tihirvon@gmail.com> (raw)
In-Reply-To: <7v64iw80uo.fsf@assigned-by-dhcp.cox.net>
$hash (h parameter) does not always point to a commit. Use $hash_base as
$search_hash when it is defined.
Signed-off-by: Timo Hirvonen <tihirvon@gmail.com>
---
Junio C Hamano <junkio@cox.net> wrote:
> Timo Hirvonen <tihirvon@gmail.com> writes:
>
> > Starting search from whatever the current "h" parameter points to is
> > wrong. Sometimes it doesn't give all the expected results or may even
> > fail if h points to an object which is not a commit.
>
> If h is not a commit, perhaps, but wouldn't you expect it to
> find things from "next" branch if "h" points at it?
I did not change it to start search from tip of the branch. The
current behavior is somewhat confusing but at least it is consistent
with rest of gitweb. For example clicking shortlog link from commit
view shows the current commit at top of the list, not tip of the
current branch.
gitweb/gitweb.cgi | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/gitweb/gitweb.cgi b/gitweb/gitweb.cgi
index 78e6dd0..7318512 100755
--- a/gitweb/gitweb.cgi
+++ b/gitweb/gitweb.cgi
@@ -293,7 +293,9 @@ EOF
$searchtext = "";
}
my $search_hash;
- if (defined $hash) {
+ if (defined $hash_base) {
+ $search_hash = $hash_base;
+ } elsif (defined $hash) {
$search_hash = $hash;
} else {
$search_hash = "HEAD";
--
1.4.0.gd281
prev parent reply other threads:[~2006-06-20 13:41 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-06-20 12:25 [PATCH] gitweb: Start search from HEAD Timo Hirvonen
2006-06-20 12:31 ` Junio C Hamano
2006-06-20 13:41 ` Timo Hirvonen [this message]
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=20060620164105.7276a45f.tihirvon@gmail.com \
--to=tihirvon@gmail.com \
--cc=git@vger.kernel.org \
--cc=junkio@cox.net \
/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).