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

Re: pre-commit.pl

From: David Weintraub <qazwart_at_gmail.com>
Date: Tue, 16 Dec 2008 13:12:24 -0500

Does the pl2bat command work? This converts the Perl script to a batch
script. by placing a few Perl/Batch file lines on the top of the Perl
script.

On Tue, Dec 16, 2008 at 12:43 PM, Andy Levy <andy.levy_at_gmail.com> wrote:
> On Tue, Dec 16, 2008 at 12:37, David Weintraub <qazwart_at_gmail.com> wrote:
>>> This too will fail, because Perl is not "natively" executable by
>>> Windows. On a Windows SVN server, your hook scripts can only
>>> be BAT or CMD scripts or full-blown executables. A "plain" Perl
>>> script will not execute, it must be called from a BAT or CMD file,
>>> or converted to an EXE.
>>
>> You can change the way Windows handles various file extensions
>> including executing files that have a *.pl extension as Perl files.
>> ActiveState sets this up automatically when you install it.
>>
>> You can also change the PATHEXT system variable which will allow you
>> to execute Perl scripts without the need of adding the *.pl suffix.
>> This will put Perl scripts on the same level as BAT scripts and
>> executable files. I am not sure if ActiveState does this when it is
>> installed.
>
> We tried this a couple years ago, on either this mailing list or dev.
> The Subversion source specifically looks for <hookname>.EXT where EXT
> is CMD, BAT or EXE. It simply does not look for, and therefore cannot
> & will not execute, a pre-commit.pl.
>
> Even with adding .wsh to the mix (I was playing with WSH scripts), it
> didn't work, because the scripts require that one call the interpreter
> with the path to the script as the first argument.
>
>> I suspect that Ilan already had this setup when he sent out the
>> initial email since he didn't complain that his script failed, that it
>> didn't print out the "Hello World" message he expected it to print.
>>
>> On Tue, Dec 16, 2008 at 11:52 AM, Andy Levy <andy.levy_at_gmail.com> wrote:
>>> On Tue, Dec 16, 2008 at 11:47, David Weintraub <qazwart_at_gmail.com> wrote:
>>>> Is this a server side hook?
>>>>
>>>> Try this:
>>>>
>>>> #! C:/bin/perl
>>>>
>>>> print STDERR "Hello World\n";
>>>> exit 2;
>>>>
>>>> That will display your message back to the client. Of course, it will
>>>> also fail the commit too.
>>>
>>> This too will fail, because Perl is not "natively" executable by
>>> Windows. On a Windows SVN server, your hook scripts can only be BAT or
>>> CMD scripts or full-blown executables. A "plain" Perl script will not
>>> execute, it must be called from a BAT or CMD file, or converted to an
>>> EXE.
>>>
>>>> Server side hooks print nothing to the client unless there's a failure
>>>> and the commit transaction is rejected. Otherwise, it returns nothing.
>>>>
>>>> If you want to send information back to the client, you have to use
>>>> email or even IMing the user. That's the best you're going to do.
>>>>
>>>> On Tue, Dec 16, 2008 at 5:12 AM, Ilan Yaniv <Ilan.Yaniv_at_timetoknow.org> wrote:
>>>>> Hi
>>>>>
>>>>> I wrote a pre-commit.pl simple script that I want to be executed before I am
>>>>> commiting a file.
>>>>>
>>>>> It is simple –
>>>>>
>>>>> #!C:\Perl\bin
>>>>>
>>>>> print STDERR "Hello World\n";
>>>>>
>>>>> or…
>>>>>
>>>>> #!C:\Perl\bin
>>>>>
>>>>> print "Hello World\n";
>>>>>
>>>>> But, when I execute the script I am getting no message when I am doing it
>>>>> from the command line.
>>>>>
>>>>> Please help.
>>>>>
>>>>> Ilan Yaniv
>>>>>
>>>>> Configuration Management
>>>>>
>>>>> Phone: 03-7534333 ext. 5873
>>>>>
>>>>> Ilan.Yaniv_at_timetoknow.org
>>>>
>>>>
>>>>
>>>> --
>>>> --
>>>> David Weintraub
>>>> qazwart_at_gmail.com
>>>>
>>>> ------------------------------------------------------
>>>> http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=985092
>>>>
>>>> To unsubscribe from this discussion, e-mail: [users-unsubscribe_at_subversion.tigris.org].
>>>>
>>>
>>
>>
>>
>> --
>> --
>> David Weintraub
>> qazwart_at_gmail.com
>>
>

-- 
--
David Weintraub
qazwart_at_gmail.com
------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=985143
To unsubscribe from this discussion, e-mail: [users-unsubscribe_at_subversion.tigris.org].
Received on 2008-12-16 19:13:37 CET

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.