views:

55

answers:

2

Hi,

I would like to perform a shell command that takes care of cache files and compilation after I have run git pull or svn update (in another project)?

+4  A: 

Regarding SVN: not sure if this will help, but if you use TortoiseSVN, you can use client-side hook scripts:

There are currently six types of hook scripts available

Start-commit
Called before the commit dialog is shown. You might want to use this if the hook modifies a versioned file and affects the list of files that need to be committed and/or commit message. However you should note that because the hook is called at an early stage, the full list of objects selected for commit is not available.

Pre-commit
Called after the user clicks OK in the commit dialog, and before the actual commit begins. This hook has a list of exactly what will be committed.

Post-commit
Called after the commit finishes (whether successful or not).

Start-update
Called before the update-to-revision dialog is shown.

Pre-update
Called before the actual Subversion update begins.

Post-update
Called after the update finishes (whether successful or not).

A hook is defined for a particular working copy path. You only need to specify the top level path; if you perform an operation in a sub-folder, TortoiseSVN will automatically search upwards for a matching path.

Next you must specify the command line to execute, starting with the path to the hook script or executable. This could be a batch file, an executable file or any other file which has a valid windows file association, eg. a perl script.

William Leara
I run the update/pull commands the server via SSH and do not use TortoiseSVN -- I would need a remote desktop for that to work.
rFactor
+1  A: 

You can use SVN hooks from command line, on various events(pre- and post-) to run your custom scripts.

It appears that there is no hook for 'update' event, please see here and gather details.

pavanlimo
TortoiseSVN is not a "GUI layer over core SVN". TortoiseSVN is an independently-developed app that leverages the published SVN libraries. It implements several features which are not in SVN.EXE, such as client-side hook scripts (one example). SVN hooks are server-side. They do not run when a user does SVN UPDATE on their local working copy.
William Leara
Oops!. Thanks for the info!
pavanlimo
"if the GUI supports, command-line has to!" -- who made that rule?
Joel J. Adamson
That's generally the case in Linux. In this case it's not really applicable though.
pavanlimo
Ok, I tried to delete this answer, it says I can't delete an accepted answer. I'll try to modify it instead.
pavanlimo