title: Nested branches, variable depth
body: <p>We have a large, quite old SVN repository that we'd like to migrate to git. Unfortunately, our branch structure is quite tricky; it has nested branches of varying depth, with some branches living alongside nested folders:</p>
  
  <pre><code>branches/
           branch1/
           branch2/
           teams/
                 team1/
                       projectBranch1
                 team2/
                       projectBranch2
  </code></pre>
  
  <p>In my git config, I have tried</p>
  
  <pre><code>branches = branches/*/*/*:refs/remotes/origin/*/*/*
  </code></pre>
  
  <p>which has imported the team branches fine, but when fetching updates to "branch1", it treats the first few project directories as part of the branch name, creating branches like <code>branch1/src/com/</code>. I then tried:</p>
  
  <pre><code>branches = branches/teams/*/*:refs/remotes/origin/teams/*/*
  branches = branches/*:refs/remotes/origin/*
  </code></pre>
  
  <p>hoping that commits to team projects would be matched first, and the first-level wildcard only used for top-level branches. But it then reverts to treating team branches as subdirectories of the "teams" branch. I then hoped reversing the order of the terms in the config file might change the matching order, but that didn't seem to make a difference.</p>
  
  <p>I have managed to get a clean migration from recent revisions by tweaking the top-level wildcard to match only certain names, so that there is no ambiguity between the two <code>branches</code> terms. But ideally I'd like to migrate from older revisions, where the top-level branch names are less easily picked out. Is there any way to persuade git-svn to match <code>branches</code> entries using a "most specific first" rule?</p>