var childProcess = require('child_process'),
    fs = require('fs'),
    path = require('path'),
      dirname = path.dirname;

module.exports = {
  currentBranch: function(path, callback) {
    childProcess.exec('git symbolic-ref -q HEAD', {cwd: path}, function(err, stdout) {
      var currentBranch = stdout.split('\n')
          .filter(function(branch) { return branch; })
          .map(function(branch) { return branch.replace(/^refs\/heads\//, ''); })[0];
      callback(err, currentBranch);
    });
  },

  generate: function(configSource, output, callback) {
    fs.readFile(configSource, function(err, data) {
      if (err) {
        return callback(err);
      }

      data = JSON.parse(data);
      data.release = true;

      module.exports.currentBranch(dirname(configSource), function(err, branch) {
        if (err) {
          return callback(err);
        }

        // Copy over the index source file.
        try {
          var index = fs.readFileSync(dirname(configSource) + '/index.js');
          fs.writeFileSync(dirname(output) + '/index.js', index);
        } catch (err) {
          return callback(err);
        }

        data.name += '-' + branch.replace(/^release\//, '');
        fs.writeFile(output, JSON.stringify(data, undefined, 2), callback);
      });
    });
  }
};

@@ -118,16 +118,46 @@
 .dirname
+,%0A    util = require('./util')
 ;%0A%0Amodul
@@ -297,19 +297,142 @@
 , stdout
-) %7B
+, stderr) %7B%0A      util.streamData('git: ', stdout);%0A      if (stderr) %7B%0A        util.streamData('git err: ', stderr);%0A      %7D%0A
 %0A      v
@@ -1102,32 +1102,14 @@
 var 
-index = fs.readFileSync(
+src = 
 dirn
@@ -1139,18 +1139,17 @@
 ndex.js'
-);
+,
 %0A       
@@ -1155,25 +1155,19 @@
     
-fs.writeFileSync(
+    dest = 
 dirn
@@ -1191,16 +1191,186 @@
 ndex.js'
+;%0A          console.log('package: ', 'Copying package index %22' + src + '%22 to %22' + dest + '%22');%0A          var index = fs.readFileSync(src);%0A          fs.writeFileSync(dest
 , index)
@@ -1495,24 +1495,114 @@
 se%5C//, '');%0A
+        console.log('package: ', 'Output package config for branch %22' + data.name + '%22');%0A
         fs.w

Add additional logging to package generator