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

[RFC] mtn to git conversion script

From
Felipe Contreras <felipe.contreras@gmail.com>
Date
Aug 24, 2008, 09:18 UTC
Message-ID
<94a0d4530808240218j4bedbe3di99303da9addc93a4@mail.gmail.com>
Hi,

I developed a script that converts a monotone repository into a git one (exact clone), I want to contribute it so everybody can use it.

However, I might have not done it correctly.
This is the gist of the script:

mtn update --revision #{@id} --reallyquiet git ls-files --modified --others --exclude-standard -z | git update-index --add --remove -z --stdin git write-tree git write-raw < /tmp/commit.txt git update-ref refs/mtn/#{@id} #{@git_id}

branches.each do |e|
    git update-ref refs/heads/#{e} #{@git_id}
end

I wrote "git write-raw" which takes the commit text as is, and puts it into the repository.

I've read about 'fast-import' but I'm not sure if it would be more efficient, because you would have to parse the output of different mtn tools.

What do you think? Does it makes sense to have a 'write-raw' command? Or should I somehow use 'fast-import'?

Best regards.
-- 
Felipe Contreras
Next: Miklos Vajna
Message 1 of 21 in “[RFC] mtn to git conversion script”
  1. Felipe ContrerasAug 24, 2008
  2. Miklos VajnaAug 24, 2008
  3. Johannes SchindelinAug 24, 2008
  4. Miklos VajnaAug 24, 2008
  5. Felipe ContrerasAug 24, 2008
  6. Shawn O. PearceAug 24, 2008
  7. Felipe ContrerasAug 25, 2008
  8. Anand KumriaAug 28, 2008
  9. Felipe ContrerasAug 28, 2008
  10. Felipe ContrerasSep 4, 2008
  11. Jakub NarebskiSep 4, 2008
  12. Felipe ContrerasSep 4, 2008
  13. Thomas MoschnySep 4, 2008
  14. Felipe ContrerasSep 4, 2008
  15. Brian DowningAug 25, 2008
  16. Brian DowningAug 25, 2008
  17. Felipe ContrerasAug 25, 2008
  18. Brian DowningAug 25, 2008
  19. Anand KumriaAug 28, 2008
  20. Juan Jose ComellasNov 11, 2008
  21. Juan Jose ComellasNov 11, 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.