This is resend (as series) of patches that were sent first time individually in "Fwd: Git-web error" thread sent to git mailing list by rajesh boyapati: http://thread.gmane.org/gmane.comp.version-control.git/189228 Unfortunately the thread is heavily fragmented in GMane interface, because Rajesh responses were not sent to git mailing list. The problem that original poster seen was caused by the fact that: rb> For my git projects on gerrit, our main branch name is "base". rb> We don't have any code on "master" branch. [...] rb> [...] the HEAD file is pointing to "ref: refs/heads/master". rb> So, I think that's the reason for errors. Some of errors might appear in the way Rajesh sees them because gitweb in this case is deployed from Gerrit (Git-based review board, in Java); at least I couldn't reproduce some of errors in exactly the same way as presented. Note that there is no problem if repository is totally empty, without any valid branch. The problem is when HEAD doesn't point to the valid commit object, but there are other commits and branches. Anyway beside not using 'master' branch, but not renaming it / repointing HEAD, such situation might happen when you have just created an orphan branch, but haven't made any commits on it yet. Table of contents: ~~~~~~~~~~~~~~~~~~ * [PATCHv2 1/3] gitweb: Deal with HEAD pointing to unborn branch in "heads" view This fixes a real issue, and is a true fix (for current way of generating "heads" view). Note that there is "heads" excerpt in "summary" view. * [PATCHv2/RFC 2/3] gitweb: Harden parse_commit and parse_commits Just add an early exit in the case of invalid parameters. Though if caller is passing undefined value for commit identifier, it would probably not deal correctly with parse_commit() returning undef, though it should deal correctly with parse_commits() returning empty list. More of band-aid than a real fix. * [RFC/PATCHv2 3/3] gitweb: Silence stderr in parse_commit*() subroutines This adds an overhead of forking a shell, and possibility of code injection if our quote_command() is incorrect... and actually does not fix issue for the original poster, and is not a problem for ordinary (non-Gerrit) gitweb. Shortlog: ~~~~~~~~~ Jakub Narebski (3): gitweb: Deal with HEAD pointing to unborn branch in "heads" view gitweb: Harden parse_commit and parse_commits gitweb: Silence stderr in parse_commit*() subroutines Diffstat: ~~~~~~~~~ gitweb/gitweb.perl | 21 ++++++++++++++------- t/t9500-gitweb-standalone-no-errors.sh | 9 +++++++++ 2 files changed, 23 insertions(+), 7 deletions(-) -- 1.7.9 -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html