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

Re: cvs import

From
DCDaniel Carosone <dan@geek.com.au>
Date
Sep 13, 2006, 23:21 UTC
Message-ID
<20060913232139.GU29625@bcd.geek.com.au>
In-Reply-To
<20060913225200.GA10186@frances.vorpus.org>
On Wed, Sep 13, 2006 at 03:52:00PM -0700, Nathaniel Smith wrote:
Show 16 quoted lines
> This isn't trivial problem.  I think the main thing you want to avoid
> is:
>     1  2  3  4
>     |  |  |  |
>   --o--o--o--o----- <-- current frontier
>     |  |  |  |
>     A  B  A  C
>        |
>        A
> There are a lot of approaches one could take here, on up to pulling
> out a full-on optimal constraint satisfaction system (if we can route
> chips, we should be able to pick a good ordering for accepting CVS
> edits, after all).  A really simple heuristic, though, would be to
> just pick the file whose next commit has the earliest timestamp, then
> group in all the other "next commits" with the same commit message,
> and (maybe) a similar timestamp.  

Pick the earliest first, or more generally: take all the file commits immediately below the frontier. Find revs further below the frontier (up to some small depth or time limit) on other files that might match them, based on changelog etc (the same grouping you describe, and we do now). Eliminate any of those that are not entirely on the frontier (ie, have some other revision in the way, as with file 2). Commit the remaining set in time order. [*]

If you wind up with an empty set, then you need to split revs, but at this point you have only conflicting revs on the frontier i.e. you've already committed all the other revs you can that might have avoided this need, whereas we currently might be doing this too often).

For time order, you could look at each rev as having a time window, from the first to last commit matching. If the revs windows are non-overlapping, commit them in order. If the rev windows overlap, at this point we already know the file changes don't overlap - we *could* commit these as parallel heads and merge them, to better model the original developer's overlapping commits.

Show 7 quoted lines
> Handling file additions could potentially be slightly tricky in this
> model.  I guess it is not so bad, if you model added files as being
> present all along (so you never have to add add whole new entries to
> the frontier), with each file starting out in a pre-birth state, and
> then addition of the file is the first edit performed on top of that,
> and you treat these edits like any other edits when considering how to
> advance the frontier.
CVS allows resurrections too..
> I have no particular idea on how to handle tags and branches here;
> I've never actually wrapped my head around CVS's model for those :-).
> I'm not seeing any obvious problem with handling them, though.

Tags could be modelled as another 'event' in the file graph, like a commit. If your frontier advances through both revisions and a 'tag this revision' event, the same sequencing as above would work. If tags had been moved, this would wind up with a sequence whereby commits interceded with tagging, and we'd need to split the commits such that we could end up with a revision matching the tagged content.

> In this approach, incremental conversion is cheap, easy, and robust --
> simply remember what frontier corresponded to the final revision
> imported, and restart the process directly at that frontier.

Hm. Except for the tagging idea above, because tags can be applied behind a live cvs frontier.

-- Dan.

_______________________________________________ Monotone-devel mailing list Monotone-devel@nongnu.org http://lists.nongnu.org/mailman/listinfo/monotone-devel

Previous: Nathaniel SmithNext: Daniel Carosone
Message 28 of 38 in “Re: cvs import”
  1. Jon SmirlSep 13, 2006
  2. Martin LanghoffSep 13, 2006
  3. Markus SchiltknechtSep 13, 2006
  4. Oswald BuddenhagenSep 13, 2006
  5. Martin LanghoffSep 13, 2006
  6. Michael HaggertySep 14, 2006
  7. Jon SmirlSep 14, 2006
  8. Michael HaggertySep 14, 2006
  9. Martin LanghoffSep 14, 2006
  10. Michael HaggertySep 14, 2006
  11. Jon SmirlSep 14, 2006
  12. Martin LanghoffSep 14, 2006
  13. Markus SchiltknechtSep 13, 2006
  14. Jon SmirlSep 13, 2006
  15. Michael HaggertySep 14, 2006
  16. Shawn PearceSep 14, 2006
  17. Jakub NarebskiSep 14, 2006
  18. Shawn PearceSep 14, 2006
  19. Jon SmirlSep 14, 2006
  20. Michael HaggertySep 14, 2006
  21. Jakub NarebskiSep 14, 2006
  22. Jon SmirlSep 14, 2006
  23. Markus SchiltknechtSep 15, 2006
  24. Shawn PearceSep 16, 2006
  25. Oswald BuddenhagenSep 16, 2006
  26. Nathaniel SmithSep 16, 2006
  27. Nathaniel SmithSep 13, 2006
  28. Daniel CarosoneSep 13, 2006
  29. Daniel CarosoneSep 13, 2006
  30. Keith PackardSep 13, 2006
  31. Nathaniel SmithSep 14, 2006
  32. Jon SmirlSep 14, 2006
  33. Daniel CarosoneSep 14, 2006
  34. Shawn PearceSep 14, 2006
  35. Daniel CarosoneSep 14, 2006
  36. Petr BaudisSep 14, 2006
  37. Shawn PearceSep 14, 2006
  38. Shawn PearceSep 14, 2006

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.