git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jakub Narebski <jnareb@gmail.com>
To: git@vger.kernel.org
Cc: rajesh boyapati <boyapatisrajesh@gmail.com>,
	Junio C Hamano <gitster@pobox.com>,
	Jakub Narebski <jnareb@gmail.com>
Subject: [PATCHv2 0/3] gitweb: Dealing with being on unborn branch
Date: Wed, 15 Feb 2012 16:36:40 +0100	[thread overview]
Message-ID: <1329320203-20272-1-git-send-email-jnareb@gmail.com> (raw)

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

             reply	other threads:[~2012-02-15 15:37 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-15 15:36 Jakub Narebski [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1329320203-20272-1-git-send-email-jnareb@gmail.com \
    --to=jnareb@gmail.com \
    --cc=boyapatisrajesh@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).