emehrkay Posted April 28, 2008 Share Posted April 28, 2008 I am lost. Has anyone ever done this on a windows platform? Quote Link to comment https://forums.phpfreaks.com/topic/103258-writng-subversion-hook-scrips-in-php/ Share on other sites More sharing options...
emehrkay Posted April 28, 2008 Author Share Posted April 28, 2008 Alright, I have some simple length checking down for my pre-commit using svnlook log to get the commit comment. Pretty easy stuff so far <?php /* test to see if comment length is greater than or equal to 10 chars */ $log = exec("svnlook log -t ". $argv[2] ." ". $argv[1]); if(strlen($log) > 9){ exit(0); }else{ exit(1); } ?> Quote Link to comment https://forums.phpfreaks.com/topic/103258-writng-subversion-hook-scrips-in-php/#findComment-528942 Share on other sites More sharing options...
neylitalo Posted April 28, 2008 Share Posted April 28, 2008 Does it have to be in PHP? They have some "official" hooks that can be found in the tools/hook-scripts directory of your subversion install. Quote Link to comment https://forums.phpfreaks.com/topic/103258-writng-subversion-hook-scrips-in-php/#findComment-529034 Share on other sites More sharing options...
Daniel0 Posted April 28, 2008 Share Posted April 28, 2008 You can do any scripting language. Quote Link to comment https://forums.phpfreaks.com/topic/103258-writng-subversion-hook-scrips-in-php/#findComment-529040 Share on other sites More sharing options...
emehrkay Posted April 28, 2008 Author Share Posted April 28, 2008 Im such a noob and scared to go outside of php. lol not really, but php is easiest at the moment for me to churn out results. and my place of employment is not trying ot hear "we'll it took me about an hour to learn python..." workin for the man sucks anyway, I have that script running, checkin the strlen. I just need to set the STDERR so that I can tell the user that the comment that they've entered was too damn short. Anyone know how to do this? Thanks guys Quote Link to comment https://forums.phpfreaks.com/topic/103258-writng-subversion-hook-scrips-in-php/#findComment-529043 Share on other sites More sharing options...
The Little Guy Posted April 28, 2008 Share Posted April 28, 2008 Try and use the other 2 parameters as well with exec(), or use System: http://us2.php.net/manual/en/function.system.php with both parameters set. Or could you use the Subversion functions? http://us2.php.net/manual/en/ref.svn.php Quote Link to comment https://forums.phpfreaks.com/topic/103258-writng-subversion-hook-scrips-in-php/#findComment-529047 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.