From 07288fadbe7bf916bf2bdfbc485a61cd4995177a Mon Sep 17 00:00:00 2001
From: Pavel Korshunov <pavel.korshunov@idiap.ch>
Date: Sat, 31 Mar 2018 13:38:32 +0200
Subject: [PATCH] allow project with empty tags, fixed changelog

---
 release/changelog_since_last_release.rst | 6 ++++--
 release/release_bob.py                   | 8 ++++++--
 2 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/release/changelog_since_last_release.rst b/release/changelog_since_last_release.rst
index 7383487..42e3543 100644
--- a/release/changelog_since_last_release.rst
+++ b/release/changelog_since_last_release.rst
@@ -178,12 +178,14 @@
   * minor
      * Migrate to conda based CI
 * bob.db.asvspoof
-  * v1.0.3 (Sep 22, 2017 14:20)
+  * v1.1.7 (Sep 22, 2017 14:20)
+     * Docs updates
   * minor
      * Migrate to conda based CI
-     * Removed redundant debug_asvspoof2017 script
+     * Removed redundant debug_asvspoof script
 * bob.db.asvspoof2017
   * v1.0.3 (Sep 22, 2017 14:20)
+     * Docs updates                                                                                                                                                              
   * minor
      * Migrate to conda based CI
      * Removed redundant debug_asvspoof2017 script
diff --git a/release/release_bob.py b/release/release_bob.py
index ad58c9e..56068bd 100755
--- a/release/release_bob.py
+++ b/release/release_bob.py
@@ -13,7 +13,7 @@ Usage:
 
 Arguments:
     <private_token>  Private token used to access GitLab.
-  
+
 Options:
     -h --help                     Show this screen.
     --version                     Show version.
@@ -84,7 +84,11 @@ def get_parsed_tag(gitpkg, tag):
 
     # if we bump the version, we need to find the latest released version for this package
     if 'patch' == tag or 'minor' == tag or 'major' == tag:
-        latest_tag = gitpkg.tags.list(per_page=1, page=1)[0]
+        latest_tag = gitpkg.tags.list(per_page=1, page=1)
+        # if there were no tags yet, assume the first version
+        if not latest_tag:
+            return 'v1.0.0'
+        latest_tag = latest_tag[0]
         latest_tag_name = latest_tag.name
         # check that it has expected format v#.#.#
         # latest_tag_name = Version(latest_tag_name)
-- 
GitLab