Open friesoft opened 11 years ago
Standard git hooks (vs stash repository hooks) are shell scripts, so one option would be to investigate the REST api exposed by Stash. It may not be possible to force an AsyncPostReceiveHook to run via current REST operations and may require adding additional operations for this hook.
Frankly this sounds like a fair amount of effort and I would personally work around this by running subgit on a different server and push the changes to the Stash server.
Please feel free to submit a pull request if you want to contribute.
Hi,
I'm one of SubGit developers and I've just come across your discussion here.
Indeed, current version (both SubGit 2.0.x and SVN Mirror Add-on 2.0.x) do not trigger any Git/Stash hooks when translating SVN revisions to Git commits. That's something we're going to fix a bit later. Please follow the issue for more updates on that: http://issues.tmatesoft.com/issue/SG-34
From Git mirror side it would make sense to attempt mirroring new commits periodically in order to workaround the issue.
Has any work been carried out on this yet? I noticed it's tagged as wontfix, is there a reason for that? It would be great if it fired the hooks when translating SVN into Git commits.
@alasdairdc, I haven't looked at this plugin for a while, but it is due for some attention. If subgit does not trigger the Stash web hooks to run, there is not much the stash-hook-mirror plugin can do.
Do you have a suggestion on how to handle this?
ah okay its down to subgit. may take a look at it and see if theres anything that can be done.
Updates from our side:
Since version 3.0 it is possible to make SubGit trigger user-post-receive
hook every time it fetches new changes from SVN repository:
$ edit REPO/subgit/config
[svn]
...
triggerSvnPostReceive = true
$ subgit install REPO
So, this should be possible to trigger necessary Stash hooks from user-post-receive
in order to enable mirroring for changes arrived from SVN repository.
SVN Mirror add-on for Atlassian Stash
Since version 2.0.15 our plugin fires SvnFetchEvent implements RepositoryRefsChangedEvent every time it fetches new changes from SVN repository. I think it makes a lot of sense for Git mirroring plugin to listen to updated refs via RepositoryRefsChangedEvent mechanism. If that is done, the mirroring should work properly.
Hi,
I'm using Atlassian Stash 2.5.0 with SubGit 2.0.0 and Repository Mirroring 1.3.0.
The repository is set to sync to and with SubGit. As long as I commit from git and push it works - as soon as I'm commiting from within SVN it doesn't work (the push is not recognized and the changes are not mirrored to the remote mirror).
You have already answered me in the reviews of the addon:
How do I create such a trigger?
Regards, Bernhard Friedreich