Tidy up in preparation for push to github.
Dan Brook [Tue, 25 Aug 2009 12:04:04 +0000 (13:04 +0100)]
Gitalist/script/gitalist_cgi.pl
Gitalist/templates/default.tt2
Gitalist/templates/page_nav.tt2
README [new file with mode: 0644]
gitweb.cgi

index 2ea0bb2..791134f 100755 (executable)
@@ -1,10 +1,4 @@
-#!/home/dbrook/apps/bin/perl
-
-use lib qw(
-       /home/dbrook/.perl-lib
-       /home/dbrook/.perl-lib/i686-linux-thread-multi
-       /home/dbrook/.perl/lib/perl5/i686-linux-thread-multi
-);
+#!/usr/bin/perl
 
 BEGIN { $ENV{CATALYST_ENGINE} ||= 'CGI' }
 
index 280c7eb..55947fe 100644 (file)
@@ -50,7 +50,6 @@
     INCLUDE "page_nav.tt2";
   END;
 %]
-
 [%
 # The output of gitweb.cgi is injected at this point.
 content %]
index 31de625..c3d0e41 100644 (file)
@@ -1,4 +1,4 @@
 <div class="page_nav">
        [% nav_links %]
-       <br/>[% $extra %]<br/>
+       <br/>[% extra %]<br/>
 </div>
diff --git a/README b/README
new file mode 100644 (file)
index 0000000..bfd2b11
--- /dev/null
+++ b/README
@@ -0,0 +1,29 @@
+Gitalist - a transitional project to convert gitweb.cgi to a Catalyst app.
+
+The idea behind this project is to move gitweb.cgi away from a single
+monolithic CGI script and into a modern Catalyst app. Fortunately this is not
+as daunting as it might seem at first as gitweb.cgi follows an MVC type
+structure. Once gitweb.cgi has been suitably Catalysed then it can move from
+being a "this was once gitweb.cgi" to a project of its own (hence the
+"transitional" in the description).
+
+As it stands Gitalist is very much in its infancy and hasn't got far
+beyond a layout template and a single controller. Probably the next step is
+moving an existing action into a new Catalyst action and lay down the code
+to make porting further actions, or writing new ones, as simple as possible.
+After that provide a model based on one of the git modules, either the Git.pm
+that comes with git or Git::PurePerl, and deprecate or port the existing
+gitweb.cgi functions.
+
+DEPENDENCIES
+
+  Catalyst
+  IO::Capture::Stdout;
+
+COPYRIGHT AND LICENCE
+
+Copyright (C) 2009 Venda Ltd
+
+This library is free software; you can redistribute it and/or modify
+it under the same terms as Perl itself, either Perl version 5.8.8 or,
+at your option, any later version of Perl 5 you may have available.
index 6551e1b..5e24701 100755 (executable)
@@ -78,7 +78,7 @@ sub main {
 
        # core git executable to use
        # this can just be "git" if your webserver has a sensible PATH
-       our $GIT = "/home/dbrook/apps/bin/git";
+       our $GIT = "/usr/bin/git";
 
        # absolute fs-path which will be prepended to the project path
        our $projectroot = "/pub/scm";
@@ -91,7 +91,7 @@ sub main {
        our $home_link = $my_uri || "/";
 
        # string of the home link on top of all pages
-       our $home_link_str = "DanB's git repos";
+       our $home_link_str = "Project Gitalist";
 
        # name of your site or organization to appear in page titles
        # replace this with something more descriptive for clearer bookmarks
@@ -430,7 +430,7 @@ sub main {
        if (-e $GITWEB_CONFIG) {
                do $GITWEB_CONFIG;
        } else {
-               our $GITWEB_CONFIG_SYSTEM = $ENV{'GITWEB_CONFIG_SYSTEM'} || '/home/dbrook/dev/gitweb/gitweb.conf';
+               our $GITWEB_CONFIG_SYSTEM = $ENV{'GITWEB_CONFIG_SYSTEM'} || '../../gitweb.conf';
                do $GITWEB_CONFIG_SYSTEM if -e $GITWEB_CONFIG_SYSTEM;
        }
 
@@ -2907,7 +2907,7 @@ sub blob_contenttype {
 ## functions printing HTML: header, footer, error page
 
 sub git_header_html {
-       # XXX I don't these are used here ...
+       # XXX These aren't used, how odd.
        my $status = shift || "200 OK";
        my $expires = shift;
 
@@ -3221,13 +3221,12 @@ sub git_print_header_div {
        $args{'hash'} = $hash if $hash;
        $args{'hash_base'} = $hash_base if $hash_base;
 
-       print "<div class=\"header\">\n" .
+    print q[<div class="header">],
              $cgi->a({-href => href(%args), -class => "title"},
-             $title ? $title : $action) .
-             "\n</div>\n";
+             $title ? $title : $action),
+                 q[</div>];
 }
 
-#sub git_print_authorship (\%) {
 sub git_print_authorship {
        my $co = shift;