git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] gitweb.cgi: Teach tree->raw to not require the hash of the blob

From
Junio C Hamano <junkio@cox.net>
Date
Jul 12, 2006, 06:16 UTC
Message-ID
<7v64i31h6f.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<20060712034345.14009.qmail@web31802.mail.mud.yahoo.com>
Luben Tuikov <ltuikov@yahoo.com> writes:
Show 13 quoted lines
> Teach tree->raw to not require the hash of the blob, but to
> figure it out from the file name.  This allows to externally
> link to files into the repository, such that the hash is not
> required.  I.e. the file obtained would be as of the HEAD
> commit.
>
> In contrast tree->blob for binary files passes the hash, as
> does tree->blob->plain for "text/*" files.
>
> Signed-off-by: Luben Tuikov <ltuikov@yahoo.com>
> ---
>  gitweb/gitweb.cgi |   20 ++++++++++++++++----
>  1 files changed, 16 insertions(+), 4 deletions(-)
This has exactly the same line number problem.
@@ -1678,8 +1690,7 @@ sub git_tree {
 			      $cgi->a({-href => "$my_uri?" . esc...
 #			      " | " . $cgi->a({-href => "$my_uri...
 			      " | " . $cgi->a({-href => "$my_uri...
-			      " | " . $cgi->a({-href => "$my_uri...
+			      " | " . $cgi->a({-href => "$my_uri...
 			      "</td>\n";
 		} elsif ($t_type eq "tree") {
 			print "<td class=\"list\">" .

You are removing one line and adding one line, so the number of
old and new lines better match.

Hand-applied, tried, got confused and dropped.

I think _allowing_ to accept filename not hash is a sane change,
and would be useful if you want to allow linking to always the
HEAD version from external sites, but I do not think listing the
raw link in the tree view without the hash is a good idea.  It
makes things quite confusing that "blob" link in its
neighbourhood gives the blob from that specific version, but
"raw" gives the version from HEAD, even when you are browsing
something other than HEAD.

BTW, can somebody volunteer to be a gitweb/ "subsystem
maintainer"?
Previous: Luben TuikovNext: Jakub Narebski
Message 2 of 7 in “gitweb.cgi: Teach tree->raw to not require the hash of the blob”
  1. gitweb.cgi: Teach tree->raw to not require the hash of the blobLuben Tuikov, Jul 12, 2006
  2. Junio C HamanoJul 12, 2006
  3. Jakub NarebskiJul 12, 2006
  4. Luben TuikovJul 12, 2006
  5. Jakub NarebskiJul 12, 2006
  6. Luben TuikovJul 12, 2006
  7. Junio C HamanoJul 14, 2006

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.