0

I'm using the KDE svn-all-fast-export to migrate over an ugly 22GB SVN repository to git. The old maintainers did some very weird branching. I'm running into a case where I need to make 2 branches for a single commit.

The tree looks like this

trunk
branch/lots-of_branches
tags/lots_of_tags

So far so good...

Now someone created a new folder, called 'new', by copying (svn copy) the top level tags and branch folder into 'new'. I'm not sure how to create a top level branch and tags folder and create the sub folders too.

My rules are as follows:

match /branch/([^/]+)/
  repository myrepo
  branch legacy/branch/\1
end match

match /tags/([^/]+)/
  repository myrepo
  annotated true
  branch refs/tags/legacy/\1
end match

This results in lots of branches called legacy/branch/branch_name, but no legacy/branch for the case described above. My questions is, is there a way to create a branch for each branch and also have another branch that updates each time the branch folder is modified?

EncryptedWatermelon
  • 4,788
  • 1
  • 12
  • 28

3 Answers3

0

You can get part way there with a symbolic-ref...

git symbolic-ref refs/heads/legacy-another-foo refs/heads/legacy-foo

Keep in mind if you checkout the reference git will not report it's symbolic name. so after git checkout legacy-another-foo, git status will report you're on legacy-foo

Can you just filter out the legacy folder and not import it?

I'm sorry your fore-bearers were 'creative'

thekbb
  • 7,668
  • 1
  • 36
  • 61
0

In pure git-svn's terms, you can tell multiple locations where tags and branches can be found. You would set up 2 locations for branches (one in branch and another in new/branch) and two locations for tags (one in tags and another in new/tags).

eftshift0
  • 26,375
  • 3
  • 36
  • 60
  • Same in SubGit, you can set multiple locations for branches and tags and send them into different namespaces in the Git repository. – ildar.hm Mar 22 '19 at 17:25
0

@thekbb Good idea, but I'm trying to maintain the history. My latest test is the run the current set of rules until it dies then rerun the importer with a different set to generate the top level refs.

Second set of rules:

match /branch/
  repository myrepo
  branch legacy/branch
end match

match /tags/
  repository myrepo
  branch legacy/tags
end

After that I'd resume the first set of results after the one commit

++++++++++++++++++ Update ++++++++++++++++++
This worked. The second pass is faster than the first since it ignores everything except the commits that touch /branch or /tags.

EncryptedWatermelon
  • 4,788
  • 1
  • 12
  • 28