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

Re: [PATCH/RFC 4/3] gitweb: SHA-1 in commit log message links to "object" view

From
Junio C Hamano <junkio@cox.net>
Date
Dec 10, 2006, 21:29 UTC
Message-ID
<7vhcw34eyp.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<11657536473295-git-send-email-jnareb@gmail.com>
Jakub Narebski <jnareb@gmail.com> writes:
Show 33 quoted lines
> Instead of checking if explicit SHA-1 in commit log message is sha1 of
> commit and making link to "commit" view, make [fragment of] explicit
> SHA-1 in commit log message link to "object" view.  While at it allow
> to hyperlink also shortened SHA-1, from 8 characters up to full SHA-1,
> instead of requiring full 40 characters of SHA-1.
>
> This makes the following changes:
>
>  * SHA-1 of objects which no longer exists, for example in commit
>    cherry-picked from no longer existing temporary branch, or revert
>    of commit in rebased branch, are no longer marked as such by not
>    being made into hyperlink (and not having default hyperlink view:
>    being underlined among others).  On the other hand it makes gitweb
>    to not write error messages when object is not found to web serwer
>    log; it also moves cost of getting type and SHA-1 validation to
>    when link is clicked, and not only viewed.
>
>  * SHA-1 of other objects: blobs, trees, tags are also hyperlinked
>    and lead to appropriate view (although in the case of tags it is
>    more natural to just use tag name).
>
>  * You can put shortened SHA-1 of commit in the commit message, and it
>    would be hyperlinked; it would be checked on clicking if abbrev is
>    unique.
>
> Signed-off-by: Jakub Narebski <jnareb@gmail.com>
> ---
> This follows the "lazy hyperlink" idea of symbolic link support in the
> "tree" view.
>
> It is an RFC (Requests For Comments) because I'm not sure if it
> wouldn't be better to make dead SHA-1 marked in commit log message,
> instead of finfing it out after clicking...

I am certainly in favor of the approach. Will look at the code later. Thanks.

Previous: Jakub Narebski
Message 12 of 12 in “gitweb: Better symbolic link support in "tree" view”
  1. gitweb: Better symbolic link support in "tree" viewJakub Narebsmi, Dec 4, 2006
  2. Junio C HamanoDec 5, 2006
  3. Jakub NarebskiDec 5, 2006
  4. Junio C HamanoDec 5, 2006
  5. Jakub NarebskiDec 5, 2006
  6. 0/3 gitweb: Better symbolic link support in "tree" viewJakub Narebski, Dec 10, 2006
  7. 0/3 gitweb: Better symbolic link support in "tree" viewJakub Narebski, Dec 10, 2006
  8. 1/3 gitweb: Show target of symbolic link in "tree" viewJakub Narebski, Dec 10, 2006
  9. 2/3 gitweb: Add generic git_object subroutine to display object of any typeJakub Narebski, Dec 10, 2006
  10. 3/3 gitweb: Hyperlink target of symbolic link in "tree" view (if possible)Jakub Narebski, Dec 10, 2006
  11. 4/3 gitweb: SHA-1 in commit log message links to "object" viewJakub Narebski, Dec 10, 2006
  12. Junio C HamanoDec 10, 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.