git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCHv2 0/3] gitweb: Dealing with being on unborn branch
@ 2012-02-15 15:36 Jakub Narebski
  2012-02-15 15:36 ` [PATCHv2 1/3] gitweb: Deal with HEAD pointing to unborn branch in "heads" view Jakub Narebski
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Jakub Narebski @ 2012-02-15 15:36 UTC (permalink / raw)
  To: git; +Cc: rajesh boyapati, Junio C Hamano, Jakub Narebski

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

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2012-02-17 14:28 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-15 15:36 [PATCHv2 0/3] gitweb: Dealing with being on unborn branch Jakub Narebski
2012-02-15 15:36 ` [PATCHv2 1/3] gitweb: Deal with HEAD pointing to unborn branch in "heads" view Jakub Narebski
2012-02-16 20:29   ` Junio C Hamano
2012-02-16 22:41     ` Jakub Narebski
2012-02-16 23:28       ` Junio C Hamano
2012-02-17 13:41         ` Jakub Narebski
2012-02-17 14:28           ` Junio C Hamano
2012-02-15 15:36 ` [PATCHv2/RFC 2/3] gitweb: Harden parse_commit and parse_commits Jakub Narebski
2012-02-15 15:36 ` [RFC/PATCHv2 3/3] gitweb: Silence stderr in parse_commit*() subroutines Jakub Narebski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).