tags:

views:

132

answers:

1

hello,
in my scenario i maintain a svn-synchronized git repository on a server. all developers in my group use this repository to get their updates.
i couldn't find a way to trigger an automatic "git svn fetch" (or any other command) before a developer fetches the latest changes.
my current workaround is to have a cron job that syncs in svn related changes every 5 minutes. is it possible to have this kind of a pre-fetch hook at all?
thanks

A: 

There is no pre-defined hook that will allow you to do exactly what you want.

If your developers are fetching over ssh, you might be able to create a wrapper script for git-upload-pack which hides the real git-upload-pack and calls git svn fetch on the repository (while being absolutely sure to squash all output and errors) before execing the real git-upload-pack.

This might be quite fiddly to set up and make robust, though. You might be better off providing a way for your developers to manually cause a call to git svn fetch on the remote repository and encouraging them to use an alternative fetch alias that does this first (and waits for it to complete!) before doing the real fetch.

Charles Bailey
thanks charles,i was hoping differently but anyhow this does not present a major hurdle. our strategy with doing continuous updates seems to work out pretty well since this server is used for updates only and no one uses it to commit back to the svn server.you are right that the scenario you where describing sounds less then friendly to maintain so i think it's good like it is at the moment.
oliver