[wp-meta] [Making WordPress.org] #7784: Add Precommit Hook to WordPress Core SVN

Making WordPress.org noreply at wordpress.org
Wed Sep 25 17:10:13 UTC 2024


#7784: Add Precommit Hook to WordPress Core SVN
-----------------------------+--------------------
 Reporter:  jorbin           |      Owner:  (none)
     Type:  enhancement      |     Status:  new
 Priority:  normal           |  Milestone:
Component:  Version Control  |   Keywords:
-----------------------------+--------------------
 I think we would benefit from a [https://svnbook.red-
 bean.com/en/1.7/svn.ref.reposhooks.pre-commit.html pre-commit hook] which
 checks to make sure that commit messages are not empty.

 I think we could do something like (untested):

 {{{
 #!/bin/sh

 REPO="$1"
 MSG="$2"

 SVNLOOK=/usr/bin/svnlook
 MINSIZE=10

 MSGSIZE=${#MSG}
 OK=1;

 $SVNLOOK log -t "$REPO" "MSG" | grep "[a-zA-Z0-9]" > /dev/null || OK=0
 if [ $SVNLOOKOK -eq 0 || "$MSGSIZE" -le "$MINSIZE" ]; then
     echo "Empty commit messages are not allowed. Please provide a proper
 message." 1>&2
     exit 1
 fi
 exit 0
 }}}


 Example of an empty commit:
 https://core.trac.wordpress.org/changeset/59087

-- 
Ticket URL: <https://meta.trac.wordpress.org/ticket/7784>
Making WordPress.org <https://meta.trac.wordpress.org/>
Making WordPress.org


More information about the wp-meta mailing list