3 use namespace::autoclean;
5 use Catalyst::Runtime 5.80;
14 our $VERSION = '0.01';
16 # Bring in the libified gitweb.cgi.
21 default_view => 'Default',
22 default_model => 'Git', # Yes, we are going to be changing this.
23 # Set to 1 to make your fcgi die the request after you push :)
24 exit_at_end_of_request_if_updated => 0,
29 my $get_version = sub {
30 my $gitdir = shift->path_to('.git');
31 my $version = qx{cat "$gitdir/`cut -d' ' -f2 .git/HEAD`"};
36 after setup_finalize => sub {
38 $version = $c->$get_version
39 if $c->config->{exit_at_end_of_request_if_updated};
41 after handle_request => sub {
44 my $new = $c->$get_version;
45 exit 0 unless $new eq $version;
51 # Start the application
54 around uri_for => sub {
55 my ($orig, $c) = (shift, shift);
56 local $c->stash->{current_model}; # FIXME - for zts..
57 my $hash = ref($_[-1]) eq 'HASH' ? pop @_ : {};
58 my $params = Catalyst::Utils::merge_hashes(
59 { p => $hash->{p} || $c->model()->project },
62 (my $uri = $c->$orig(@_, $params))
69 Gitalist - Catalyst based application
73 script/gitalist_server.pl
77 [enter your description here]
81 L<Gitalist::Controller::Root>, L<Catalyst>
83 =head1 AUTHORS AND COPYRIGHT
86 (C) 2009 Venda Ltd and Dan Brook <dbrook@venda.com>
88 Original gitweb.cgi from which this was derived:
89 (C) 2005-2006, Kay Sievers <kay.sievers@vrfy.org>
90 (C) 2005, Christian Gierke
94 FIXME - Is this going to be GPLv2 as per gitweb? If so this is broken..
96 This library is free software. You can redistribute it and/or modify
97 it under the same terms as Perl itself.