Update getGitDescribe function

Parametrize getGitDescribe(Boolean useShort = false):
  useShort Boolean, returns String in format:
       false (Default): {gitTag}-{numCommits}-g{gitsha}
       true:            {gitTag}-{numCommits}

Change-Id: Ibf2e90f2fdef0611c3622b817d5f4e174fa90200
diff --git a/src/com/mirantis/mcp/Git.groovy b/src/com/mirantis/mcp/Git.groovy
index 4874084..0cb9533 100644
--- a/src/com/mirantis/mcp/Git.groovy
+++ b/src/com/mirantis/mcp/Git.groovy
@@ -13,11 +13,23 @@
 
 /**
  * Describe a commit using the most recent tag reachable from it
+ *
+ * @param useShort Boolean, which String format returns as result.
+ *              false (Default): {gitTag}-{numCommits}-g{gitsha}
+ *              true:            {gitTag}-{numCommits}
  */
-def getGitDescribe() {
-    git_commit = sh (
-            script: 'git describe --tags',
-            returnStdout: true
-    ).trim()
+def getGitDescribe(Boolean useShort = false) {
+    if (useShort) {
+        // original sed "s/-g[0-9a-f]\+$//g" should be escaped in groovy
+        git_commit = sh (
+                script: 'git describe --tags | sed "s/-g[0-9a-f]\\+$//g"',
+                returnStdout: true
+        ).trim()
+    } else {
+        git_commit = sh (
+                script: 'git describe --tags',
+                returnStdout: true
+        ).trim()
+    }
     return git_commit
 }