git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] gitweb: "raw" links to blobs at HEAD
@ 2006-09-26  5:39 Luben Tuikov
  2006-09-26  6:46 ` Junio C Hamano
  2006-09-26  8:58 ` Jakub Narebski
  0 siblings, 2 replies; 5+ messages in thread
From: Luben Tuikov @ 2006-09-26  5:39 UTC (permalink / raw)
  To: git

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

Currently there is no HTML interface which references (or
can be externally referenced) to yield a _binary_ blob at
HEAD.  There is one for non-binary blobs, but none for
binary ones.

The reason is that "blob"/entry itself for non-binary
entries gives you the "Blob page" where you can click on
last link of the page path, but clicking on the binary
entry/"blob" gives you the raw file.

Binary blobs:
  Since "raw" == the entry itself, we can eliminate this
redundancy and set "raw" to the binary blob at HEAD. This
patch implements that.  If the user wants the binary blob at
hash/hash_base then they can click on the entry itself.

Non-binary blobs:
  With this patch "raw" yields the HEAD revision as per the
above comment for binary blobs.  If the raw output of the
hash/hash_base blob is required the user can click on the entry
(same as for binary only) and then click on "raw" (which
used to be named "plain" not so long ago) or last entry of
"page" path.

Compare the "raw" link for non-binary blobs from tree view,
to the alternative to getting it: click on entry->HEAD->last
entry of "page" path.

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

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 1908141687-p2.txt --]
[-- Type: text/inline; name="p2.txt", Size: 610 bytes --]

diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index c7ab3b6..959e3f9 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -1625,9 +1625,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=>"HEAD",
+					       file_name=>"$basedir$t->{'name'}")},
+				"raw");
 		print "</td>\n";
 
 	} elsif ($t->{'type'} eq "tree") {
-- 
1.4.2.1.gdbbb

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2006-09-26 20:20 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-09-26  5:39 [PATCH] gitweb: "raw" links to blobs at HEAD Luben Tuikov
2006-09-26  6:46 ` Junio C Hamano
2006-09-26 18:53   ` Luben Tuikov
2006-09-26  8:58 ` Jakub Narebski
2006-09-26 20:20   ` Luben Tuikov

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).