0

I have a git repository cloned from SVN with std layout a while ago. (It was done with git svn init and git svn fetch). Now I am using git 1.7.9. My svn-remote config section looks like this:

[svn-remote "svn"]
        url = https://myhost/svn/myProject
        fetch = trunk:refs/remotes/trunk
        branches = branches/*:refs/remotes/*
        tags = tags/*:refs/remotes/tags/*

All branches that were initially fetched work correctly, subsequent fetches are also correct on these branches and on trunk. The directory structure looks like this under each branch:

subProject1\src\myPackage
subProject2\src\
subProject3\src\

Now a new branch called 2_7_1 was created with matching the directory structure of all other branches and the trunk.

Now when I run git svn fetch it starts fetching each revision from r1 instead of only fetching it from the revision where 2_7_1 branch was created from trunk. The reason seems to be that it assumes: src\myPackage directory structure instead of subProject1\src\myPackage, so it starts fetching all revisions starting from r1.

When I browse the SVN repo in a browser I see no difference in the directory structure. I noticed only one difference that the new branch is called 2_7_1@18813 (18813 is the start revision number of the new branch) where all other branches do not contain the revision, only the branch name.

I do not want to do a use the solution provided here: How do I tell git-svn about a remote branch created after I fetched the repo? , because it would lose the common parent for trunk and 2_7_1 branch.

Edit: After doing a full git svn fetch it has become clear for me that my git svn sees two branches: 2_7_1 and 2_7_1@18813. 2_7_1@18813 was fetched from revision #1. And this messed up my master branch earlier tracking the SVN trunk.

Now my branch structure looks like this (a complete mess):

------------------------------------------- X -- Y -- Z  ==  masterNew/trunk

-- A -- B -- C -- D -- E -- F -- G ----  == 2_7_1@18813
                                    \  \
                                     \  \ - J - K - L == master (old trunk)
                                      \
- A' - B' - C' - D' - E' - F' - G' -- H -- I == 2_7_1

Edit #2: After doing a full clone of the SVN repo with git svn clone the problem still persist.

Community
  • 1
  • 1
balapal
  • 41
  • 1
  • 6

1 Answers1

0

You could branch from the common parent into the 2_7_1 branch, then rig that branch to git-svn with the instructions from How do I tell git-svn about a remote branch created after I fetched the repo?

Community
  • 1
  • 1
robrich
  • 13,017
  • 7
  • 36
  • 63
  • In SVN 2_7_1 was branched from trunk revision number #18813, so the common parent of trunk and 2_7_1 in SVN is r18813. – balapal Feb 20 '13 at 15:48