<% # API my $api = gitprep_api; # Parameters my $user = param('user'); my $project = param('project'); my $from_rev = param('rev1'); my $rev = param('rev2'); my $page = param('page') || 0; # Git my $git = $self->app->git; # Commits my $commits = $git->forward_commits($user, $project, $from_rev, $rev); my $commits_count = @$commits; my $commits_date = {}; my $authors = {}; for my $commit (@$commits) { my $date = $commit->{age_string_date_local}; $commits_date->{$date} ||= []; $authors->{$commit->{author}} = 1; push @{$commits_date->{$date}}, $commit; } my $authors_count = keys %$authors; # Start commit my $start_commit = $git->separated_commit($user, $project, $from_rev, $rev); # End commit my $end_commit = $git->get_commit($user, $project, $rev); if (!$start_commit || !$end_commit) { $self->render_not_found; return; } # Branches my $branches = $git->branches($user, $project); @$branches = sort { $a->{commit}{age} <=> $b->{commit}{age} } @$branches; # Global variables stash( id => $end_commit->{id}, from_id => $start_commit->{id}, rev => $end_commit->{id}, from_rev => $start_commit->{id}, ); %> % layout 'common', title => "Comparing $rev1...$rev2 \x{30fb} $user/$project"; %= javascript begin $(document).ready(function () { // Change base branch $('#base-branch-btn').on('click', function () { $('#base-branch-popup') .css('display', 'block') .css('top', '40px') .css('left', '10px') ; }); $('#base-branch-close').on('click', function () { $('#base-branch-popup').css('display', 'none'); }); $('[name=base-branch]').on('keypress', function (e) { // Enter if (e.which == 13) { location.href = '<%= url_for("/$user/$project/compare/") %>' + $(this).val() + '...<%= $rev %>'; } }); // Change compare branch $('#compare-branch-btn').on('click', function () { $('#compare-branch-popup') .css('display', 'block') .css('top', '40px') .css('left', '96px') ; }); $('#compare-branch-close').on('click', function () { $('#compare-branch-popup').css('display', 'none'); }); $('[name=compare-branch]').on('keypress', function (e) { // Enter if (e.which == 13) { location.href = '<%= url_for("/$user/$project/compare/") %>' + '<%= $from_rev %>...' + $(this).val(); } }); }); % end %= include '/include/header';
%= include '/include/project_header'; %= include '/include/code_menu', display => 'files';

Compare View

From here you can compare two points in history. You can even compare tag names and commits.

% if (keys %$commits_date) {
Showing <%= @$commits %> commits by <%= $authors_count %> author.
% for my $date (reverse sort keys %$commits_date) { % my $commits = $commits_date->{$date};
<%= $date %>
% for my $commit (sort {$b->{author_epoch} <=> $a->{author_epoch}} @$commits) { % }
% } %= include '/include/commit_body'; % } else {
There isn't anything to compare.
<%= $from_rev %> is up to date with all commits from <%= $rev %>. Try ">switching the base for your comparison.
% }
%= include '/include/footer';