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

Question about git-svn import

From
Pascal Obry <pascal@obry.net>
Date
Dec 17, 2007, 17:18 UTC
Message-ID
<4766AF65.5060706@obry.net>
Hi,

You'll find a script into this message that reproduce what I'll describe below. Basically the Subversion repository add a given structure in the past then rearranged to use the "standard" structure. The former structure was:

   <root>
      |
      | - dir1
      | - dir2
The new one is:
   <root>
      |
      |- trunk
      |    | - dir1
      |    | - dir2
      |- branches
      |- tags

Now I want to import this project into Git (using git-svn) as the project won't leave Subversion for the moment. When doing:

   $ git svn clone -s <repo> <git-repo>

In git-repo we get only the commits done inside <root>/trunk and not the commits done in the former repository.

The question is what is the best way to deal with such a case with git-svn ?
Thanks.

############################ CUT HERE ############################# #!/bin/sh

REP=file://$(pwd)/repo
rm -fr repo co-repo git-repo
svnadmin create repo

svn co $REP co-repo cd co-repo mkdir dir echo file1 > dir/file1 svn add dir dir/file1 svn ci -m "ci1" dir dir/file1

svn mkdir -m "create trunk" $REP/trunk svn mkdir -m "create branches" $REP/branches svn mkdir -m "create tags" $REP/tags

svn move -m "move dir under trunk" $REP/dir $REP/trunk/dir

svn update sleep 2

echo file1 >> trunk/dir/file1 svn ci -m "ci2" trunk/dir/file1

sleep 2 svn update

cd ..

git svn clone -s $REP git-repo ############################ CUT HERE #############################

Pascal.
-- 
--|------------------------------------------------------
--| Pascal Obry                           Team-Ada Member
--| 45, rue Gabriel Peri - 78114 Magny Les Hameaux FRANCE
--|------------------------------------------------------
--|              http://www.obry.net
--| "The best way to travel is by means of imagination"
--|
--| gpg --keyserver wwwkeys.pgp.net --recv-key C1082595
Next: Steven Walter
Message 1 of 8 in “Question about git-svn import”
  1. Pascal ObryDec 17, 2007
  2. Steven WalterDec 18, 2007
  3. Pascal ObryDec 18, 2007
  4. Jörg SommerDec 18, 2007
  5. Pascal ObryDec 19, 2007
  6. Pascal ObryDec 20, 2007
  7. Jörg SommerDec 20, 2007
  8. Pascal ObryDec 21, 2007

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.