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

Re: Approaches to SVN to Git conversion

From
Phil Hord <phil.hord@gmail.com>
Date
Mar 7, 2012, 22:33 UTC
Message-ID
<CABURp0pLnMdFVgQ2+S_rW-KEjUBjKbEbMepEdPUkRJD+JQ_Ehg@mail.gmail.com>
In-Reply-To
<4F5690FB.9060800@pileofstuff.org>

On Tue, Mar 6, 2012 at 5:34 PM, Andrew Sayers <andrew-git@pileofstuff.org> wrote:

Show 18 quoted lines
> This is quite close to the implementation I've got.  The SVN exporter
> runs in two stages:
>
> In the first stage, the script treats any non-blacklisted file as a
> marker file, but only looks for trunk branches.  It looks all through
> the history, traces back through the copyfroms, and tries to find the
> original directory associated with the file.  Usually it decides that
> the only branch without a copyfrom is /trunk.  Searching just for trunks
> with this weak heuristic makes it much easier to hand-verify the result.
>
> In the second stage, the script looks through the history again, tracing
> the copies of known branches in a slightly less clever way than
> described in my previous e-mail.  There's no need for marker files this
> time round, as we just assume any `svn cp /trunk
> /directory/not/within/a/branch` is a new branch.  In my experiments this
> has been a pretty solid way of detecting branches without too much human
> input - I might be missing something (or have mis-explained something),
> but I'd be interested to hear examples of where this would go wrong.

I think what you're describing would work perfectly for my weird svn repo. I have branches named like this:

branches/developer/hordp/foo branches/developer/hordp/bar etc.

Since these were created with 'svn cp' originally, they would be properly considered branches by your algorithm, right? If so, sweet!

Show 23 quoted lines
> Having said that, here's a dodgy example I'd like to pre-emptively defend:
>
>        svn add tronk
>        svn ci -m "Created trunk" # r1
>        svn cp tronk trunk
>        svn ci -m "D'oh" # r2
>        svn rm tronk
>        svn add trunk/markerFile.txt
>        svn ci -m "Double d'oh!" # r3
>
> You could argue that the correct branch history description for the
> above would be:
>
>        In r3, create branch "trunk"
>
> In other words, ignore everything that happened before the marker file
> was created.  However, I would argue the following representation is
> more correct:
>
>        In r1, create branch "tronk"
>        In r2, create branch "trunk" from "tronk" r1
>        In r3, delete branch "tronk"
>
I prefer your interpretation. It doesn't look dodgy at all.
Phil
Previous: Andrew SayersNext: Nathan Gray
Message 18 of 22 in “[RFC] "Remote helper for Subversion" project”
  1. David BarrMar 3, 2012
  2. David BarrMar 3, 2012
  3. Jonathan NiederMar 4, 2012
  4. David BarrMar 4, 2012
  5. Andrew SayersMar 4, 2012
  6. Approaches to SVN to Git conversion (was: Re: [RFC] "Remote helper for Subversion" project)Stephen Bash, Mar 5, 2012
  7. Andrew SayersMar 5, 2012
  8. Stephen BashMar 6, 2012
  9. Nathan GrayMar 6, 2012
  10. Stephen BashMar 6, 2012
  11. Sam VilainMar 6, 2012
  12. Andrew SayersMar 7, 2012
  13. Sam VilainMar 7, 2012
  14. Andrew SayersMar 8, 2012
  15. Andrew SayersMar 6, 2012
  16. Sam VilainMar 7, 2012
  17. Andrew SayersMar 7, 2012
  18. Phil HordMar 7, 2012
  19. Nathan GrayMar 7, 2012
  20. Andrew SayersMar 7, 2012
  21. Jonathan NiederMar 4, 2012
  22. Ramkumar RamachandraMar 27, 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.