You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Ryan Schmidt <su...@ryandesign.com> on 2006/03/26 14:45:14 UTC

Windows hook extensions: documentation inconsistent with code

The latest Subversion code shows that on Windows it checks for the  
extensions ".exe", ".cmd", ".bat" and ".wsf", in that order, when  
looking for a hook:

http://svn.collab.net/repos/svn/trunk/subversion/libsvn_repos/hooks.c

The latest book suggests that Windows users might use the extensions  
".exe", ".com" or ".bat":

http://svnbook.red-bean.com/nightly/en/ 
svn.reposadmin.create.html#svn.reposadmin.create.hooks

1. The book should be updated to include ".wsf".

2. Which is the correct extension: ".com" or ".cmd", or are both  
valid? Either the book or the Subversion code or both should be  
updated accordingly.



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: Windows hook extensions: documentation inconsistent with code

Posted by Darko Miletic <da...@uvcms.com>.
Andy Levy wrote:
> Why not check for PATHEXT, if it exists use it, if it doesn't then
> fall back to the current processing?
> 

Sounds good to me.



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: Windows hook extensions: documentation inconsistent with code

Posted by Andy Levy <an...@gmail.com>.
On 3/26/06, Darko Miletic <da...@uvcms.com> wrote:
> Ryan Schmidt wrote:
> > On Mar 26, 2006, at 17:03, Darko Miletic wrote:
> >
> > So it sounds Subversion should be rewritten to use PATHEXT, and the
> > book should be rewritten to reflect that this is the case?
> >
>
> It could be done this way. It is important to note that it only works on
> windows NT/2k/Xp/2003, older versions of windows work in different manner.

How far back should Subversion support Windows in the first place?  NT
isn't even supported by Microsoft anymore.  Win9x has been cut off for
quite a while, and ME probably has been as well.

Why not check for PATHEXT, if it exists use it, if it doesn't then
fall back to the current processing?

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org


Re: Windows hook extensions: documentation inconsistent with code

Posted by Darko Miletic <da...@uvcms.com>.
Ryan Schmidt wrote:
> On Mar 26, 2006, at 17:03, Darko Miletic wrote:
> 
> So it sounds Subversion should be rewritten to use PATHEXT, and the 
> book should be rewritten to reflect that this is the case?
> 

It could be done this way. It is important to note that it only works on
windows NT/2k/Xp/2003, older versions of windows work in different manner.

> Are there any situations in which PATHEXT could be empty or 
> inappropriate, such that Subversion would still need a fall-back to a 
> hard-coded extension list like it does now?

It is possible to check the content of PATHEXT. If it is empty than
fallback to internal extension list.




---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: Windows hook extensions: documentation inconsistent with code

Posted by Ryan Schmidt <su...@ryandesign.com>.
On Mar 26, 2006, at 17:03, Darko Miletic wrote:

>> 2. Which is the correct extension: ".com" or ".cmd", or are both   
>> valid?
>> Either the book or the Subversion code or both should be  updated
>> accordingly.
>
> As of windows NT executable extensions are defined in PATHEXT
> environment variable. All extensions defined there will be treated as
> executables by OS. Common content of PATHEXT looks like this:
>
> .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH
>
> .com extension in general is not used so much these days.
> .bat and .cmd are extensions for windows batch files.
> vbs, vbe and js, jse are for vb script/javascript files that can be
> executed with windows scripting engine.
> .wsh/wsf are Windows Script Host control files again related to  
> windows
> scripting engine.
> So in fact if you need some other scripting language added to shell  
> just
> add extension to PATHEXT and assign extension with appropriate  
> executable.
>
> Importance of PATHEXT in fact is big. For example to be able to have
> executables with extension cgi and execute them with IIS you must add
> .cgi extension to PATHEXT, otherwise it does not work.

So it sounds Subversion should be rewritten to use PATHEXT, and the  
book should be rewritten to reflect that this is the case?

Are there any situations in which PATHEXT could be empty or  
inappropriate, such that Subversion would still need a fall-back to a  
hard-coded extension list like it does now?



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: Windows hook extensions: documentation inconsistent with code

Posted by Darko Miletic <da...@uvcms.com>.
Ryan Schmidt wrote:
> 2. Which is the correct extension: ".com" or ".cmd", or are both  valid?
> Either the book or the Subversion code or both should be  updated
> accordingly.

As of windows NT executable extensions are defined in PATHEXT
environment variable. All extensions defined there will be treated as
executables by OS. Common content of PATHEXT looks like this:

.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH

.com extension in general is not used so much these days.
.bat and .cmd are extensions for windows batch files.
vbs, vbe and js, jse are for vb script/javascript files that can be
executed with windows scripting engine.
.wsh/wsf are Windows Script Host control files again related to windows
scripting engine.
So in fact if you need some other scripting language added to shell just
add extension to PATHEXT and assign extension with appropriate executable.

Importance of PATHEXT in fact is big. For example to be able to have
executables with extension cgi and execute them with IIS you must add
.cgi extension to PATHEXT, otherwise it does not work.






---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org