At the minute we currently load common.inc manually and before any other drupal file. This can cause issues if anything in common.inc relies on bootstrap.inc.
As an example see catch's backport of cache array for pressflow 6.x , the CacheArrayObject if defined in bootstrap.inc and the schema implementation lives in common.inc. When trying to use drush with it, drush will error out with a fatal error complaining about CacheArrayObject not being defined.
common.inc is included in line 685 of includes/bootstrap.inc . It was introduced in commit 109b88fe43616ca0cf6c3e7f64dc884ed72a791b  by. It looks like the inclusion may have been a mistake. DRUSH_DRUPAL_SIGNATURE replaced DRUSH_DRUPAL_BOOTSTRAP which was actually being used for two purposes: to test if we're currently in a drupal directory and to bootstrap the site. The commit changed the file we look for to determine if we're in a drupal directory to common.inc and renamed the definition but it also kept the include (which now points to the wrong file). The inclusion of the bootstrap file is now handled by drush_drupal_version() .
I suggest just removing the include line as it doesn't seem to serve a purpose. I'll attach a patch in the first reply.
I tried running the included phpunit tests before and after the change. There didn't seem to be any change in the results (although there were failures both times).
The change will result in the drush bootstrap change when common.inc is available changing from DRUSH_BOOTSTRAP_DRUPAL_ROOT to DRUSH_BOOTSTRAP_DRUPAL_FULL. This didn't seem to cause any issues with any of the commands I tested. If it does result in an issue it may be better for the command to change it's bootstrap level or to manually load common.inc itself. If nothing else, discovering these commands will help us to document the reasons why drush includes common.inc early.
|#3||drush-7.x-5.x-dont-include-common.inc-early-1946408-3.patch||551 bytes||Dean Reilly|
|#1||drush-dont-include-common.inc-early-1946408-1.patch||427 bytes||Dean Reilly|