In the process of moving from SVN to git, we're evaluating the SVN Mirror Stash plugin (SubGit) in Stash.
One of our requirements is that the git revision hash be available in the SVN repo, either in a custom revprop, or through a JSON formatted log message.
Essentially I'm trying to do the reverse of what is described in this question.
I control both the git repo and the svn repo, and I'm happy to write a custom hook / script, but I haven't been able to find the appropriate place to insert this hook, either in the subgit or stash documentation. I'm also very interested in the best practice to insert such functionality.
Just a short summary after discussing this problem between @Brilliantnut and [email protected]:
Our team has decided to support special kind of revision properties that keep metadata information of corresponding Git commit: author, committer, timestamp, commit ID, etc.
I'll update this answer as soon as we publish new build with this feature implemented.
Update:
In order to set Git specific revision properties in Subversion repository, adjust SubGit configuration file as follows:
and then run
subgit install
in order to activate this configuration update:After that SubGit sets the following properties for every revision it converts from Git to SVN:
You can also choose which properties to set by adjusting configuration option:
There are the following limitations for this feature:
subgit:* revision properties are not set on those revisions that were committed by SVN users and not converted from Git commits by SubGit;
If one adds/removes new Git branch or tag on a commit which is already synchronized with SVN repository, SubGit creates a new SVN revision which has no subgit:* properties set.