git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Migrate svn non-standard layout to git

From
JGJim Garrison <jim.garrison@nwea.org>
Date
Oct 29, 2013, 20:04 UTC
Message-ID
<0C723FEB5B4E5642B25B451BA57E273041FD42F6@S1P5DAG3C.EXCHPROD.USA.NET>
I have the following SVN setup:
    Repository: http://svn-server:81/svn/DevJava
    Trunk: trunk/etl_app
    Branches: branches/etl_app
    Tags: tags/etl_app
After reading the manual and git-svn man page I tried the following command in ~/src
    git svn clone -T trunk/etl_app -b branches/etl_app -t tags/etl_app --authors-file=users.txt --no-metadata http://svn-server:81/svn/DevJava etl_app
This results in outputting this
    Initialized empty Git repository in /home/jim.garrison/git/etl_app/.git/
And then.... nothing. It appears to hang, but is consuming about 10% CPU and no I/O as far as I can determine.  I let it run for 30 minutes and checked the contents of the etl_app subdirectory from another terminal session but it never produced any more terminal output or wrote anything to the local disk.
Then I tried using full URLs for -T -t and -b and got:
    Initialized empty Git repository in /home/jim.garrison/git/etl_app/.git/
    Using higher level of URL: http:// svn-server:81/svn/DevJava/trunk/etl_app => http:// svn-server:81/svn/DevJava
    perl: subversion/libsvn_subr/path.c:115: svn_path_join: Assertion `svn_path_is_canonical(component, pool)' failed.
    error: git-svn died of signal 6
By accident, I discovered that the following command gets farther:
    git svn clone -T trunk/etl_app -b branches/etl_app -t tags/etl_app --authors-file=users.txt --no-metadata http:// svn-server:81/svn/DevJava/trunk/etl_app etl_app
    Initialized empty Git repository in /home/jim.garrison/git/etl_app/.git/
    Using higher level of URL: http:// svn-server:81/svn/DevJava/trunk/etl_app => http:// svn-server:81/svn/DevJava
    W: Ignoring error from SVN, path probably does not exist: (160013): Filesystem has no item: File not found: revision 100, path '/trunk/etl_app'
    W: Do not be alarmed at the above message git-svn is just searching aggressively for old history.
    This may take a while on large repositories
    Checked through r40200
This takes a few minutes but finally completes "successfully". 
In the Git online book's migration chapter it then says to execute a couple of commands to move the svn tags and branches to proper Git tags and branches.
    git for-each-ref refs/remotes/tags | cut -d / -f 4- | grep -v @ | while read tagname; do git tag "$tagname" "tags/$tagname"; git branch -r -d "tags/$tagname"; done
    git for-each-ref refs/remotes | cut -d / -f 3- | grep -v @ | while read branchname; do git branch "$branchname" "refs/remotes/$branchname"; git branch -r -d "$branchname"; done
However, neither of the "for-each-ref" commands produces any output, so these are effectively no-ops.
Can someone explain what's going on? How do I get the svn tags and branches fetched so I can migrate the svn repository to git without losing them?
Thanks
Message 1 of 1 in “Migrate svn non-standard layout to git”
  1. Jim GarrisonOct 29, 2013

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.