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

Re: Migrating svn to git with heavy use of externals

From
D. Stuart Freeman <stuart.freeman@et.gatech.edu>
Date
Apr 8, 2008, 20:49 UTC
Message-ID
<47FBDA77.2050402@et.gatech.edu>
In-Reply-To
<32541b130804081306q6e06af20u794357eba9d434e@mail.gmail.com>
Avery Pennarun wrote:
Show 30 quoted lines
> On Tue, Apr 8, 2008 at 2:07 PM, D. Stuart Freeman
> <stuart.freeman@et.gatech.edu> wrote:
>> Maybe I should clarify.
>>  I've imported an svn managed project into a git repository
>>  with 71 submodules, what I don't understand though is if I
>>  have a branch called 2-5-x and another called 2-4-x in each of
>>  the submodules and the superproject, is there a way to
>>  associate those?
> 
> I don't think git-svn currently knows how to import svn:externals
> properly.  Basically you'd have to do it yourself, perhaps with the
> help of something like git-filter-branch and a shell script.
> 
> The equivalent of svn:externals in git is called git-submodule, and
> it's actually much more powerful than svn:externals, because you can
> link to a *specific revision* and not just a branch.  In other words,
> I can set up my application to point at r2956 of a library, so even if
> the library changes in the future, my application always gets exactly
> that version.  (To have the app use the later version, you have to
> 'git pull' in the submodule, then make a commit in the application
> module.)
> 
> See "man git-submodule" and "man git-filter-branch" for more information.
> 
> If I'm wrong and git-svn already supports svn:externals, I'm sure
> someone will correct me :)
> 
> Have fun,
> 
> Avery

It's possible to have svn:externals point at a specific revision, but that's not the point. I'm convinced that submodules are the answer, I'm just not sure how to make them work. Assume "sakai" is the superproject and "access" is a submodule, I've done:

cd sakai git checkout work git submodule add ../access access

And that's cool, but then I do:

cd ../access git checkout -b 2-5-x sakai_2-5-x # sakai_2-5-x is an svn import cd ../sakai git checkout -b 2-5-x sakai_2-5-x git submodule add -b 2-5-x ../access access

Which gives me an error about access already existing. I'm pretty sure I'm just not thinking about this the way git does, I blame svn for damaging my brain.

-- 
D. Stuart Freeman
Georgia Institute of Technology


begin:vcard
fn:D. Stuart Freeman
n:Freeman;Douglas
email;internet:stuart.freeman@et.gatech.edu
tel;work:(404)385-1473
x-mozilla-html:FALSE
version:2.1
end:vcard
Previous: Avery PennarunNext: Avery Pennarun
Message 4 of 48 in “Migrating svn to git with heavy use of externals”
  1. D. Stuart FreemanMar 31, 2008
  2. D. Stuart FreemanApr 8, 2008
  3. Avery PennarunApr 8, 2008
  4. D. Stuart FreemanApr 8, 2008
  5. Avery PennarunApr 8, 2008
  6. D. Stuart FreemanApr 8, 2008
  7. Roman ShaposhnikApr 9, 2008
  8. Avery PennarunApr 9, 2008
  9. Roman ShaposhnikApr 9, 2008
  10. Avery PennarunApr 9, 2008
  11. Junio C HamanoApr 9, 2008
  12. Intricacies of submodules [was: Migrating svn to git with heavy use of externals]Roman Shaposhnik, Apr 10, 2008
  13. Junio C HamanoApr 10, 2008
  14. Roman ShaposhnikApr 10, 2008
  15. Junio C HamanoApr 11, 2008
  16. Ping YinApr 11, 2008
  17. Junio C HamanoApr 11, 2008
  18. Roman ShaposhnikApr 12, 2008
  19. Junio C HamanoApr 12, 2008
  20. Roman ShaposhnikApr 14, 2008
  21. Junio C HamanoApr 15, 2008
  22. Ping YinApr 15, 2008
  23. Roman V. ShaposhnikApr 16, 2008
  24. Jeremy Maitin-ShepardApr 17, 2008
  25. Linus TorvaldsApr 17, 2008
  26. Junio C HamanoApr 17, 2008
  27. Roman V. ShaposhnikApr 17, 2008
  28. Martin LanghoffApr 17, 2008
  29. Junio C HamanoApr 17, 2008
  30. Sverre RabbelierApr 17, 2008
  31. Martin LanghoffApr 17, 2008
  32. Sverre RabbelierApr 17, 2008
  33. Martin LanghoffApr 17, 2008
  34. Ping YinApr 18, 2008
  35. Dmitry PotapovApr 17, 2008
  36. Linus TorvaldsApr 17, 2008
  37. Ping YinApr 18, 2008
  38. Jakub NarebskiApr 18, 2008
  39. Ping YinApr 12, 2008
  40. Roman ShaposhnikApr 14, 2008
  41. Ping YinApr 12, 2008
  42. Junio C HamanoApr 12, 2008
  43. Ping YinApr 12, 2008
  44. Ping YinApr 10, 2008
  45. Roman ShaposhnikApr 10, 2008
  46. Intricacies of submodules [was: Migrating svn to git with heavy use of externals]Roman Shaposhnik, Apr 9, 2008
  47. Avery PennarunApr 9, 2008
  48. Avery PennarunApr 18, 2008

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.