3 BEGIN { require 5.008006; }
4 use Catalyst::Runtime 5.80;
5 use namespace::autoclean;
17 our $VERSION = '0.000005';
18 $VERSION = eval $VERSION;
22 default_view => 'Default',
23 default_model => 'CollectionOfRepos',
28 around uri_for => sub {
29 my ($orig, $c) = (shift, shift);
30 my $hash = ref($_[-1]) eq 'HASH' ? pop @_ : {};
32 if ($c->stash->{_do_not_mangle_uri_for}) {
36 my $repository_name = $c->stash->{'Repository'} && $c->stash->{'Repository'}->name;
37 $params = Catalyst::Utils::merge_hashes(
38 { p => $hash->{p} || $repository_name },
41 delete $params->{p} unless defined $params->{p} && length $params->{p};
43 my $uri = $c->$orig(@_, $params);
54 Gitalist - A modern git web viewer
58 script/gitalist_server.pl --repo_dir /home/me/code/git
62 As Gitalist follows the usual Perl module format the usual approach
63 for installation should work e.g.
74 You can also check gitalist out from git and run it, in this case you'll additionally
75 need the author modules, but no configuration will be needed as it will default to looking
76 for repositories the directory above the checkout.
80 Gitalist is a web frontend for git repositories based on gitweb.cgi
81 and backed by Catalyst.
85 This project started off as an attempt to port gitweb.cgi to a
86 Catalyst app in a piecemeal fashion. As it turns out, thanks largely
87 to Florian Ragwitz's earlier effort, it was easier to use gitweb.cgi
88 as a template for building a new Catalyst application.
90 =head1 GETTING GITALIST
92 You can install Gitalist from CPAN in the usual way:
96 Alternatively, you can get Gitalist using git.
98 The canonical repository for the master branch is:
100 it://git.shadowcat.co.uk/catagits/Gitalist.git
102 Gitalist is also mirrored to github, and a number of people have active forks
103 with branches and/or new features in the master branch.
105 =head1 INITIAL CONFIGURATION
107 Gitalist is configured using L<Catalyst::Plugin::Configloader>. The supplied sample
108 configuration is in L<Config::General> format, however it is possible to configure
109 Gitalist using other config file formats (such as YAML) if you prefer.
111 =head2 WHEN CHECKING GITALIST OUT OF GIT
113 Gitalist from git includes a minimal C<gitalist_local.conf>, which sets the repository
114 directory to one directory higher than the Gitalist repository.
116 This means that if you check Gitalist out next to your other git checkouts, then starting
117 the demo server needs no parameters at all:
119 Gitalist [master]$ ./script/gitalist_server.pl
120 You can connect to your server at http://localhost:3000
122 =head2 FOR CPAN INSTALLS
124 Gitalist can be supplied with a config file by setting the C<< GITALIST_CONFIG >>
125 environment variable to point to a configuration file.
127 If you install Gitalist from CPAN, a default configuration is installed along with gitalist,
128 which is complete except for a repository directory. You can get a copy of this configuration
131 cp `perl -Ilib -MGitalist -e'print Gitalist->path_to("gitalist.conf")'` gitalist.conf
133 You can then edit this confg, adding a repos_dir path and customising other settings as desired.
135 You can then start the Gitalist demo server by setting C<< GITALIST_CONFIG >>. For example:
137 GITALIST_CONFIG=/usr/local/etc/gitalist.conf gitalist_server.pl
139 Alternatively, if you only want to set a repository directory and are otherwise happy with
140 the default configuration, then you can set the C<< GITALIST_REPOS_DIR >> environment
141 variable, or pass the C<< --repos_dir >> flag to any of the scripts.
143 GITALIST_REPOS_DIR=/home/myuser/code/git gitalist_server.pl
144 gitalist_server.pl --repos_dir home/myuser/code/git
146 The C<< GITALIST_REPOS_DIR >> environment variable will override the repository directory set
147 in configuration, and will itself be overridden by he C<< --repos_dir >> flag.
151 Once you have followed the instructions above to install and configure Gitalist, you may want
152 to run it in a more production facing environment than using the single threaded developement
155 The recommended deployment method for Gitalist is FastCGI, although Gitalist can also be run
156 under mod_perl or as pure perl with L<Catalyst::Engine::PreFork>.
158 Assuming that you have installed Gitalist's dependencies into a L<local::lib>, and you
159 are running from a git checkout, adding a trivial FCGI script as C<script/gitalist.fcgi>
160 (this file is specifically in C<.gitignore> so you can have your own copy):
163 export PERL5LIB=/home/t0m/public_html/Gitalist/lib:/home/t0m/perl5/lib/perl5:$PERL5LIB
164 exec /home/t0m/public_html/Gitalist/script/gitalist_fastcgi.pl
166 This example can be seen live here:
168 http://goatse.co.uk/~bobtfish/Gitalist/script/gitalist.fcgi/
172 Patches are welcome, please feel free to fork on github and send pull requests, send patches
173 from git format-patch to the bug tracker, or host your own copy of gitalist somewhere and
174 ask us to pull from it.
178 Gitalist has an active irc community in C<#gitalist> on irc.perl.org, please feel free to stop
179 by and ask questions, report bugs or installation issues or generally for a chat about where
180 we plan to go with the project.
184 L<Gitalist::Controller::Root>
186 L<Gitalist::Git::Repository>
190 =head1 AUTHORS AND COPYRIGHT
192 Catalyst application:
193 (C) 2009 Venda Ltd and Dan Brook <broq@cpan.org>
194 (C) 2009, Tom Doran <bobtfish@bobtfish.net>
195 (C) 2009, Zac Stevens <zts@cryptocracy.com>
197 Original gitweb.cgi from which this was derived:
198 (C) 2005-2006, Kay Sievers <kay.sievers@vrfy.org>
199 (C) 2005, Christian Gierke
201 Model based on http://github.com/rafl/gitweb
202 (C) 2008, Florian Ragwitz
206 Licensed under GNU GPL v2