public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] limit commit message to 500 lines (was: Please, do not use the merged revisions log as the commit message when merging)
@ 2008-08-26 16:41 Manuel López-Ibáñez
  2008-08-26 16:51 ` Manuel López-Ibáñez
                   ` (8 more replies)
  0 siblings, 9 replies; 86+ messages in thread
From: Manuel López-Ibáñez @ 2008-08-26 16:41 UTC (permalink / raw)
  To: Gcc Patch List; +Cc: Daniel Berlin

[-- Attachment #1: Type: text/plain, Size: 517 bytes --]

2008/8/16 Manuel López-Ibáñez <lopezibanez@gmail.com>:
> Could we put a limit to the commit log entry? More than 500 hundred
> lines changelog entries should just be rejected and this will avoid
> someone accidentally committing a full log or a diff or just random
> junk.
>

The following patch to our pre-commit hook enables this. I have tested
it with a dummy repository but review from bourne-shell and/or
subversion knowledgeable people would be welcome.

Who can approve this?

Cheers,

Manuel.

[-- Attachment #2: pre-commit.diff --]
[-- Type: text/plain, Size: 1723 bytes --]

Index: pre-commit
===================================================================
--- pre-commit	(revision 139590)
+++ pre-commit	(working copy)
@@ -47,7 +47,8 @@
 # If you're having unexpected problems with a hook program, the
 # culprit may be unusual (or missing) environment variables.
 # 
-# Here is an example hook script, for a Unix /bin/sh interpreter.# For more examples and pre-written hooks, see those in
+# Here is an example hook script, for a Unix /bin/sh interpreter.
+# For more examples and pre-written hooks, see those in
 # the Subversion repository at
 # http://svn.collab.net/repos/svn/trunk/tools/hook-scripts/ and
 # http://svn.collab.net/repos/svn/trunk/contrib/hook-scripts/
@@ -58,9 +59,23 @@
 
 # Make sure that the log message contains some text.
 SVNLOOK=/usr/bin/svnlook
-$SVNLOOK log -t "$TXN" "$REPOS" | \
-   grep "[a-zA-Z0-9]" > /dev/null || exit 1
 
+$SVNLOOK log -t "$TXN" "$REPOS" | grep "[a-zA-Z0-9]" > /dev/null
+if [ $? -ne 0 ]; then
+    echo "Please include a ChangeLog entry with this commit." >&2
+    exit 1
+fi
+
+# Do not allow log messages
+LOGLINES=`$SVNLOOK log -t "$TXN" "$REPOS" | wc -l`
+if test $LOGLINES -gt 500; then
+    echo "A single ChangeLog entry cannot be larger than 500 lines.       " >&2
+    echo "Please check again the log message of this commit.              " >&2
+    echo "If you are merging from/to a branch, never use log messages from" >&2
+    echo "other revisions as the commit message.                          " >&2
+    exit 1
+fi
+
 # Check that the author of this commit has the rights to perform
 # the commit on the files and directories being modified.
 #commit-access-control.pl "$REPOS" "$TXN" commit-access-control.cfg || exit 1

^ permalink raw reply	[flat|nested] 86+ messages in thread

end of thread, other threads:[~2008-08-26 21:08 UTC | newest]

Thread overview: 86+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-08-26 16:41 [PATCH] limit commit message to 500 lines (was: Please, do not use the merged revisions log as the commit message when merging) Manuel López-Ibáñez
2008-08-26 16:51 ` Manuel López-Ibáñez
2008-08-26 17:13 ` Manuel López-Ibáñez
2008-08-26 17:35 ` H.J. Lu
2008-08-26 17:44   ` H.J. Lu
2008-08-26 17:47   ` Richard Guenther
2008-08-26 19:15     ` Richard Guenther
2008-08-26 19:31     ` H.J. Lu
2008-08-26 20:01       ` H.J. Lu
2008-08-26 20:58       ` Manuel López-Ibáñez
2008-08-26 22:50         ` Manuel López-Ibáñez
2008-08-27  7:41         ` Manuel López-Ibáñez
2008-08-27 11:26         ` Manuel López-Ibáñez
2008-08-27 16:10         ` Manuel López-Ibáñez
2008-08-27 22:20         ` Manuel López-Ibáñez
2008-08-27  8:08       ` H.J. Lu
2008-08-27 16:30       ` H.J. Lu
2008-08-27 23:58       ` H.J. Lu
2008-08-26 20:04     ` Richard Guenther
2008-08-26 22:09     ` Manuel López-Ibáñez
2008-08-26 23:31       ` Manuel López-Ibáñez
2008-08-27 10:40       ` Manuel López-Ibáñez
2008-08-27 18:25       ` Manuel López-Ibáñez
2008-08-27 22:09       ` Manuel López-Ibáñez
2008-08-27  0:42     ` Richard Guenther
2008-08-27  7:54     ` Manuel López-Ibáñez
2008-08-27 18:15       ` Manuel López-Ibáñez
2008-08-27 12:51     ` Richard Guenther
2008-08-27 18:36     ` Richard Guenther
2008-08-27 20:45     ` Richard Guenther
2008-08-26 17:56   ` H.J. Lu
2008-08-26 20:19   ` H.J. Lu
2008-08-26 20:49   ` Manuel López-Ibáñez
2008-08-26 21:53     ` H.J. Lu
2008-08-27  0:54       ` H.J. Lu
2008-08-27  4:21       ` Manuel López-Ibáñez
2008-08-27  8:02         ` Manuel López-Ibáñez
2008-08-27  9:00         ` Manuel López-Ibáñez
2008-08-27 13:54         ` H.J. Lu
2008-08-27 14:46           ` Manuel López-Ibáñez
2008-08-27 15:41             ` H.J. Lu
2008-08-27 16:33               ` H.J. Lu
2008-08-27 19:55               ` H.J. Lu
2008-08-27 20:27               ` Daniel Berlin
2008-08-27 22:20               ` H.J. Lu
2008-08-27 16:10             ` Manuel López-Ibáñez
2008-08-27 17:50             ` Manuel López-Ibáñez
2008-08-27 18:45             ` Manuel López-Ibáñez
2008-08-27 21:54             ` Manuel López-Ibáñez
2008-08-27 16:13           ` H.J. Lu
2008-08-27 18:40           ` H.J. Lu
2008-08-27 20:17           ` Daniel Berlin
2008-08-27 20:44             ` Daniel Berlin
2008-08-27 20:48           ` H.J. Lu
2008-08-27 16:46         ` Manuel López-Ibáñez
2008-08-27 18:24         ` Manuel López-Ibáñez
2008-08-27 20:34         ` Manuel López-Ibáñez
2008-08-27 12:01       ` H.J. Lu
2008-08-27 19:43       ` H.J. Lu
2008-08-27 22:59       ` H.J. Lu
2008-08-26 22:21     ` Manuel López-Ibáñez
2008-08-27  6:19     ` Manuel López-Ibáñez
2008-08-27 13:36     ` Manuel López-Ibáñez
2008-08-27 17:47     ` Manuel López-Ibáñez
2008-08-27 18:25     ` Manuel López-Ibáñez
2008-08-27 22:20     ` Manuel López-Ibáñez
2008-08-27 11:26   ` H.J. Lu
2008-08-26 17:37 ` Manuel López-Ibáñez
2008-08-26 20:22 ` Manuel López-Ibáñez
     [not found] ` <1219764262.13055.58.camel@localhost>
2008-08-26 20:47   ` Manuel López-Ibáñez
2008-08-26 22:35     ` Manuel López-Ibáñez
2008-08-27  4:35     ` Manuel López-Ibáñez
2008-08-27  8:27     ` Manuel López-Ibáñez
2008-08-27 15:12     ` Paolo Bonzini
2008-08-27 16:22       ` Paolo Bonzini
2008-08-27 19:30       ` Paolo Bonzini
2008-08-27 19:46       ` Manuel López-Ibáñez
2008-08-27 20:07         ` Manuel López-Ibáñez
2008-08-27 20:32         ` Manuel López-Ibáñez
2008-08-27 22:26       ` Paolo Bonzini
2008-08-27 17:35     ` Manuel López-Ibáñez
2008-08-27 19:57     ` Manuel López-Ibáñez
2008-08-27 22:22     ` Manuel López-Ibáñez
2008-08-27 14:03 ` Manuel López-Ibáñez
2008-08-27 16:31 ` Manuel López-Ibáñez
2008-08-27 22:48 ` Manuel López-Ibáñez

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).