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

Re: What would I use local hooks for?

From: Stefan Küng <tortoisesvn_at_gmail.com>
Date: Fri, 01 Jun 2012 20:16:59 +0200

On 01.06.2012 18:35, John Doe wrote:
> I just realized that TSVN supports local hooks.
>
> Can someone explain what they can be useful for?
>
> I already use server-side hooks to enforce entering log message for
> commits and prevent certain files from being checked in; also use
> post-commit hooks to send emails on commits.

To enforce entering a log message, you can also set the tsvn:logminsize
property:
http://tortoisesvn.net/docs/release/TortoiseSVN_en/tsvn-dug-propertypage.html#tsvn-dug-propertypage-tsvn-props

The advantage of client side hooks is that they run on the client, not
on the server.
For example, we use a client side hook script (pre-commit) to check all
files to-be-committed whether they have the copyright year in the header
updated to the current year.
Sure, you could do the same check in a hook script on the server, but
then the user just gets a failed commit, after maybe waiting a minute
until the commit data is all sent.
With the hook script running client side, the check is much faster and
the commit data does not have to be sent to the server first.

You could also use client side hooks to check whether e.g. unit tests
have been run yet (or just run the tests in the script).

Also, client-side scripts are the only option if you can not install
custom scripts on the server (e.g., public hosting servers).

> We also use AnkhSVN and my understanding is that it has no support
> for local hooks, is that correct?

Yes, client-side hooks are a feature of TSVN.

Stefan

-- 
        ___
   oo  // \\      "De Chelonian Mobile"
  (_,\/ \_/ \     TortoiseSVN
    \ \_/_\_/>    The coolest Interface to (Sub)Version Control
    /_/   \_\     http://tortoisesvn.net
------------------------------------------------------
http://tortoisesvn.tigris.org/ds/viewMessage.do?dsForumId=4061&dsMessageId=2967659
To unsubscribe from this discussion, e-mail: [users-unsubscribe_at_tortoisesvn.tigris.org].
Received on 2012-06-02 02:13:50 CEST

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

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