Multiple asterisks in mapping

In our previous post we explained, why there could be only one asterisk in a mapping path segment to prevent ambiguity. Since then we have received several requests for a workaround, and here it is! In SubGit version 3.2.6 and SVN Mirror Add-on version 3.3.9 multiple asterisks are allowed.

How it works

If you have complex branches’ names in SVN, you can split them into subfolders in Git, using asterisks as wildcards. If there are several asterisks in one mapping rule, the content of the first asterisk in SVN will be converted to the location mapped by the first asterisk in Git, the content of the second asterisk - to the second asterisk in Git, etc.

SVN

/branches
	/2017-version1/
	/2017-version2/

SubGit mapping

branches = branches/*version*:refs/heads/*/version/*

Git (after conversion)

/refs/heads
	/2017-
		/version
			/1
			/2

New feature: you can now use several asterisks in one segment. Please note, that in case of ambiguity the asterisk to the left has priority and is expanded to the maximum (“the greedy way”).

SVN

/branches/mostnewversion_newrelease

SubGit mapping

branches = branches/*new*:refs/heads/*/*

Git (after conversion)

/refs/heads/mostnewversion_/release

(Not /refs/heads/most/version_newrelease)

We hope you will enjoy this new feature and find it useful in your SVN to Git migration process.

Written on September 22, 2017