Re: cgit, invalid branches, and HTTP error code
- From: Owen Taylor <otaylor redhat com>
- To: Frederic Peters <fpeters gnome org>
- Cc: gnome-infrastructure gnome org
- Subject: Re: cgit, invalid branches, and HTTP error code
- Date: Thu, 16 Apr 2009 09:35:15 -0400
On Thu, 2009-04-16 at 08:53 +0200, Frederic Peters wrote:
> Hello,
>
> JHBuild has a script that pass over every modules, checking if they
> have branched for the stable release; it is currently really trivial,
> it checks that http://svn.gnome.org/svn/$modulename/branches/$branchname
> exists (ie doesn't return a 404), and voila.
>
> I was updating it for git, but
> http://git.gnome.org/cgit/glib/log/?h=glib-2-10
> http://git.gnome.org/cgit/glib/log/?h=foobar
> both return with HTTP 200.
>
> Could it be changed so that it fails with HTTP 404 ?
Hmm, cgit isn't *really* meant as a programmatic web interface to git.
You can use 'git ls-remote' to check for existence. In shell:
git ls-remote git://git.gnome.org/gtk+ refs/heads/$branchname | \
grep -q . && echo "Branch exists"
I'll forward your request to Lars though - it does make sense.
- Owen
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]