The canonical repository for the master branch is:
- it://git.shadowcat.co.uk/catagits/Gitalist.git
+ git://git.shadowcat.co.uk/catagits/Gitalist.git
Gitalist is also mirrored to github, and a number of people have active
forks with branches and/or new features in the master branch.
Alternatively, if you only want to set a repository directory and are
otherwise happy with the default configuration, then you can set the
- "GITALIST_REPOS_DIR" environment variable, or pass the "--repos_dir"
- flag to any of the scripts.
+ "GITALIST_REPO_DIR" environment variable, or pass the "--repos_dir" flag
+ to any of the scripts.
- GITALIST_REPOS_DIR=/home/myuser/code/git gitalist_server.pl
+ GITALIST_REPO_DIR=/home/myuser/code/git gitalist_server.pl
gitalist_server.pl --repos_dir home/myuser/code/git
- The "GITALIST_REPOS_DIR" environment variable will override the
+ The "GITALIST_REPO_DIR" environment variable will override the
repository directory set in configuration, and will itself be overridden
by he "--repos_dir" flag.
sub base : Chained('/fragment/repository/find') PathPart('') CaptureArgs(0) {}
-after diff => sub {
+sub _diff {
my ($self, $c) = @_;
my $commit = $c->stash->{Commit};
+ my %filename = $c->stash->{filename} ? (filename => $c->stash->{filename}) : ();
my($tree, $patch) = $c->stash->{Repository}->diff(
commit => $commit,
- parent => $c->req->param('hp') || undef,
+ parent => $c->stash->{parent},
patch => 1,
+ %filename,
);
$c->stash(
diff_tree => $tree,
# XXX Hack hack hack, see View::SyntaxHighlight
blobs => [map $_->{diff}, @$patch],
language => 'Diff',
+ %filename,
);
-};
+}
after diff_fancy => sub {
my ($self, $c) = @_;
+ $self->_diff($c);
$c->forward('View::SyntaxHighlight');
};
after diff_plain => sub {
my ($self, $c) = @_;
+ $self->_diff($c);
$c->response->content_type('text/plain; charset=utf-8');
};
method diff ( Maybe[Bool] :$patch?,
Maybe[NonEmptySimpleStr] :$parent?,
- Maybe[NonEmptySimpleStr] :$file?
+ Maybe[NonEmptySimpleStr] :$filename?
) {
$parent = $parent
? $parent
? $self->parent_sha1
: '-c';
my @etc = (
- ( $file ? ('--', $file) : () ),
+ ( $filename ? ('--', $filename) : () ),
);
my @out = $self->_raw_diff(
method diff ( Gitalist::Git::Object :$commit!,
Bool :$patch?,
Maybe[NonEmptySimpleStr] :$parent?,
- NonEmptySimpleStr :$file?
+ NonEmptySimpleStr :$filename?
) {
return $commit->diff( patch => $patch,
parent => $parent,
- file => $file);
+ filename => $filename);
}
method reflog (@logargs) {
sub diff : Chained('find') CaptureArgs(0) {}
-sub diff_fancy : Chained('diff') PathPart('') Args(0) {}
+sub diff_fancy : Chained('diff') PathPart('') Args() {
+ my($self, $c, $comparison, @rest) = @_;
+ # FIXME - This ain't pretty
+ $c->stash->{parent} = $comparison
+ if $comparison;
+ $c->stash->{filename} = $rest[0]
+ if @rest;
+}
sub diff_plain : Chained('diff') PathPart('plain') Args(0) {}
[% FOREACH item IN diff %]
<div class='diff-head'>
diff --git [%# FIXME %]
- <a href='[% c.uri_for_action("/ref/blob", [Repository.name, Commit.sha1], item.file) %]'>[% item.a %][% item %]</a>
+ <a href='[% c.uri_for_action("/ref/blob", [Repository.name, Commit.sha1], item.file) %]'>[% item.a %]</a>
<a href='[% c.uri_for_action("/ref/blob", [Repository.name, Commit.sha1], item.file) %]'>[% item.b %]</a>
</div>
<div class='diff-index'>
%]
</td>
<td class='action-list'>
- [% IF !line.is_new %]<a href="[% c.uri_for_action("/ref/diff", [Repository.name, Commit.sha1], line.file.to_path) %]">diff</a>[% END %]
+ [% IF !line.is_new %]<a href="[% c.uri_for_action("/ref/diff_fancy", [Repository.name, Commit.sha1], line.file.to_path) %]">diff</a>[% END %]
<a href="[% c.uri_for_action("/ref/blob", [Repository.name, Commit.sha1], line.file.to_path) %]">blob</a>
[% IF !line.is_new %]<a href="[% c.uri_for("/ref/shortlog", [Repository.name, Commit.sha1], line.file.to_path) %]">history</a>[% END %]
</td>
</td>
<td class='action-list'>
[% IF filetype == 'tree' %]
- <a href="[% c.uri_for("tree", {h=line.sha1, hb=line.sha1}) %]">tree</a>
+ <a href="[% c.uri_for_action("/ref/tree", [Repository.name, line.sha1], filename) %]">blob</a>
[% ELSIF filetype == 'blob' %]
- <a href="[% c.uri_for("blob", {hb=line.sha1, f=filename}) %]">blob</a>
+ <a href="[% c.uri_for_action("/ref/blob", [Repository.name, line.sha1], filename) %]">blob</a>
[% END %]
- <a href="[% c.uri_for("commitdiff", {h=line.sha1}) %]">commitdiff</a>
+ <a href="[% c.uri_for_action("/ref/diff_fancy", [Repository.name, line.sha1]) %]">commitdiff</a>
[% IF filetype == 'blob' %]
- <a href="[% c.uri_for("blobdiff", {hb="HEAD", hpb=line.sha1, f=filename}) %]">diff to current</a>
+ <a href="[% c.uri_for_action("/ref/diff_fancy", [Repository.name, line.sha1], 'HEAD', filename) %]">diff to current</a>
[% END %]
</td>
</tr>
<img style="float: left; padding-right: 10px" src="[% uri_for_gravatar(Commit.committer.email, 40) %]">[% Commit.author.name | html %] <br />[% time_since(Commit.authored_time) %]
</div>
-
- [% subinclude('/fragment/ref/diff_fancy', c.req.captures c.req.args.to_path) %]
+ [%
+ # What I really want is @{ c.req.args }
+ subinclude('/fragment/' _ c.action, c.req.captures, c.req.args.0 c.req.args.1)
+ %]
</div>