Coder Social home page Coder Social logo

2git's Introduction

maintainer
praqma-thi

2git

The 2git project is an SCM migration engine allowing you to migrate to git through a Groovy DSL. Script your migration and execute it by passing it to the 2git engine. If you don't like what you see, tweak your recipe and run it again, until you get the perfect migration.

Getting started

Currently, 2git supports migrating from ClearCase and ClearCase UCM. The current quickstart guide is found at 2git.io/getting-started.

User documentation

For detailed information and docs, please refer to 2git.io.

Workflow and concepts

Independent of the source VCS, 2git follows a simple, but flexible, migration workflow. The 2git DSL is used to build up a migration plan, which is then executed by the migration engine.

  • Build a migration plan
    1. Select source snapshots matching defined criteria
    2. Assign actions to selected snapshots
  • Execute the migration plan
    1. Checkout the next source snapshot
    2. Execute the snapshot's assigned actions
    3. Repeat

The migration plan

The migration plan is built by defining filters in the 2git DSL.

Filters are used to structure your migration plan, they can contain criteria, extractions, actions and child filters.

Criteria are used to select your source's snapshots (commits, baselines, etc.). Snapshots that match a filter's criteria will have that filter's extractions and actions mapped to it in the migration plan.

Ex.: Created after a certain date, commit message matches a regex, etc.

Extractions are executed per snapshot during the actual migration to extract metadata which can be used in the actions.

Ex.: Read a file's contents from your workspace, read certain commit attributes, etc.

Actions are executed per snapshot during the migration to perform various actions. This is where the bulk of the actual migration will take place

Ex.: Commit files to git, delete some files, execute a script, etc.

Example migration

The following hypothetical repository contains some commits, tagged with metadata.

commits

We'll define an example filter structure to build up our migration plan:

filter {
    criteria {
        afterDate('15-05-2015')
    }
    actions {
        commit()
    }
    filter {
        criteria {
            minimumX(5)
        }
        extractions {
            custom {
                return  [myVersion: readFile('version.txt')]
            }
        }
        actions {
            tag("qualified-$myVersion")
        }
    }
}

The first filter selects all snapshots created past the defined date and assigns the 'commit' action to them. The second filter, being a child of the first, further filters on the selected snapshots. It selects those with 'x' at 5 or above and assigns the custom extraction and 'tag' action to them.

The resulting migration plan that will be executed is the following:

Snapshot Extractions Actions
A N/A N/A
B N/A N/A
C readFile commit, tag
D N/A commit
E readFile commit, tag

Contributing

Feel like chipping in? Check our contribution guidelines for more information!

2git's People

Contributors

a208419 avatar fallenpixel avatar jkrag avatar lakruzz avatar madsnielsen avatar praqmasupport avatar timea avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.