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

Re: [PATCH] gitweb: "raw" links to blobs at HEAD

From
LTLuben Tuikov <ltuikov@yahoo.com>
Date
Sep 26, 2006, 18:53 UTC
Message-ID
<20060926185326.10590.qmail@web31810.mail.mud.yahoo.com>
In-Reply-To
<7v8xk7rup3.fsf@assigned-by-dhcp.cox.net>
--- Junio C Hamano <junkio@cox.net> wrote:
> This does not feel right.  Go to summary view, pick the tree
> link of a non-head commit from the shortlog list, and the raw
> links on the resulting page all say hb=HEAD.
I see your point.
> Doesn't this make clicking the entry itself (blob view) and
> clicking on the raw link (blob-plain view) inconsistent?

It this exactly this consistency which the patch used to de-couple it and use the "raw" to point to HEAD.

> The former goes to the blob from that revision while the latter
> always goes to the HEAD.
Yes, I completely understand the conundrum.
Ideally, hb would equal HEAD from the _context_, but
  1) hb and h != HEAD for any "raw" link,
  2) one can set hb=HEAD in the context only when the "blob page"
     can be loaded, which is impossible for binary blobs.

So the fix would be that, unless the user had selected a hb/h explicitly, set "raw" to HEAD (i.e. by default), but leave the entry with hb/h in SHA. This way, one can take a reference to HEAD or SHA of the head depending on what is needed. And if they had selected a hb/h explicitly then both the entry and the "raw" would point to the SHA.

Such a patch can go on top of those two.
    Luben
Previous: Junio C HamanoNext: Jakub Narebski
Message 3 of 5 in “gitweb: "raw" links to blobs at HEAD”
  1. gitweb: "raw" links to blobs at HEADLuben Tuikov, Sep 26, 2006
  2. Junio C HamanoSep 26, 2006
  3. Luben TuikovSep 26, 2006
  4. Jakub NarebskiSep 26, 2006
  5. Luben TuikovSep 26, 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.