You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by sh...@apache.org on 2016/12/11 21:47:26 UTC

cordova-coho git commit: Fix situation in update-release-notes if only one tag present

Repository: cordova-coho
Updated Branches:
  refs/heads/master 439db5d00 -> 75cac489c


Fix situation in update-release-notes if only one tag present


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

Branch: refs/heads/master
Commit: 75cac489cccda198b963d0aa9b7afddc1a82e693
Parents: 439db5d
Author: Shazron Abdullah <sh...@apache.org>
Authored: Sun Dec 11 13:47:22 2016 -0800
Committer: Shazron Abdullah <sh...@apache.org>
Committed: Sun Dec 11 13:47:22 2016 -0800

----------------------------------------------------------------------
 src/gitutil.js              |  8 ++++++--
 src/update-release-notes.js | 18 ++++++++++++++----
 2 files changed, 20 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-coho/blob/75cac489/src/gitutil.js
----------------------------------------------------------------------
diff --git a/src/gitutil.js b/src/gitutil.js
index 9921c70..b8dad09 100644
--- a/src/gitutil.js
+++ b/src/gitutil.js
@@ -73,8 +73,12 @@ exports.findMostRecentTag = function*(prefix) {
             return null;
         });
 
-        if (ret !== null) {
-            return [ finalBest, lastBest ];
+        if (ret) {
+            if (lastBest) {
+                return [ ret, lastBest ];
+            } else {
+                return [ ret ];
+            }
         } else {
             return null;
         }

http://git-wip-us.apache.org/repos/asf/cordova-coho/blob/75cac489/src/update-release-notes.js
----------------------------------------------------------------------
diff --git a/src/update-release-notes.js b/src/update-release-notes.js
index c86cf0b..8398d53 100644
--- a/src/update-release-notes.js
+++ b/src/update-release-notes.js
@@ -50,11 +50,19 @@ module.exports = function*() {
     var cmd = executil.ARGS('git log --topo-order --no-merges');
     cmd.push(['--pretty=format:* %s']);
     yield repoutil.forEachRepo(repos, function*(repo) {
-        var fromTag, toTag;
+        var fromTag, toTag, hasOneTag;
+        hasOneTag = false;
         if (argv['last-two-tags']) {
             var last_two = (yield gitutil.findMostRecentTag(repo.versionPrefix));
-            fromTag = last_two[1];
-            toTag = last_two[0];
+            if (last_two) {
+                toTag = last_two[0];
+                if (last_two.length > 1) {
+                    fromTag = last_two[1];
+                } else {
+                    hasOneTag = true;
+                    fromTag = toTag;
+                }
+            }
         } else {
             if (argv['from-tag']){
                 fromTag = argv['from-tag'];
@@ -68,7 +76,9 @@ module.exports = function*() {
             }
         }
 
-        cmd.push(fromTag + '..' + toTag);
+        if (!hasOneTag) {
+            cmd.push(fromTag + '..' + toTag);
+        }
         var repoDesc = repo.repoName;
         if (repo.path) {
             repoDesc += '/' + repo.path;


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