Converting the Drupal Script Library to Git usage.

UPDATE: I just rewrote the script library to deploy modules with drush instead of Git.  See my post on the subject.

The conversion of the Drupal project to Git took me somewhat by surprise.  I have recently found some time to upgrade my Drupal script library. Before the upgrade, this library used CVS to install Drupal and contributed modules and to query the status of installed components. Now that CVS usage is no longer supported, I had to modify the relevant scripts to check-out and update Drupal core and contributed modules via Git instead.

While I can completely understand the migration to Git from a developer standpoint.  Drupal is developed in a distributed manner and a distributed SCM system makes perfect sense.  Managing patches from many developers is a lot of work -- and being burdened with a crufty system like CVS just creates more work.  HOWEVER, Git is less than optimal to use as the basis for a pure Drupal implementor's role.  Because Git downloads the entire repository history on a clone, the size of an installed site skyrockets, taking longer to install and back-up.  This can be worked-around by using a zipfile based installation, but then one looses the ability to stay up-to-date to a branch.

Back to the modifications made to the Drupal Script Library...  The biggest changes are:

  • ->  The script was renamed to and modified to perform the same operations (install and update Drupal core and contrib modules/themes) via Git instead of CVS.  The associated library functions (in have been modified as well.
  • Along with the migration to Git, the Drupal central committee (whatever they're called) have modified branch names associated with the Drupal project.  This affects the branch naming schemes that need to be used when specifying a branch or tag name when installing or updating a component.
  • The script was renamed to and rewritten to retrieve available branch/tag information from the Git repos (using 'git remote-ls') rather than screen-scraping the old CVS repo browsing website.  (This is a definite improvement.)

The conversion is, as of this writing, not quite complete.  Items that are still pending are still tagged with 'TODO' comments within the script bodies.  These items will be addressed in the coming days.


(updated 7/23) I have checked in the final version of  From the header of that script:

# Migrates a site that was built using the old, now deprecated
# script to Git usage.  Using the script will
# result in an installation that (more closely) resembles one 
# built using
# At the end of the process, the previous state of the site will 
# exist with a ".<time/date-stamp>.old" suffix and the new Git-based
# site should exist in its place.

 (if you find any issues with this script, please let me know.)

Free Tag: