Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F137666066
D9893.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D9893.diff
View Options
Index: svnadmin/hooks/pre-commit
===================================================================
--- svnadmin/hooks/pre-commit
+++ svnadmin/hooks/pre-commit
@@ -116,6 +116,9 @@
# fix log message.
log-police.py -t "$TXN" "$REPO" || exit 1
+# catch some gross violations of commit template mangling.
+stomp_bad_formatting.pl "$REPO" "$TXN" || exit 1
+
# Nothing else, go ahead.
exit 0
Index: svnadmin/hooks/scripts/stomp_bad_formatting.pl
===================================================================
--- svnadmin/hooks/scripts/stomp_bad_formatting.pl
+++ svnadmin/hooks/scripts/stomp_bad_formatting.pl
@@ -0,0 +1,54 @@
+#!/usr/bin/perl -w
+#
+# $FreeBSD$
+
+use strict;
+my $debug = 0;
+
+# $ svnlook changed /home/svnmirror/base -r 12348
+# UU head/sbin/mountd/mountd.c
+# UU head/usr.sbin/mountd/mountd.c
+# $ svnlook log /home/svnmirror/base -r 12348
+# Avoid bogus free() of a junk pointer.
+#
+# Detected by: phkmalloc
+# Submitted by: grog@lemis.de (Greg Lehey)
+#
+# Except that when called to vette a commit, it'll be "-t txn", not "-r rev"
+
+
+my $repo = $ARGV[0];
+my $txn = $ARGV[1];
+
+my $log = "";
+
+open(LOG, "svnlook log $repo -t $txn |") || die "cannot open svnlook log: $!";
+foreach (<LOG>) {
+ print "$$: log: $_" if ($debug);
+ $log .= $_;
+}
+close(LOG);
+
+if (stomp_bad_formatting($log)) {
+ exit 1;
+}
+exit 0;
+
+# ============================================================
+# Look for a few specific mangled/broken template cases as a
+# stopgap for checking for a proper template.
+
+sub stomp_bad_formatting {
+ my ($log) = @_;
+ my $rv = 0;
+ if ($log =~ m|\n\nReviewers:[\t ]+|s) {
+ printf STDERR "**** Non-standard/badly formatted template - found 'Reviewers:' instead of 'Reviewed by:'.\n";
+ $rv = 1;
+ }
+ # There is really no need for this spam in log messages.
+ if ($log =~ m|\n\nSubscribers:[\t ]+|s) {
+ printf STDERR "**** Non-standard/badly formatted template - found 'Subscribers:'.\n";
+ $rv = 1;
+ }
+ $rv;
+}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Nov 25, 8:26 PM (7 h, 4 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
26172735
Default Alt Text
D9893.diff (1 KB)
Attached To
Mode
D9893: Add the stomp_bad_formatting hook peter wrote to prevent using arc commit.
Attached
Detach File
Event Timeline
Log In to Comment