X-Git-Url: https://git.ladys.computer/Gitweb/blobdiff_plain/6e24be63d45dccceab99187fa2c87277b4fa394d424f75a8d1f8e11540ff0056..95e4aa493435bbd4cd22b7e8017da9b98857356be89e6905852397497a83392a:/gitweb.cgi
diff --git a/gitweb.cgi b/gitweb.cgi
index bdb3e5f..e5dd082 100755
--- a/gitweb.cgi
+++ b/gitweb.cgi
@@ -15,14 +15,14 @@ use CGI::Carp qw(fatalsToBrowser);
use Fcntl ':mode';
my $cgi = new CGI;
-my $version = "239";
+my $version = "241";
my $my_url = $cgi->url();
my $my_uri = $cgi->url(-absolute => 1);
my $rss_link = "";
# absolute fs-path which will be prepended to the project path
-my $projectroot = "/pub/scm";
-$projectroot = "/home/kay/public_html/pub/scm";
+#my $projectroot = "/pub/scm";
+my $projectroot = "/home/kay/public_html/pub/scm";
# location of the git-core binaries
my $gitbin = "/usr/bin";
@@ -488,7 +488,7 @@ sub git_read_commit {
$co{'comment'} = \@commit_lines;
foreach my $title (@commit_lines) {
if ($title ne "") {
- $co{'title'} = chop_str($title, 80);
+ $co{'title'} = chop_str($title, 80, 5);
# remove leading stuff of merges to make the interesting part visible
if (length($title) > 50) {
$title =~ s/^Automatic //;
@@ -506,7 +506,7 @@ sub git_read_commit {
$title =~ s/\/pub\/scm//;
}
}
- $co{'title_short'} = chop_str($title, 50);
+ $co{'title_short'} = chop_str($title, 50, 5);
last;
}
}
@@ -621,12 +621,15 @@ sub chop_str {
my $len = shift;
my $add_len = shift || 10;
- $str =~ m/^(.{0,$len}[^ \/\-_:\.@]{0,$add_len})/;
- my $chopped = $1;
- if ($chopped ne $str) {
- $chopped .= " ...";
+ # allow only $len chars, but don't cut a word if it would fit in $add_len
+ # if it doesn't fit, cut it if it's still longer than the dots we would add
+ $str =~ m/^(.{0,$len}[^ \/\-_:\.@]{0,$add_len})(.*)/;
+ my $body = $1;
+ my $tail = $2;
+ if (length($tail) > 4) {
+ $tail = " ...";
}
- return $chopped;
+ return "$body$tail";
}
sub file_type {
@@ -977,9 +980,14 @@ sub git_summary {
if ($i-- > 0) {
print "