svn-all-fast-export / svn2git

:octopus: A fast-import based converter for an svn repo to git repos
GNU General Public License v3.0
262 stars 100 forks source link

Rules in the form /project/tags/([^/]+)/dir_name/ are not being fetched into the new git-repository #83

Open mono-princess opened 4 years ago

mono-princess commented 4 years ago

The structure of my svn repository looks similar to this:

/Poject/
    trunk/
        dir1/
        dir2/
        dir3/
         ...
         dir<n>/
    branches/
        branch_1/
            dir1/           
            dir2/           
            dir3/    
        branch_2/
            dir1/           
            dir2/           
            dir3/        
            ...
            dir<n>/ 
    tags/
        tag_1/
            dir1/           
            dir2/           
            dir3/    
        tag_2/
            dir1/           
            dir2/           
            dir3/     
            ...      
            dir<n>/

In reality there are several branches and several tags. Most of the tags were generated after the branches and the name of these tags is the same as the corresponding branch. The repository has over 26000 revisions.

The svn-repository is splitted into several git repositories (in total 8) where some of the directories (dir1, ..., dir<n>) were grouped together, for example:

Here is the rules file for this repository:

# Declare the repositories we know about:
#

create repository git_repo_1 
end repository
create repository git_repo_2
end repository
create repository git_repo_3
end repository

#
# git_repo_1 
#
# git_repo_1 = dir1 + dir4 +dir5
#

match /Project/trunk/(dir1|dir4|dir5)/
  repository git_repo_1 
  prefix \1/
  branch master
end match
match /Project/branches/([^/]+)/(dir1|dir4|dir5)/
  repository git_repo_1 
  prefix \2/
  branch \1
end match
match /Project/tags/([^/]+)/(dir1|dir4|dir5)/
  repository git_repo_1 
  prefix \2/
  branch refs/tags/v\1
  annotated true
end match

#
# git_repo_2 = dir2
#

match /Project/trunk/dir2/
  repository git_repo_2
  branch master
end match
match /Project/branches/([^/]+)/dir2/
  repository git_repo_2 
  branch \1
end match
match /Project/tags/([^/]+)/dir2/
  repository git_repo_2
  branch refs/tags/v\1
  annotated true
end match

#
# git_repo_3
#
# git_repo_3= dir6 + dir10
#

match /Project/trunk/(dir6 |dir10)/
  repository git_repo_3
  prefix \1/
  branch master
end match
match /Project/branches/([^/]+)/(dir6 |dir10)/
  repository git_repo_3
  prefix \2/
  branch \1
end match
match /Project/tags/([^/]+)/(dir6 |dir10)/
  repository git_repo_3
  prefix \2/
  branch refs/tags/v\1
  annotated true
end match

match /
end match

Results:

Questions:

Why are the tags not fetched?

Why did the message recursiveDumpDir appear in the logs even though none of the match definitions contains the parameter action export and all them have defined the parameter repository?

Vampire commented 4 years ago

You probably need a rule before the other tag rules for /Project/tags/([^/]+)/$ with action recurse. A tag is usually a copy of the entire directory like /Project/trunk => /Project/tags/tag-1. In this case svn2git does only see these paths and your tag rules do not match. You have to tell it to recurse into the directories to identify the actual rules to apply.

As for the skip message, I have no idea without a reproduction script.