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

Re: [PATCH] gitweb: Silence stderr in parse_commit*() subroutines

From
Jakub Narebski <jnareb@gmail.com>
Date
Feb 13, 2012, 19:12 UTC
Message-ID
<201202132012.04721.jnareb@gmail.com>
In-Reply-To
<7vmx8mfu8k.fsf@alter.siamese.dyndns.org>
Junio C Hamano wrote:
Show 10 quoted lines
> Jakub Narebski <jnareb@gmail.com> writes:
> 
> > Anyway, here is the patch that should fix those "CGI: fatal: Not a valid
> > object name HEAD" errors for you.
> 
> I have to wonder if it is simpler and less error prone to check HEAD
> before doing anything else immediately after which repository is being
> consulted, and give the same "no history at all yet in this project" page
> for most if not all operations, instead of patching things up at this deep
> in the callchain.

Actually the problem is that there is history (there are other branches), but HEAD points to unborn (unused) 'master' branch.

But you are right that we should fix underlying issue with invalid assumption which gitweb uses, that HEAD points to a valid commit if repository is non-empty.

Though I think leaving safety of 2nd patch could be a good idea anyway. And 1st patch fixes a real issue, and does not only provide band-aid.

P.S. I will resend those three patches as patch series for easier review, so they are not tangled in this deep thread. They should be in 'gitweb/web' branch in my public forks of git repository on repo.or.cz and github.

-- 
Jakub Narebski
Poland
Previous: Junio C HamanoNext: Jakub Narebski
Message 11 of 14 in “Fwd: Git-web error”
  1. rajesh boyapatiJan 27, 2012
  2. Jakub NarebskiJan 27, 2012
  3. Jakub NarebskiJan 29, 2012
  4. Jakub NarebskiJan 30, 2012
  5. gitweb: Deal with HEAD pointing to unborn branch in "heads" viewJakub Narebski, Feb 3, 2012
  6. Jakub NarebskiFeb 7, 2012
  7. gitweb: Harden parse_commit and parse_commitsJakub Narebski, Feb 8, 2012
  8. Jakub NarebskiFeb 9, 2012
  9. gitweb: Silence stderr in parse_commit*() subroutinesJakub Narebski, Feb 11, 2012
  10. Junio C HamanoFeb 13, 2012
  11. Jakub NarebskiFeb 13, 2012
  12. Jakub NarebskiFeb 13, 2012
  13. Jakub NarebskiFeb 13, 2012
  14. Jakub NarebskiFeb 15, 2012

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.