Can git-svn correctly populate svn:mergeinfo properties?

Even though this is an old question, the current state of affairs with git-svn has changed since it was asked. Specifically, in git 1.7.5, there is some limited support for setting the svn:mergeinfo when dcommitting back to svn.

git svn dcommit now accepts the -mergeinfo=<mergeinfo> flag. To quote from the 1.7.5+ man page:

-mergeinfo=<mergeinfo>

Add the given merge information during the dcommit (e.g. –mergeinfo=”/branches/foo:1-10″). All svn server versions can store this information (as a property), and svn clients starting from version 1.5 can make use of it. git svn currently does not use it and does not set it automatically.

One should be very careful when using this though. Even though the man page says “add” what it really means is “replace”. That is, the svn:mergeinfo attribute is set based on what is passed, it does not add the specified revisions to the already existing svn:mergeinfo. Learn from my mistakeā€¦

Edit:

It appears that they are still working on improving this even further. As of git-svn 1.7.7, the following text was added to the git-svn man page:

config key: svn.pushmergeinfo

This option will cause git-svn to attempt to automatically populate the svn:mergeinfo property in the SVN repository when possible. Currently, this can only be done when dcommitting non-fast-forward merges where all parents but the first have already been pushed into SVN.

Leave a Comment