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

Re: GSOC Proposal draft: git-remote-svn

From
ASAndrew Sayers <andrew-git@pileofstuff.org>
Date
Apr 14, 2012, 21:35 UTC
Message-ID
<4F89EDBF.9050906@pileofstuff.org>
In-Reply-To
<1472353.TRfidGPc01@flomedio>

On a slightly different topic, here's the only branching edge case I know of that will affect you. I agree with Jonathan that you should focus on the standard layout for now, but I think it's worth having the trickier cases in your head when you're planning things out.

Imagine a team does this:
# Slight misunderstanding of the standard layout at first:

mkdir trunk/project1 trunk/project2 svn add trunk svn ci -m "Initial revsion" # r1

# Time passes, commits are made, people get smarter. # In revision 1000, the team decides to put the structure right:

svn rm trunk svn ci -m "Removed incorrect directory name" # r1000

mkdir trunk touch trunk/MOVED_TO_PROJECT_TRUNK svn ci -m "Added signpost file for future reference" # r1001

mkdir project1 project2 svn cp -r 999 trunk/project1 project1/trunk svn cp -r 999 trunk/project2 project2/trunk svn ci -m "Recreated projects with correct directory names" # r1002

This would be represented in SBL something like:

In r1, create branch "trunk/project1" In r1, create branch "trunk/project2"

# We would prefer just to deactivate these... In r1000, deactivate "trunk/project1" In r1000, deactivate "trunk/project2"

# ... but we have to delete them, # because git doesn't support recursive branch names: In r1001, delete branch "trunk/project1" In r1001, delete branch "trunk/project2" In r1001, create branch "trunk"

# We deleted the branches, so how do we get the commit to fork from? In r1002, create branch "project1/trunk" from "trunk/project1" r999 In r1002, create branch "project2/trunk" from "trunk/project2" r999

If you look in your ".git/refs/heads/" directory, you'll see git branches are stored as files on disk. So if you have a branch "trunk/project1", you can't create a branch called "trunk" unless you delete the directory called "trunk" first. This unfortunate limitation of an otherwise neat solution means you can't reliably use git branches when retrieving older revisions.

Other people will be able to tell you if there's any interest in removing this limitation, but even if there is, users will occasionally change their mind after asking for a branch to be deleted, and be surprised if SVN lets them but git doesn't.

One solution you could look at would be storing dead branches in a JSON file somewhere. If you go down that route, remember that `git gc` will try to garbage collect the commits once the branches have been dead for long enough.

	- Andrew
Previous: Florian AchleitnerNext: Stephen Bash
Message 39 of 46 in “GSoC intro”
  1. Florian AchleitnerMar 19, 2012
  2. Andrew SayersMar 19, 2012
  3. Florian AchleitnerMar 20, 2012
  4. David BarrMar 20, 2012
  5. Florian AchleitnerMar 21, 2012
  6. Ramkumar RamachandraMar 26, 2012
  7. Florian AchleitnerMar 27, 2012
  8. GSOC Proposal draft: git-remote-svnFlorian Achleitner, Apr 2, 2012
  9. Ramkumar RamachandraApr 2, 2012
  10. Jonathan NiederApr 2, 2012
  11. Jonathan NiederApr 2, 2012
  12. Florian AchleitnerApr 3, 2012
  13. Jonathan NiederApr 3, 2012
  14. Tomas CarneckyApr 5, 2012
  15. Andrew SayersApr 2, 2012
  16. Jonathan NiederApr 2, 2012
  17. Andrew SayersApr 2, 2012
  18. Jonathan NiederApr 3, 2012
  19. Andrew SayersApr 3, 2012
  20. Jonathan NiederApr 3, 2012
  21. Florian AchleitnerApr 5, 2012
  22. Dmitry IvankovApr 5, 2012
  23. Stephen BashApr 9, 2012
  24. Jonathan NiederApr 10, 2012
  25. Andrew SayersApr 10, 2012
  26. Jonathan NiederApr 10, 2012
  27. Florian AchleitnerApr 11, 2012
  28. Andrew SayersApr 14, 2012
  29. Jakub NarebskiApr 11, 2012
  30. Jonathan NiederApr 11, 2012
  31. Florian AchleitnerApr 11, 2012
  32. Dmitry IvankovApr 11, 2012
  33. Jonathan NiederApr 11, 2012
  34. Andrew SayersApr 11, 2012
  35. Thomas RastApr 12, 2012
  36. Florian AchleitnerApr 12, 2012
  37. Andrew SayersApr 12, 2012
  38. Florian AchleitnerApr 14, 2012
  39. Andrew SayersApr 14, 2012
  40. Stephen BashApr 15, 2012
  41. Jonathan NiederApr 13, 2012
  42. Florian AchleitnerApr 14, 2012
  43. Florian AchleitnerApr 18, 2012
  44. Florian AchleitnerApr 19, 2012
  45. Miles BaderMar 28, 2012
  46. Dmitry IvankovMar 28, 2012

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.