[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: explaining syntax-check hook-script

From: Ryan Schmidt <subversion-2009b_at_ryandesign.com>
Date: Mon, 7 Sep 2009 15:26:42 -0500

On Sep 7, 2009, at 09:49, Marc Lustig wrote:

> Could somebody explain what exactly the pre-commit hook-script
>
> http://svn.collab.net/repos/svn/trunk/contrib/hook-scripts/syntax-check.sh
>
> is doing?

Sadly it does not appear to be described here:

http://subversion.tigris.org/tools_contrib.html

> The comments state
> # This script provides language independant syntax checking
> # functionality intended to be invoked from a subversion pre-commit
> # hook.
>
> What rules are used for the syntax?
> What will be ensured if the script is passed successfully?

As shipped, it looks like the script only checks the syntax of PHP
files. I believe you are meant to modify the following variables if
you want it to check a different language:

FPATTERN="\.\(php\|phpt\)$"
FLANG="PHP"
SYNTAX_CMD="php"
SYNTAX_ARGS="-l"

> We have the requirement to ensure that log-messages as well as file-
> names
> and the contents of character-based files are properly encoded,
> i .e. in
> UTF-8.
> Anybody knows a script to do this job?

For filenames and log message, Subversion should be checking this
already. It should not be possible for non-UTF-8 filenames or log
messages to end up in the repository. Though I think there may be some
cases where it can happen, for example when loading a dumpfile via
svnadmin load? There seem to be more lax checks in place there than
with the "svn commit" or "svn import" mechanisms.

To verify file contents are UTF-8, there is probably a script that
exists, to which you could point the syntax-check.sh script via the
above-mentioned variables.

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=2392142

To unsubscribe from this discussion, e-mail: [users-unsubscribe_at_subversion.tigris.org].
Received on 2009-09-07 22:27:47 CEST

This is an archived mail posted to the Subversion Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.