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

From: Jakub Narebski <[email-masked]>
Date: Mon, 13 Feb 2012 20:12:04 +0100

Junio C Hamano wrote:
> Jakub Narebski <[email-masked]> 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