Index: trunk/scripts/git-migration/filter-subdirs
===================================================================
--- trunk/scripts/git-migration/filter-subdirs	(revision 1898)
+++ trunk/scripts/git-migration/filter-subdirs	(revision 1898)
@@ -0,0 +1,23 @@
+#!/usr/bin/python
+
+import sys
+import os
+import subprocess
+
+tree = sys.argv[1]
+package = os.environ['PACKAGE']
+
+p = subprocess.Popen(['git', 'ls-tree',
+                      tree,
+                      package],
+                     stdout=subprocess.PIPE,
+                     stdin=subprocess.PIPE)
+p.wait()
+t = p.stdout.read().strip().split()
+
+if t != [] and t[1] == 'tree':
+    tree = t[2]
+
+subprocess.check_call(['git', 'commit-tree',
+                       tree] + sys.argv[2:],
+                      stdin=sys.stdin)
Index: trunk/scripts/git-migration/git-migrate
===================================================================
--- trunk/scripts/git-migration/git-migrate	(revision 1897)
+++ trunk/scripts/git-migration/git-migrate	(revision 1898)
@@ -61,4 +61,16 @@
     if len(p.stdout.read()) == 0:
         subprocess.check_call(['git', 'reset', '--soft', 'HEAD^'],
+                              cwd='%s.git' % pkg)
+    
+    # Early in the project's history, there were a bunch of double
+    # directory trees - i.e. the source was actually in
+    # trunk/packages/$package/$package. Correct for that
+    cwd = os.getcwd()
+    os.environ['PACKAGE'] = pkg
+    p = subprocess.check_call(['git', 'filter-branch',
+                               '--commit-filter', '%s "$@"' % os.path.join(cwd, 'filter-subdirs'),
+                               '--tag-name-filter', 'cat',
+                               '--',
+                               '--all'],
                               cwd='%s.git' % pkg)
     
