git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Luben Tuikov <ltuikov@yahoo.com>
To: git@vger.kernel.org
Subject: [PATCH] gitweb: tree view: hash_base and hash are now context sensitive
Date: Fri, 29 Sep 2006 09:57:43 -0700 (PDT)	[thread overview]
Message-ID: <20060929165743.2810.qmail@web31812.mail.mud.yahoo.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 354 bytes --]

In tree view, by default, hash_base is HEAD and hash is the
entry equivalent.  Else the user had selected a hash_base or
hash, say by clicking on a revision or commit, in which case
those values are used.

Signed-off-by: Luben Tuikov <ltuikov@yahoo.com>
---
 gitweb/gitweb.perl |   18 +++++++++---------
 1 files changed, 9 insertions(+), 9 deletions(-)

[-- Attachment #2: 1207600725-p1.txt --]
[-- Type: text/plain, Size: 1129 bytes --]

diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index be336f6..44991b1 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -1672,9 +1672,9 @@ sub git_print_tree_entry {
 			              "history");
 		}
 		print " | " .
-		      $cgi->a({-href => href(action=>"blob_plain",
-		                             hash=>$t->{'hash'}, file_name=>"$basedir$t->{'name'}")},
-		              "raw");
+			$cgi->a({-href => href(action=>"blob_plain", hash_base=>$hash_base,
+					       file_name=>"$basedir$t->{'name'}")},
+				"raw");
 		print "</td>\n";
 
 	} elsif ($t->{'type'} eq "tree") {
@@ -2745,14 +2745,14 @@ sub git_blob {
 sub git_tree {
 	my $have_snapshot = gitweb_have_snapshot();
 
+	if (!defined $hash_base) {
+		$hash_base = "HEAD";
+	}
 	if (!defined $hash) {
-		$hash = git_get_head_hash($project);
 		if (defined $file_name) {
-			my $base = $hash_base || $hash;
-			$hash = git_get_hash_by_path($base, $file_name, "tree");
-		}
-		if (!defined $hash_base) {
-			$hash_base = $hash;
+			$hash = git_get_hash_by_path($hash_base, $file_name, "tree");
+		} else {
+			$hash = $hash_base;
 		}
 	}
 	$/ = "\0";

             reply	other threads:[~2006-09-29 16:57 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-09-29 16:57 Luben Tuikov [this message]
  -- strict thread matches above, loose matches on Subject: below --
2006-09-26 19:47 [PATCH] gitweb: tree view: hash_base and hash are now context sensitive Luben Tuikov
2006-09-26 20:34 ` Jakub Narebski
2006-09-26 21:17   ` Luben Tuikov
2006-09-27  6:48     ` Junio C Hamano
2006-09-27 22:53       ` Luben Tuikov
2006-09-28 18:52         ` Luben Tuikov
2006-09-29  6:06           ` Junio C Hamano
2006-09-29 16:16             ` Luben Tuikov
2006-09-29 20:35               ` Jakub Narebski
2006-09-29 23:30                 ` Luben Tuikov
2006-10-01 22:27                   ` Jakub Narebski
2006-10-02 19:51                     ` Luben Tuikov

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=20060929165743.2810.qmail@web31812.mail.mud.yahoo.com \
    --to=ltuikov@yahoo.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).