cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From agri...@apache.org
Subject [1/3] git commit: Add --push option, fix (via coho) broke
Date Wed, 19 Jun 2013 00:22:35 GMT
Updated Branches:
  refs/heads/master daf91387d -> 6b27f3f8d


Add --push option, fix (via coho) broke


Project: http://git-wip-us.apache.org/repos/asf/cordova-coho/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-coho/commit/28282e95
Tree: http://git-wip-us.apache.org/repos/asf/cordova-coho/tree/28282e95
Diff: http://git-wip-us.apache.org/repos/asf/cordova-coho/diff/28282e95

Branch: refs/heads/master
Commit: 28282e95472f7cb13c21e8b545d61ee61596adf8
Parents: daf9138
Author: Andrew Grieve <agrieve@chromium.org>
Authored: Tue Jun 18 20:05:43 2013 -0400
Committer: Andrew Grieve <agrieve@chromium.org>
Committed: Tue Jun 18 20:05:43 2013 -0400

----------------------------------------------------------------------
 coho | 25 +++++++++++++++++++------
 1 file changed, 19 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-coho/blob/28282e95/coho
----------------------------------------------------------------------
diff --git a/coho b/coho
index 6f3527f..dcbfcb2 100755
--- a/coho
+++ b/coho
@@ -617,6 +617,9 @@ function configureReleaseCommandFlags(opt) {
         .options('version', {
             desc: 'The version to use for the branch. Must match the pattern #.#.#[rc#]',
             demand: true
+         })
+        .options('push', {
+            desc: 'Whether to git push changes. Defaults to false.',
          });
     opt = registerHelpFlag(opt);
     argv = opt.argv;
@@ -645,6 +648,7 @@ function createReleaseBranchCommand() {
     );
     var repos = computeReposFromFlag(argv);
     var version = argv.version;
+    var performGitPush = argv.push;
     var branchName = version.replace(/\d+(rc\d)?$/, 'x');
 
     // First - perform precondition checks.
@@ -685,8 +689,10 @@ function createReleaseBranchCommand() {
                         cpAndLog(src, jsPath);
                     });
                     if (pendingChangesExist()) {
-                        execHelper('git commit -am "Update JS snapshot to version ' + version
+ '" (via coho)');
-                        execHelper('git push ' + repo.remoteName + ' master');
+                        execHelper('git commit -am "Update JS snapshot to version ' + version
+ ' (via coho)"');
+                        if (performGitPush) {
+                          execHelper('git push ' + repo.remoteName + ' master');
+                        }
                     }
                 } else if (allRepos.indexOf(repo) != -1) {
                     console.log('*** DO NOT KNOW HOW TO UPDATE cordova.js FOR THIS REPO ***');
@@ -700,7 +706,9 @@ function createReleaseBranchCommand() {
                 updateRepos([repo], [branchName], true);
             } else {
                 execHelper('git checkout -b ' + branchName);
-                execHelper('git push --set-upstream ' + repo.remoteName + ' ' + branchName);
+                if (performGitPush) {
+                  execHelper('git push --set-upstream ' + repo.remoteName + ' ' + branchName);
+                }
             }
             // Update the VERSION files.
             var versionFilePath = 'VERSION';
@@ -727,8 +735,10 @@ function createReleaseBranchCommand() {
             }
 
             if (pendingChangesExist()) {
-                execHelper('git commit -am "Set VERSION to ' + version + '" (via coho)');
-                execHelper('git push ' + repo.remoteName + ' ' + branchName);
+                execHelper('git commit -am "Set VERSION to ' + version + ' (via coho)"');
+                if (performGitPush) {
+                  execHelper('git push ' + repo.remoteName + ' ' + branchName);
+                }
             }
         });
     });
@@ -742,6 +752,7 @@ function tagReleaseBranchCommand(argv) {
     );
     var repos = computeReposFromFlag(argv);
     var version = argv.version;
+    var performGitPush = argv.push;
     var branchName = version.replace(/\d+(rc\d)?$/, 'x');
 
     // First - perform precondition checks.
@@ -771,7 +782,9 @@ function tagReleaseBranchCommand(argv) {
                 } else {
                     execHelper('git tag ' + version);
                 }
-                execHelper('git push --tags ' + repo.remoteName + ' ' + branchName);
+                if (performGitPush) {
+                  execHelper('git push --tags ' + repo.remoteName + ' ' + branchName);
+                }
             } else {
                 console.log('Repo ' + repo.repoName + ' is already tagged.');
             }


Mime
View raw message