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

Re: Importing merges when converting repos from SVN to Git

From
Benoit Sigoure <tsuna@lrde.epita.fr>
Date
Jan 21, 2008, 18:36 UTC
Message-ID
<A35436D5-71EA-4185-BBC1-4ECCE4D63A0E@lrde.epita.fr>
In-Reply-To
<47839311.2010606@viscovery.net>

Hi people, I wrote a script (svn-merge2git [1]) that helps to convert SVN merges to Git merges. The script basically detects the merges from their commit message and re-create them properly on the Git side. It took me several iterations to get it right but it eventually successfully converted a SVN repo with ~2500 revisions in a dozen of branches with ~100 merges in between them. The script can be used when one wants to entirely convert a SVN repo to a Git one while preserving the merges (that is, showing the merges in the Git history). I guess it can also be used to inject merges in the history of a git-svn repo to facilitate merging of SVN branches with Git, although I haven't had time to experiment this for now.

I hope this will be helpful to others.
[1] Code and explanations at: http://repo.or.cz/w/svn-merge2git.git
-- 
Benoit Sigoure aka Tsuna
EPITA Research and Development Laboratory
Previous: Johannes Sixt
Message 3 of 3 in “Importing merges when converting repos from SVN to Git (fusing grafts in the Git history)”
  1. Benoit SigoureJan 8, 2008
  2. Johannes SixtJan 8, 2008
  3. Benoit SigoureJan 21, 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.