You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by cs...@apache.org on 2016/03/04 23:11:05 UTC

cordova-coho git commit: CB-10794 coho merge-pr should always ammend to have author always set to a committer

Repository: cordova-coho
Updated Branches:
  refs/heads/master 08fef1cd2 -> 969b21889


CB-10794 coho merge-pr should always ammend to have author always set to a committer


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

Branch: refs/heads/master
Commit: 969b21889961ef5b874254c9a1543f7dedc543bb
Parents: 08fef1c
Author: Carlos Santana <cs...@gmail.com>
Authored: Fri Mar 4 17:06:39 2016 -0500
Committer: Carlos Santana <cs...@gmail.com>
Committed: Fri Mar 4 17:06:39 2016 -0500

----------------------------------------------------------------------
 src/merge-pr.js | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-coho/blob/969b2188/src/merge-pr.js
----------------------------------------------------------------------
diff --git a/src/merge-pr.js b/src/merge-pr.js
index 79f2ffe..0fd7212 100644
--- a/src/merge-pr.js
+++ b/src/merge-pr.js
@@ -54,6 +54,7 @@ module.exports = function *(argv) {
    var remote = 'https://github.com/apache/' + currentRepo.repoName;
    var origin = 'https://git-wip-us.apache.org/repos/asf/' + currentRepo.repoName;
    yield gitutil.stashAndPop('', function*() {
+       var commitMessage
        yield executil.execHelper(executil.ARGS('git checkout master'));
     
        yield executil.execHelper(['git', 'pull', origin, 'master']);
@@ -63,6 +64,9 @@ module.exports = function *(argv) {
        try {
             yield executil.execHelper(executil.ARGS('git merge --ff-only ' + localBranch),
                 /*silent*/ true, /*allowError*/ true);
+                commitMessage = yield executil.execHelper(executil.ARGS('git log --format=%B -n 1 HEAD'), /*silent*/ true);
+               yield executil.execHelper(['git', 'commit', '--amend', '-m', 
+                    commitMessage + '\n\n This closes #' + argv.pr]);
        } catch (e) {   
            if (e.message.indexOf('fatal: Not possible to fast-forward, aborting.') > 0) {
                // Let's try to rebase
@@ -70,9 +74,9 @@ module.exports = function *(argv) {
                yield executil.execHelper(['git', 'pull', '--rebase', origin, 'master']);
                yield executil.execHelper(executil.ARGS('git checkout master'));
                yield executil.execHelper(executil.ARGS('git merge --ff-only ' + localBranch));
-               var commitMessage = yield executil.execHelper(executil.ARGS('git log --format=%B -n 1 HEAD'), /*silent*/ true);
+               commitMessage = yield executil.execHelper(executil.ARGS('git log --format=%B -n 1 HEAD'), /*silent*/ true);
                yield executil.execHelper(['git', 'commit', '--amend', '-m', 
-                    commitMessage + '. This closes #' + argv.pr]);
+                    commitMessage + '\n\n This closes #' + argv.pr]);
            } else {
                throw e;
            }


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org