Giter Club home page Giter Club logo

drupal-git-scripts's Introduction

drupal-git-scripts

This set of scripts allows Drupal developers full interoperation between an all-git local environment and Drupal's CVS repositories. "All-git environment" means that you can create a full drupal instance by cloning off of the git repositories created by this script. Core, contrib, everything. "Interoperation" means that your local repositories can chase very closely after CVS commits made in contrib, and seamlessly integrate those into the environment you've created using standard git fetch/merge type operations.

While these scripts can handle core, the repo generated will differ from the semi-canonical git mirror of core (http://github.com/drupal/drupal); these scripts strip CVS keywords in order to make CVS interoperation cleaner, but that mirror does not. This results in differing commit IDs. So you may want to use that mirror for core, instead.

Initial Setup

First step is configuring the drupal_sync.conf file, which will need to be placed at /etc/drupal_sync.conf. If you already have a local rsync'd copy of Drupal CVS on your system, make sure to set CVSSRV to the base of that CVS repository (i.e., to the parent directory containing the CVSROOT dir). Details on setting up an rsync'd local CVS mirror, can be found at http://drupal.org/node/277268, if needed.

Once your drupal_sync.conf file is appropriately placed, simply run the included drupal_sync script with the argument 'all':

$ drupal_sync all

This will update your local mirror, then build all the local git repositories. Bare repositories will be built and placed at:

# Contrib
$GITSRV/contrib/<modulename>.git
# Core
$GITSRV/drupal/drupal.git

Requirements

These scripts require rsync, cvs, cvsps, git, find, grep, sed. Nothin fancy.

drupal-git-scripts's People

Contributors

jpetso avatar neclimdul avatar sdboyer avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

drupal-git-scripts's Issues

Improvement suggestions

  • Use cd dirname $0 at the top of your script, then just use ./script to run the other scripts - so you don't have to require the script to be in $PATH.
  • It would be really cool if it would be possible to restrict the copy of the drupal CVS just a list of modules. As it is now it require quite a lot of space which is really a waste if one wants to use it just for working with a few modules.. :/

branches and tags

Guess this is a support issue as no one else has reported it, so sorry if this is obvious but if you can...

I somehow seem not to have the correct versions in line. Example cloning cvs_deploy that has just been created with the script:-

$ git clone -b DRUPAL-6--1 git://git.example.com drupal/contrib/cvs_deploy
...
$ grep version cvs_deploy.info
core = 7.x
$ git branch

  • DRUPAL-6--1
    $ git checkout DRUPAL-6--1-0 # last but one
    Note: moving to 'DRUPAL-6--1-0' which isn't a local branch
    If you want to create a new branch from this checkout, you may do so
    (now or later) by using -b with the checkout command again. Example:
    git checkout -b <new_branch_name>
    HEAD is now at 07d22a6... #220624 by Lynn: Fixed undefined variable warning.
    $ grep core cvs_deploy.info
    core = 6.x
    $ git checkout DRUPAL-6--1-1 # latest tag
    Previous HEAD position was 07d22a6... #220624 by Lynn: Fixed undefined variable warning.
    HEAD is now at 7049504... #235425 by dww: Fixed a bug that caused HEAD releases to always be considered "Not supported" during cron runs. This requires update module from Drupal core version 6.11 (#220592) to actually fix the bug, but the code here still works with older versions of core.
    $ grep core cvs_deploy.info
    core = 7.x

I can do this for other modules as well (but cvs_deploy is nice and simple to follow as there aren't many commits). Any idea where I'm going wrong? Cheers!

sed usage problem btwn GNU/BSD based systems

I believe you guys wrote this on a GNU system, so testing this out on Mac there seems to be a problem with how 'sed' is used.

Here is the output when nI try to run the sync:
Syncing directories for module, activity.
-> Updating git storage from CVS.

  • Building mirror of the cvsimport into a bare repo.
  • Updating CVS commit checkouts.
    -> Checking out DRUPAL-5--2 branch of the activity module directly from CVS (for git-cvsexportcommit)
    sed: 1: "/Users/jbitner/Sites/gi ...": invalid command code j
    sed: 1: "/Users/jbitner/Sites/gi ...": invalid command code j
    sed: 1: "/Users/jbitner/Sites/gi ...": invalid command code j
    -> Checking out DRUPAL-5--3 branch of the activity module directly from CVS (for git-cvsexportcommit)
    sed: 1: "/Users/jbitner/Sites/gi ...": invalid command code j
    sed: 1: "/Users/jbitner/Sites/gi ...": invalid command code j
    sed: 1: "/Users/jbitner/Sites/gi ...": invalid command code j
    sed: 1: "/Users/jbitner/Sites/gi ...": invalid command code j
    sed: 1: "/Users/jbitner/Sites/gi ...": invalid command code j
    sed: 1: "/Users/jbitner/Sites/gi ...": invalid command code j
    sed: 1: "/Users/jbitner/Sites/gi ...": invalid command code j
    sed: 1: "/Users/jbitner/Sites/gi ...": invalid command code j
    sed: 1: "/Users/jbitner/Sites/gi ...": invalid command code j
    sed: 1: "/Users/jbitner/Sites/gi ...": invalid command code j
    -> Checking out DRUPAL-5--4 branch of the activity module directly from CVS (for git-cvsexportcommit)
    sed: 1: "/Users/jbitner/Sites/gi ...": invalid command code j
    sed: 1: "/Users/jbitner/Sites/gi ...": invalid command code j
    sed: 1: "/Users/jbitner/Sites/gi ...": invalid command code j
    sed: 1: "/Users/jbitner/Sites/gi ...": invalid command code j
    sed: 1: "/Users/jbitner/Sites/gi ...": invalid command code j
    sed: 1: "/Users/jbitner/Sites/gi ...": invalid command code j
    sed: 1: "/Users/jbitner/Sites/gi ...": invalid command code j
    sed: 1: "/Users/jbitner/Sites/gi ...": invalid command code j
    sed: 1: "/Users/jbitner/Sites/gi ...": invalid command code j
    sed: 1: "/Users/jbitner/Sites/gi ...": invalid command code j
    sed: 1: "/Users/jbitner/Sites/gi ...": invalid command code j
    sed: 1: "/Users/jbitner/Sites/gi ...": invalid command code j
    sed: 1: "/Users/jbitner/Sites/gi ...": invalid command code j
    sed: 1: "/Users/jbitner/Sites/gi ...": invalid command code j
    sed: 1: "/Users/jbitner/Sites/gi ...": invalid command code j
    -> Checking out DRUPAL-6--1 branch of the activity module directly from CVS (for git-cvsexportcommit)
    sed: 1: "/Users/jbitner/Sites/gi ...": invalid command code j
    sed: 1: "/Users/jbitner/Sites/gi ...": invalid command code j
    sed: 1: "/Users/jbitner/Sites/gi ...": invalid command code j
    sed: 1: "/Users/jbitner/Sites/gi ...": invalid command code j
    sed: 1: "/Users/jbitner/Sites/gi ...": invalid command code j
    sed: 1: "/Users/jbitner/Sites/gi ...": invalid command code j
    sed: 1: "/Users/jbitner/Sites/gi ...": invalid command code j
    sed: 1: "/Users/jbitner/Sites/gi ...": invalid command code j
    sed: 1: "/Users/jbitner/Sites/gi ...": invalid command code j
    sed: 1: "/Users/jbitner/Sites/gi ...": invalid command code j
    sed: 1: "/Users/jbitner/Sites/gi ...": invalid command code j
    sed: 1: "/Users/jbitner/Sites/gi ...": invalid command code j
    sed: 1: "/Users/jbitner/Sites/gi ...": invalid command code j
    -> Checking out DRUPAL-6--2 branch of the activity module directly from CVS (for git-cvsexportcommit)
    sed: 1: "/Users/jbitner/Sites/gi ...": invalid command code j
    sed: 1: "/Users/jbitner/Sites/gi ...": invalid command code j
    sed: 1: "/Users/jbitner/Sites/gi ...": invalid command code j
    sed: 1: "/Users/jbitner/Sites/gi ...": invalid command code j
    -> Checking out master branch of the activity module directly from CVS (for git-cvsexportcommit)
    sed: 1: "/Users/jbitner/Sites/gi ...": invalid command code j
    sed: 1: "/Users/jbitner/Sites/gi ...": invalid command code j
    sed: 1: "/Users/jbitner/Sites/gi ...": invalid command code j
    sed: 1: "/Users/jbitner/Sites/gi ...": invalid command code j
    sed: 1: "/Users/jbitner/Sites/gi ...": invalid command code j
    sed: 1: "/Users/jbitner/Sites/gi ...": invalid command code j
    sed: 1: "/Users/jbitner/Sites/gi ...": invalid command code j
    sed: 1: "/Users/jbitner/Sites/gi ...": invalid command code j
    sed: 1: "/Users/jbitner/Sites/gi ...": invalid command code j
    sed: 1: "/Users/jbitner/Sites/gi ...": invalid command code j
    sed: 1: "/Users/jbitner/Sites/gi ...": invalid command code j
    sed: 1: "/Users/jbitner/Sites/gi ...": invalid command code j
    sed: 1: "/Users/jbitner/Sites/gi ...": invalid command code j
    sed: 1: "/Users/jbitner/Sites/gi ...": invalid command code j
    sed: 1: "/Users/jbitner/Sites/gi ...": invalid command code j
    sed: 1: "/Users/jbitner/Sites/gi ...": invalid command code j
    sed: 1: "/Users/jbitner/Sites/gi ...": invalid command code j
    sed: 1: "/Users/jbitner/Sites/gi ...": invalid command code j
    sed: 1: "/Users/jbitner/Sites/gi ...": invalid command code j
    sed: 1: "/Users/jbitner/Sites/gi ...": invalid command code j
    sed: 1: "/Users/jbitner/Sites/gi ...": invalid command code j
    sed: 1: "/Users/jbitner/Sites/gi ...": invalid command code j
    Syncing directories for module, flag_abuse.
    -> Updating git storage from CVS.
  • Building mirror of the cvsimport into a bare repo.
  • Updating CVS commit checkouts.
    -> Checking out DRUPAL-6--1 branch of the flag_abuse module directly from CVS (for git-cvsexportcommit)
    sed: 1: "/Users/jbitner/Sites/gi ...": invalid command code j
    sed: 1: "/Users/jbitner/Sites/gi ...": invalid command code j
    -> Checking out master branch of the flag_abuse module directly from CVS (for git-cvsexportcommit)
    sed: 1: "/Users/jbitner/Sites/gi ...": invalid command code j
    sed: 1: "/Users/jbitner/Sites/gi ...": invalid command code j
    Syncing directories for module, flag_friend.
    -> Updating git storage from CVS.
  • Building mirror of the cvsimport into a bare repo.
  • Updating CVS commit checkouts.
    -> Checking out DRUPAL-5 branch of the flag_friend module directly from CVS (for git-cvsexportcommit)
    sed: 1: "/Users/jbitner/Sites/gi ...": invalid command code j
    -> Checking out DRUPAL-6--1 branch of the flag_friend module directly from CVS (for git-cvsexportcommit)
    sed: 1: "/Users/jbitner/Sites/gi ...": invalid command code j
    sed: 1: "/Users/jbitner/Sites/gi ...": invalid command code j
    sed: 1: "/Users/jbitner/Sites/gi ...": invalid command code j
    -> Checking out master branch of the flag_friend module directly from CVS (for git-cvsexportcommit)
    sed: 1: "/Users/jbitner/Sites/gi ...": invalid command code j
    sed: 1: "/Users/jbitner/Sites/gi ...": invalid command code j
    sed: 1: "/Users/jbitner/Sites/gi ...": invalid command code j
    Syncing directories for module, smackdown.
    -> Updating git storage from CVS.
  • Building mirror of the cvsimport into a bare repo.
  • Updating CVS commit checkouts.
    -> Checking out DRUPAL-5--2 branch of the smackdown module directly from CVS (for git-cvsexportcommit)
    sed: 1: "/Users/jbitner/Sites/gi ...": invalid command code j
    -> Checking out DRUPAL-6--1 branch of the smackdown module directly from CVS (for git-cvsexportcommit)
    sed: 1: "/Users/jbitner/Sites/gi ...": invalid command code j
    -> Checking out master branch of the smackdown module directly from CVS (for git-cvsexportcommit)
    sed: 1: "/Users/jbitner/Sites/gi ...": invalid command code j

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.