aboutsummaryrefslogtreecommitdiffstats
path: root/CVSROOT/log_accum.pl
diff options
context:
space:
mode:
authorjoe <joe@FreeBSD.org>2001-12-04 06:37:43 +0800
committerjoe <joe@FreeBSD.org>2001-12-04 06:37:43 +0800
commit30784c442db1f630e9cf8fcaa0ca09bc1fae4bc0 (patch)
tree2eb49432184dace8abede488ae699084d32ce50a /CVSROOT/log_accum.pl
parentd66dabe3832dd9f598c50737e7efd4826c83c54b (diff)
downloadfreebsd-ports-gnome-30784c442db1f630e9cf8fcaa0ca09bc1fae4bc0.tar.gz
freebsd-ports-gnome-30784c442db1f630e9cf8fcaa0ca09bc1fae4bc0.tar.zst
freebsd-ports-gnome-30784c442db1f630e9cf8fcaa0ca09bc1fae4bc0.zip
Define $DIFF_BLOCK_TOTAL_LINES to restrict the maximum number of
lines of diff in a commit email.
Diffstat (limited to 'CVSROOT/log_accum.pl')
-rwxr-xr-xCVSROOT/log_accum.pl25
1 files changed, 22 insertions, 3 deletions
diff --git a/CVSROOT/log_accum.pl b/CVSROOT/log_accum.pl
index dbe25e764afd..3c0f3963a73a 100755
--- a/CVSROOT/log_accum.pl
+++ b/CVSROOT/log_accum.pl
@@ -830,6 +830,7 @@ if (-e $LAST_FILE) {
#
# Produce the final compilation of the log messages
#
+my $diff_num_lines = $cfg::DIFF_BLOCK_TOTAL_LINES;
for (my $i = 0; ; $i++) {
last unless -e "$LOG_FILE.$i";
@@ -858,10 +859,28 @@ for (my $i = 0; ; $i++) {
#
&do_changes_file(@log_msg);
+ #
# Add the diff after writing the log files.
- if (-e "$DIFF_FILE.$i") {
- push @log_msg, " ", map {" $_"}
- read_logfile("$DIFF_FILE.$i");
+ #
+ if (-e "$DIFF_FILE.$i" and $diff_num_lines > 0) {
+ my @diff_block = read_logfile("$DIFF_FILE.$i");
+
+ my $lines_to_use = scalar @diff_block;
+ $lines_to_use = $diff_num_lines
+ if $lines_to_use > $diff_num_lines;
+
+ push @log_msg, " ",
+ map {" $_"} @diff_block[0 .. $lines_to_use - 1];
+
+ $diff_num_lines -= $lines_to_use;
+ if ($diff_num_lines <= 0) {
+ push @log_msg, "",
+ "----------------------------------------------",
+ "Diff block truncated. (Max lines = " .
+ $cfg::DIFF_BLOCK_TOTAL_LINES . ")",
+ "----------------------------------------------",
+ "";
+ }
}
#