'How to handle duplicated SVN tags in with git-svn?
I am trying to clone/migrate an SVN repository with layout like below
trunk/
dev-branches/ # branches stored here
branches/ # tags stored here
some-duplicated-tag
releases/ # tags stored here (as well)
some-duplicated-tag
So the command for initialization was:
git svn init https://mycompany.com/svn/project \
--trunk=trunk \
--branches=dev-branches \
--tags=branches \
--tags=releases
This repo history is very long and convoluted, so there are duplicating tag names under releases/ and branches/ (illustrated above). But their history (log) is different.
The the fetching process of git-svn did stumble on some (but not all) these refs:
fatal: Invalid revision range 968311febed061cac3a0ee2cd767b97558963987..refs/remotes/repo-svn/tags/some-duplicated-tag
rev-list --pretty=raw --reverse 968311febed061cac3a0ee2cd767b97558963987..refs/remotes/repo-svn/tags/some-duplicated-tag --: command returned error: 128
I removed a revmap for that tag and fetch went on (by rebuilding the revmap and creating the Git ref):
rm .git/svn/refs/remotes/repo-svn/tags/some-duplicated-tag/.rev_map.${SVN_REPO_UUD}
After the checkout these refs only contain history from one of the sources (either from releases/ or tags/). How do I preserve both?
Solution 1:[1]
The solution for me was to give unique prefixes to the tags. Since Git supports refnames/like/this. This is how I edited my .git/config after running git svn init:
[svn-remote "svn"]
fetch = repo/trunk:refs/remotes/repo-svn/trunk
branches = repo/dev-branches/*:refs/remotes/repo-svn/*
tags = repo/releases/*:refs/remotes/repo-svn/tags/*
tags = repo/branches/*:refs/remotes/repo-svn/tags/tag-branches/*
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 |
