This file documents the revision history for Perl extension Gitalist.
-0.000006 2010-04-10
+0.001001 2010-04-15
+ - Bumping version number to a format I understand, thanks to mst for
+ pointing me in the right direction and t0m for the new number.
+ - Cleaned up the search results - removed search from the homepage as
+ wasn't working (Foxtons).
+ - Provide a link for an atom entry. switch mode=xml to type=xhtml (Brian
+ Cassidy).
+
+0.000006.1 2010-04-14
+ - Documentation fixes for the --repo-dir flag (Dagfinn Ilmari Mannsåker).
+0.000006 2010-04-10
- Major frontend redesign, thanks to ranguard and the web designers at
Foxtons for making this happen.
- Major URI overhaul, Gitalist has gone from old gitweb style CGI
requires 'Sub::Exporter';
requires 'Syntax::Highlight::Engine::Kate';
requires 'Sys::Hostname';
+requires 'XML::OPML::SimpleGen';
+requires 'XML::Atom::Feed';
+requires 'XML::RSS';
test_requires 'Test::More' => '0.88';
test_requires 'Test::utf8' => '0.02';
cp `perl -Ilib -MGitalist -e'print Gitalist->path_to("gitalist.conf")'` gitalist.conf
- You can then edit this confg, adding a repos_dir path and customising
+ You can then edit this confg, adding a repo_dir path and customising
other settings as desired.
You can then start the Gitalist demo server by setting
Alternatively, if you only want to set a repository directory and are
otherwise happy with the default configuration, then you can set the
- "GITALIST_REPO_DIR" environment variable, or pass the "--repos_dir" flag
+ "GITALIST_REPO_DIR" environment variable, or pass the "--repo_dir" flag
to any of the scripts.
GITALIST_REPO_DIR=/home/myuser/code/git gitalist_server.pl
- gitalist_server.pl --repos_dir home/myuser/code/git
+ gitalist_server.pl --repo_dir home/myuser/code/git
The "GITALIST_REPO_DIR" environment variable will override the
repository directory set in configuration, and will itself be overridden
- by he "--repos_dir" flag.
+ by he "--repo_dir" flag.
RUNNING
Once you have followed the instructions above to install and configure
SubRequest
/;
-our $VERSION = '0.000006';
+our $VERSION = '0.001001';
$VERSION = eval $VERSION;
__PACKAGE__->config(
cp `perl -Ilib -MGitalist -e'print Gitalist->path_to("gitalist.conf")'` gitalist.conf
-You can then edit this confg, adding a repos_dir path and customising other settings as desired.
+You can then edit this confg, adding a repo_dir path and customising other settings as desired.
You can then start the Gitalist demo server by setting C<< GITALIST_CONFIG >>. For example:
Alternatively, if you only want to set a repository directory and are otherwise happy with
the default configuration, then you can set the C<< GITALIST_REPO_DIR >> environment
-variable, or pass the C<< --repos_dir >> flag to any of the scripts.
+variable, or pass the C<< --repo_dir >> flag to any of the scripts.
GITALIST_REPO_DIR=/home/myuser/code/git gitalist_server.pl
- gitalist_server.pl --repos_dir home/myuser/code/git
+ gitalist_server.pl --repo_dir home/myuser/code/git
The C<< GITALIST_REPO_DIR >> environment variable will override the repository directory set
-in configuration, and will itself be overridden by he C<< --repos_dir >> flag.
+in configuration, and will itself be overridden by he C<< --repo_dir >> flag.
=head1 RUNNING
# XXX Hack hack hack, see View::SyntaxHighlight
language => ($c->stash->{filename} =~ /\.p[lm]$/i ? 'Perl' : ''),
is_image => File::Type::WebImages::mime_type($c->stash->{blob}),
- is_binary => -B $c->stash->{blob},
+ is_binary => Gitalist::Utils::is_binary($c->stash->{blob}),
);
$c->forward('View::SyntaxHighlight')
my ($self, $c) = @_;
$c->forward('find_blob');
- if(-T $c->stash->{blob}) {
+ if(!Gitalist::Utils::is_binary($c->stash->{blob})) {
$c->response->content_type('text/plain; charset=utf-8');
} else {
my $ft = File::Type->new();
if !$sha1 || $sha1 !~ $SHA1RE;
my @search_opts;
- if ($search) {
+ if ($search and exists $search->{text}) {
$search->{type} = 'grep'
if $search->{type} eq 'commit';
@search_opts = (
return $age_str;
}
+sub is_binary {
+ my($str) = @_;
+ open my $fh, '<', \$str or return;
+ return -B $fh;
+}
+
1;
__END__
=head2 age_string
-Turns an integer number of seconds into a string..
+Turns an integer number of seconds into a string.
+
+=head2 is_binary
+
+Check whether a string is binary according to C<-B>.
=head1 AUTHORS
-[%- IF language %]<link rel="stylesheet" type="text/css" href="[% c.uri_for('/static/css/syntax/' _ language _ '.css') %]"/>[% END -%]
+[%- IF language == 'Diff' %]<link rel="stylesheet" type="text/css" href="[% c.uri_for('/static/css/syntax/Diff.css') %]"/>[% END -%]
+[%- IF language == 'Perl' %]<link rel="stylesheet" type="text/css" href="[% c.uri_for('/static/css/syntax/Perl.css') %]"/>[% END -%]
<entry>
<title>[% Commit.title | html_entity %]</title>
<id>[% Commit.id %]</id>
- <content mode="xml">
+ <link rel="alternate" type="text/html" href="[% Commit.id %]" />
+ <content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">[% Commit.content | html_entity %]</div>
</content>
</entry>
body{
- background:#FAFAFA url(/static/i/bg.png) repeat-x left top;
+ background:#FAFAFA url([% c.uri_for('/static/i/bg.png') %]) repeat-x left top;
padding:0;
margin:0;
font-family:Arial, Verdana, sans-serif;