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

Re: GSOC Proposal draft: git-remote-svn

From
Jonathan Nieder <jrnieder@gmail.com>
Date
Apr 3, 2012, 00:09 UTC
Message-ID
<20120403000945.GA15075@burratino>
In-Reply-To
<4F7A3450.7000302@pileofstuff.org>
Andrew Sayers wrote:
> Sorry, that wasn't clear.  I meant commands that just expose a single
> primitive bit of functionality (like git-commit-tree) instead of those
> that present an abstract interface to the whole git machinery (like
> git-fast-import).

Ok. I think you are misunderstanding the purpose of fast-import[1] but it doesn't take away from what you're saying.

> I agree it's possible to use fast-import for this problem, but it seems
> like it's redundant after svn-fe has already loaded everything into git.

Right, I missed your point here before. The fundamental question is not about what commands to use but about the order of operations.

1. In one scheme, first you import the whole tree without splitting it
   into branches, with a tool like svn-fe.  Afterwards, you
   postprocess the resulting repository with tools like "git
   filter-branch --subdirectory-filter".  The result of the import can
   depend on all revisions --- you can say, in rev 1, "I'm not sure
   whether this new directory is a branch; let me see how it develops
   by rev 1000 to decide how to process it".
2. In another scheme, you only import the subset of the repository
   you are interested in.  This is what git-svn does, for example.
   This requires the branch discovery to happen at the same time as
   the import, because otherwise there is no way to tell what subset
   of the repository you are actually interested in.
3. Lastly, in yet another scheme, you import the whole tree and it is
   split into branches on the fly.  The advantages relative to (1) are:
   - impatient people can peek at the partial result of the import as
     it happens
   - the result of importing rev n is guaranteed to depend only on
     revs <= n, so different people importing at different times will
     get the same commits (assuming nobody is rewriting early history
     behind the scenes) and it is obvious how to support incremental
     importants to expand a repository with all revs <= n to a
     repository with all revs <= 2n
   However, if splitting branches only can happen during the initial
   import, that makes it harder to tweak the configuration and try
   again to see what changes.

The relevant technical difference is that in the naive implementation of scheme (2) you can make use of arbitrary information available over svn protocol, in naive scheme (3) you can only use information that makes it into the fast-import stream, and in naive scheme (1) you can only use information that makes it into the actual git repository. So to use scheme (1) you need to make sure svn-fe stores all interesting data in a visible way, including copyfrom info (which is not a bad idea anyway).

[...]
> The point I was making in IRC was that (so far as I understand)
> fast-import doesn't let you pass trees around in this way, but instead
> requires you to transmit the contents of all the changed files.

fast-import's "ls" command allows exactly what you are talking about, and svn-fe uses it to copy subtrees from earlier revs into later ones when it receives an "svn cp" command.

See [2] for some work that preexists that.

Did I understand correctly? Jonathan

[1] By acting as a single process that takes a stream of commands it really is able to do something that no other plumbing command can do. [2] http://thread.gmane.org/gmane.comp.version-control.git/158375

Previous: Andrew SayersNext: Andrew Sayers
Message 18 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.