diff --git a/tools/git-notify b/tools/git-notify
index 9ab012e34d36a7847b335ffcf2b5a3010ef6ab99..39abd66e173e219d831fd765181c27cacdb0824b 100755 (executable)
--- a/tools/git-notify
+++ b/tools/git-notify
return $revlist;
}
+# truncate the given string if it exceeds the specified number of characters
+sub truncate_str($$)
+{
+ my ($str, $max) = @_;
+
+ if (length($str) > $max)
+ {
+ $str = substr($str, 0, $max);
+ $str =~ s/\s+\S+$//;
+ $str .= " ...";
+ }
+ return $str;
+}
+
# right-justify the left column of "left: right" elements, omit undefined elements
sub format_table(@)
{
}
mail_notification($commitlist_address,
- $info{"author_name"} . ": " . ${$info{"log"}}[0],
+ $info{"author_name"} . ": " . truncate_str(${$info{"log"}}[0], 50),
"text/plain; charset=UTF-8", @notice);
$sent_notices++;
}