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

Re: Hook to validate XHTML

From: Ryan Schmidt <subversion-2006q2_at_ryandesign.com>
Date: 2006-06-22 15:17:33 CEST

On Jun 22, 2006, at 14:10, emerson cargnin wrote:

> On 22/06/06, Ryan Schmidt wrote:
>
>> On Jun 22, 2006, at 13:23, emerson cargnin wrote:
>>
>>> Does anyone know of any hook to validate if a JSP is XHTML
>>> compliant?
>>
>> No, but somebody just posted a pre-commit hook that performs some
>> other validation on files. You can surely use it as a basis for an
>> XHTML checker:
>>
>> http://svn.haxx.se/users/archive-2006-06/0853.shtml
>>
>>
>>> Is it possible for a pre-commit hook to go for the commit but even
>>> then display a warning??
>>
>> If you mean: is it possible for a pre-commit hook to allow the commit
>> to proceed, yet output text to the user, then I don't think so. You
>> can only output text to the user from a pre-* hook if you also return
>> a non-zero status, and thereby prevent the action from taking place.
>
> The manual says:
> "If the program returns a non-zero exit value, the commit is aborted
> and the transaction is removed. If the hook program writes data to
> stderr, it will be marshalled back to the client."
>
> It's not clear if it would be possible to write to sterr and even then
> return a 0 exit value.
>
> thanks anyway.
> PS: that would be a nice to have feature...

Don't forget to use the "reply to all" feature of your email program
when replying so that your reply also goes to the mailing list and
not just to me.

I agree the wording in the manual could be clearer. That seems to be
the gist of this message:

http://svn.haxx.se/dev/archive-2006-03/1256.shtml

But before replying to your initial mail I did try it out and was
unable to get my output displayed by the client unless I exited the
hook with a nonzero code. That seems to be the intended behavior.

There has been other discussion on the lists about this topic, and I
believe the idea was that there is no communication channel between
the client and server over which a message could be transmitted in
the case of success, and adding it would be non-trivial. (There have
also been requests to make hooks interactive, which is even less
trivial.) It's also been called into question what the purpose would
be of printing output in the case of success. If you must inform the
user of something after every commit, you could do so in an email
sent from the hook. Since you know the username you can presumably
construct or look up their email address.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Thu Jun 22 15:19:38 2006

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.