From 71ea95a00fe3785d6a4ec1721b5c9575c31a09ad Mon Sep 17 00:00:00 2001
From: clime <clime@redhat.com>
Date: Oct 11 2018 20:41:18 +0000
Subject: [PATCH 1/3] add git_release


---

diff --git a/macros/macros.d/git.bash b/macros/macros.d/git.bash
index 3048052..dc94c93 100644
--- a/macros/macros.d/git.bash
+++ b/macros/macros.d/git.bash
@@ -21,6 +21,29 @@ function branch_remote_url {
     fi
 }
 
+function git_version_appendices {
+    if [ -n "$1" ]; then
+        commit_count="$(git rev-list "$1"..HEAD | wc -l)"
+    else
+        commit_count="$(git rev-list HEAD 2> /dev/null | wc -l  || printf 0)"
+    fi
+
+    if [ "$commit_count" -eq 0 ]; then
+        commit_count_appendix=
+    else
+        commit_count_appendix=".git.$commit_count.$(git rev-parse --short HEAD)"
+    fi
+
+    latest_ctime="$(git_latest_ctime)"
+    if [ "$latest_ctime" -eq 0 ]; then
+        wtree_appendix=
+    else
+        wtree_appendix=".wtree.$(encode_decimal "$latest_ctime")"
+    fi
+
+    echo -n "${commit_count_appendix}${wtree_appendix}"
+}
+
 function latest_merged_tag {
     if [ "$legacy_git" ]; then
         git for-each-ref --sort=-taggerdate refs/tags | cut -f2 |
@@ -246,30 +269,65 @@ function git_version {
         return
     fi
 
-    if [ -n "$latest_tag" ]; then
-        commit_count="$(git rev-list "$latest_tag"..HEAD | wc -l)"
-    else
-        commit_count="$(git rev-list HEAD 2> /dev/null | wc -l  || printf 0)"
+    if [ -z "$follow" ]; then
+        follow="$(echo "$latest_tag_version" | sed -E -n "s/^$lead\.([^.]*)$/\1/p")"
     fi
 
-    if [ "$commit_count" -eq 0 ]; then
-        commit_count_appendix=
-    else
-        commit_count_appendix=".git.$commit_count.$(git rev-parse --short HEAD)"
+    output "${lead}.${follow:-0}$(git_version_appendices "$latest_tag")"
+}
+
+function git_bumped_release {
+    declare pivot= latest_tag_release= "$@"
+
+    if [ -n "$pivot" ]; then
+        echo -n "$pivot"
+        return
     fi
 
-    latest_ctime="$(git_latest_ctime)"
-    if [ "$latest_ctime" -eq 0 ]; then
-        wtree_appendix=
-    else
-        wtree_appendix=".wtree.$(encode_decimal "$latest_ctime")"
+    pivot="${latest_tag_release}"
+
+    if echo "$pivot" | grep -q '[^0-9]'; then
+        log_error "$pivot is not a number. Please, bump release manually."
+        return 1
     fi
 
-    if [ -z "$follow" ]; then
-        follow="$(echo "$latest_tag_version" | sed -E -n "s/^$lead\.([^.]*)$/\1/p")"
+    bumped_pivot=$(( $pivot + 1 ))
+    echo -n "$bumped_pivot"
+}
+
+function git_release {
+    declare name="$(cached git_name)" pivot= "$@"
+
+    if [ -z "$name" ]; then
+        log_error "name cannot be empty."
+        return 1
     fi
 
-    output "${lead}.${follow:-0}${commit_count_appendix}${wtree_appendix}"
+    if echo "$pivot" | grep -q '-'; then
+        log_error "pivot cannot contain dashes."
+        return 1
+    fi
+
+    latest_tag="$(latest_merged_tag "$name")"
+    latest_tag_release="$(echo $latest_tag | sed -E -n "s/^$name-[^-]+-([^-]+)$/\1/p")"
+
+    if [ -n "$RELEASE_BUMP" ]; then
+        pivot="$(git_bumped_release pivot="$pivot" latest_tag_release="$latest_tag_release")"
+
+        retcode=$?
+        if [ $retcode -ne 0 ]; then
+            return $retcode
+        fi
+
+        output "$pivot"
+        return
+    fi
+
+    if [ -z "$pivot" ]; then
+        pivot="$latest_tag_release"
+    fi
+
+    output "${pivot:-0}$(git_version_appendices "$latest_tag")"
 }
 
 function git_vcs {
@@ -414,6 +472,10 @@ function git_dir_version {
     git_version "$@"
 }
 
+function git_dir_release {
+    git_release "$@"
+}
+
 function git_dir_vcs {
     git_vcs subtree="$(git -C "$(dirname "$INPUT_PATH")" rev-parse --show-prefix)" "$@"
 }
@@ -444,6 +506,10 @@ function git_cwd_version {
     git_version "$@"
 }
 
+function git_cwd_release {
+    git_release "$@"
+}
+
 function git_cwd_vcs {
     git_vcs subtree="$(git -C "$(pwd)" rev-parse --show-prefix)" "$@"
 }
diff --git a/rpkglib/__init__.py b/rpkglib/__init__.py
index d73a114..2cb1a27 100644
--- a/rpkglib/__init__.py
+++ b/rpkglib/__init__.py
@@ -33,6 +33,7 @@ class Commands(pyrpkg.Commands):
         self.base_output_path = kwargs.pop("base_output_path", '/tmp/rpkg')
         self.dump_spec_only = False
         self.version_bump = False
+        self.release_bump = False
         self.use_existing_outdir = False
         self.verbose = False
         super(Commands, self).__init__(*args, **kwargs)
@@ -456,6 +457,9 @@ class Commands(pyrpkg.Commands):
         if self.version_bump:
             env_params += ' -e VERSION_BUMP=1'
 
+        if self.release_bump:
+            env_params += ' -e RELEASE_BUMP=1'
+
         if self.verbose:
             env_params += ' -e VERBOSE=1'
 
@@ -517,6 +521,7 @@ class Commands(pyrpkg.Commands):
         self.log.info('Created tag: %s', tagname)
 
         self.version_bump = False
+        self.release_bump = False
         self.load_spec()
 
     def get_latest_merged_tagname(self):
diff --git a/rpkglib/cli.py b/rpkglib/cli.py
index 3f52878..ffcd13a 100644
--- a/rpkglib/cli.py
+++ b/rpkglib/cli.py
@@ -232,6 +232,7 @@ class rpkgClient(cliClient):
 
         if not self.args.tag:
             self.cmd.version_bump = True
+            self.cmd.release_bump = True
 
         self.cmd._rpmdefines = self.cmd.rpmdefines + ["--define 'dist %nil'"]
 
@@ -279,6 +280,7 @@ class rpkgClient(cliClient):
             if self.args.tag:
                 self.cmd.dump_spec_only = True
                 self.cmd.version_bump = True
+                self.cmd.release_bump = True
                 self.cmd.add_tag()
         except Exception:
             if self.args.tag:

From 35aa1e91352cd094cf273d2e83bf9d468c1876c1 Mon Sep 17 00:00:00 2001
From: clime <clime@redhat.com>
Date: Oct 11 2018 20:41:23 +0000
Subject: [PATCH 2/3] add bumped_release test


---

diff --git a/macros/tests/test_bumped_release/input b/macros/tests/test_bumped_release/input
new file mode 100644
index 0000000..a716ac4
--- /dev/null
+++ b/macros/tests/test_bumped_release/input
@@ -0,0 +1,8 @@
+git_bumped_release
+git_bumped_release pivot=1
+git_bumped_release pivot=x
+git_bumped_release pivot=1.0
+git_bumped_release latest_tag_release=2
+git_bumped_release pivot=4 latest_tag_release=2
+git_bumped_release latest_tag_release=1.2 # invalid
+git_bumped_release latest_tag_release=1.x # invalid
diff --git a/macros/tests/test_bumped_release/log b/macros/tests/test_bumped_release/log
new file mode 100644
index 0000000..c978da6
--- /dev/null
+++ b/macros/tests/test_bumped_release/log
@@ -0,0 +1,20 @@
+> git_bumped_release
+---
+> git_bumped_release pivot=1
+---
+> git_bumped_release pivot=x
+---
+> git_bumped_release pivot=1.0
+---
+> git_bumped_release latest_tag_release=2
+---
+> git_bumped_release pivot=4 latest_tag_release=2
+---
+> git_bumped_release latest_tag_release=1.2 # invalid
+ERROR: git_bumped_release: 1.2 is not a number. Please, bump release manually.
+git_bumped_release latest_tag_release=1.2 # invalid failed with value 1.
+---
+> git_bumped_release latest_tag_release=1.x # invalid
+ERROR: git_bumped_release: 1.x is not a number. Please, bump release manually.
+git_bumped_release latest_tag_release=1.x # invalid failed with value 1.
+---
diff --git a/macros/tests/test_bumped_release/output b/macros/tests/test_bumped_release/output
new file mode 100644
index 0000000..cddfc74
--- /dev/null
+++ b/macros/tests/test_bumped_release/output
@@ -0,0 +1,8 @@
+git_bumped_release: 1
+git_bumped_release pivot=1: 1
+git_bumped_release pivot=x: x
+git_bumped_release pivot=1.0: 1.0
+git_bumped_release latest_tag_release=2: 3
+git_bumped_release pivot=4 latest_tag_release=2: 4
+git_bumped_release latest_tag_release=1.2 # invalid: 
+git_bumped_release latest_tag_release=1.x # invalid: 
diff --git a/macros/tests/test_bumped_release/run.sh b/macros/tests/test_bumped_release/run.sh
new file mode 100755
index 0000000..e62c073
--- /dev/null
+++ b/macros/tests/test_bumped_release/run.sh
@@ -0,0 +1,17 @@
+#!/bin/bash
+
+. ../lib.sh
+
+repo=`mktemp -d`
+outdir=`mktemp -d`
+output=`mktemp`
+
+prepare_input input $repo/input
+
+touch output && cp output $output
+
+generic_test preproc_opts="-C $repo" outdir=$outdir input=$repo/input expected_output=$output expected_log=log copy_only=$1
+
+rm -rf $repo
+rm -rf $outdir
+rm $output

From 6b9f0344f10bdda67536479c8d4632e874f321b0 Mon Sep 17 00:00:00 2001
From: clime <clime@redhat.com>
Date: Oct 11 2018 20:41:23 +0000
Subject: [PATCH 3/3] add git_release tests


---

diff --git a/macros/tests/input b/macros/tests/input
index 17f606a..7e7c2b9 100644
--- a/macros/tests/input
+++ b/macros/tests/input
@@ -20,6 +20,16 @@ git_version follow=2-2 # invalid
 git_version name= # invalid
 git_version name="$(git_name)"
 
+git_release
+git_release name=foo
+git_release pivot=1
+git_release name=foo pivot=1
+git_release pivot=x
+git_release pivot=2.0
+git_release pivot=1-1 # invalid
+git_release name= # invalid
+git_release name="$(git_name)"
+
 git_vcs
 git_vcs subtree=foo
 
@@ -66,6 +76,16 @@ git_dir_version follow=2-2 # invalid
 git_dir_version name= # invalid
 git_dir_version name="$(git_name)"
 
+git_dir_release
+git_dir_release name=foo
+git_dir_release pivot=1
+git_dir_release name=foo pivot=1
+git_dir_release pivot=x
+git_dir_release pivot=2.0
+git_dir_release pivot=1-1 # invalid
+git_dir_release name= # invalid
+git_dir_release name="$(git_name)"
+
 git_dir_vcs
 git_dir_vcs subtree=foo
 
@@ -112,6 +132,16 @@ git_cwd_version follow=2-2 # invalid
 git_cwd_version name= # invalid
 git_cwd_version name="$(git_cwd_name)"
 
+git_cwd_release
+git_cwd_release name=foo
+git_cwd_release pivot=1
+git_cwd_release name=foo pivot=1
+git_cwd_release pivot=x
+git_cwd_release pivot=2.0
+git_cwd_release pivot=1-1 # invalid
+git_cwd_release name= # invalid
+git_cwd_release name="$(git_name)"
+
 git_cwd_vcs
 git_cwd_vcs subtree=foo
 
diff --git a/macros/tests/test_committed/log b/macros/tests/test_committed/log
index d899e8d..b77d196 100644
--- a/macros/tests/test_committed/log
+++ b/macros/tests/test_committed/log
@@ -46,6 +46,28 @@ git_version name= # invalid failed with value 1.
 ---
 > git_version name="$(git_name)"
 ---
+> git_release
+---
+> git_release name=foo
+---
+> git_release pivot=1
+---
+> git_release name=foo pivot=1
+---
+> git_release pivot=x
+---
+> git_release pivot=2.0
+---
+> git_release pivot=1-1 # invalid
+ERROR: git_release: pivot cannot contain dashes.
+git_release pivot=1-1 # invalid failed with value 1.
+---
+> git_release name= # invalid
+ERROR: git_release: name cannot be empty.
+git_release name= # invalid failed with value 1.
+---
+> git_release name="$(git_name)"
+---
 > git_vcs
 ---
 > git_vcs subtree=foo
@@ -128,6 +150,28 @@ git_dir_version name= # invalid failed with value 1.
 ---
 > git_dir_version name="$(git_name)"
 ---
+> git_dir_release
+---
+> git_dir_release name=foo
+---
+> git_dir_release pivot=1
+---
+> git_dir_release name=foo pivot=1
+---
+> git_dir_release pivot=x
+---
+> git_dir_release pivot=2.0
+---
+> git_dir_release pivot=1-1 # invalid
+ERROR: git_dir_release: pivot cannot contain dashes.
+git_dir_release pivot=1-1 # invalid failed with value 1.
+---
+> git_dir_release name= # invalid
+ERROR: git_dir_release: name cannot be empty.
+git_dir_release name= # invalid failed with value 1.
+---
+> git_dir_release name="$(git_name)"
+---
 > git_dir_vcs
 ---
 > git_dir_vcs subtree=foo
@@ -210,6 +254,28 @@ git_cwd_version name= # invalid failed with value 1.
 ---
 > git_cwd_version name="$(git_cwd_name)"
 ---
+> git_cwd_release
+---
+> git_cwd_release name=foo
+---
+> git_cwd_release pivot=1
+---
+> git_cwd_release name=foo pivot=1
+---
+> git_cwd_release pivot=x
+---
+> git_cwd_release pivot=2.0
+---
+> git_cwd_release pivot=1-1 # invalid
+ERROR: git_cwd_release: pivot cannot contain dashes.
+git_cwd_release pivot=1-1 # invalid failed with value 1.
+---
+> git_cwd_release name= # invalid
+ERROR: git_cwd_release: name cannot be empty.
+git_cwd_release name= # invalid failed with value 1.
+---
+> git_cwd_release name="$(git_name)"
+---
 > git_cwd_vcs
 ---
 > git_cwd_vcs subtree=foo
diff --git a/macros/tests/test_committed/output b/macros/tests/test_committed/output
index 435f70f..c79fde2 100644
--- a/macros/tests/test_committed/output
+++ b/macros/tests/test_committed/output
@@ -20,6 +20,16 @@ git_version follow=2-2 # invalid:
 git_version name= # invalid: 
 git_version name="$(git_name)": 0.0.git.3.xxxxxxx
 
+git_release: 0.git.3.xxxxxxx
+git_release name=foo: 0.git.3.xxxxxxx
+git_release pivot=1: 1.git.3.xxxxxxx
+git_release name=foo pivot=1: 1.git.3.xxxxxxx
+git_release pivot=x: x.git.3.xxxxxxx
+git_release pivot=2.0: 2.0.git.3.xxxxxxx
+git_release pivot=1-1 # invalid: 
+git_release name= # invalid: 
+git_release name="$(git_name)": 0.git.3.xxxxxxx
+
 git_vcs: git+https://pagure.io/clime/test.git#xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx:
 git_vcs subtree=foo: git+https://pagure.io/clime/test.git#xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx:foo
 
@@ -76,6 +86,16 @@ git_dir_version follow=2-2 # invalid:
 git_dir_version name= # invalid: 
 git_dir_version name="$(git_name)": 0.0.git.3.xxxxxxx
 
+git_dir_release: 0.git.3.xxxxxxx
+git_dir_release name=foo: 0.git.3.xxxxxxx
+git_dir_release pivot=1: 1.git.3.xxxxxxx
+git_dir_release name=foo pivot=1: 1.git.3.xxxxxxx
+git_dir_release pivot=x: x.git.3.xxxxxxx
+git_dir_release pivot=2.0: 2.0.git.3.xxxxxxx
+git_dir_release pivot=1-1 # invalid: 
+git_dir_release name= # invalid: 
+git_dir_release name="$(git_name)": 0.git.3.xxxxxxx
+
 git_dir_vcs: git+https://pagure.io/clime/test.git#xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx:
 git_dir_vcs subtree=foo: git+https://pagure.io/clime/test.git#xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx:foo
 
@@ -132,6 +152,16 @@ git_cwd_version follow=2-2 # invalid:
 git_cwd_version name= # invalid: 
 git_cwd_version name="$(git_cwd_name)": 0.0.git.3.xxxxxxx
 
+git_cwd_release: 0.git.3.xxxxxxx
+git_cwd_release name=foo: 0.git.3.xxxxxxx
+git_cwd_release pivot=1: 1.git.3.xxxxxxx
+git_cwd_release name=foo pivot=1: 1.git.3.xxxxxxx
+git_cwd_release pivot=x: x.git.3.xxxxxxx
+git_cwd_release pivot=2.0: 2.0.git.3.xxxxxxx
+git_cwd_release pivot=1-1 # invalid: 
+git_cwd_release name= # invalid: 
+git_cwd_release name="$(git_name)": 0.git.3.xxxxxxx
+
 git_cwd_vcs: git+https://pagure.io/clime/test.git#xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx:
 git_cwd_vcs subtree=foo: git+https://pagure.io/clime/test.git#xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx:foo
 
diff --git a/macros/tests/test_dirty/log b/macros/tests/test_dirty/log
index d899e8d..b77d196 100644
--- a/macros/tests/test_dirty/log
+++ b/macros/tests/test_dirty/log
@@ -46,6 +46,28 @@ git_version name= # invalid failed with value 1.
 ---
 > git_version name="$(git_name)"
 ---
+> git_release
+---
+> git_release name=foo
+---
+> git_release pivot=1
+---
+> git_release name=foo pivot=1
+---
+> git_release pivot=x
+---
+> git_release pivot=2.0
+---
+> git_release pivot=1-1 # invalid
+ERROR: git_release: pivot cannot contain dashes.
+git_release pivot=1-1 # invalid failed with value 1.
+---
+> git_release name= # invalid
+ERROR: git_release: name cannot be empty.
+git_release name= # invalid failed with value 1.
+---
+> git_release name="$(git_name)"
+---
 > git_vcs
 ---
 > git_vcs subtree=foo
@@ -128,6 +150,28 @@ git_dir_version name= # invalid failed with value 1.
 ---
 > git_dir_version name="$(git_name)"
 ---
+> git_dir_release
+---
+> git_dir_release name=foo
+---
+> git_dir_release pivot=1
+---
+> git_dir_release name=foo pivot=1
+---
+> git_dir_release pivot=x
+---
+> git_dir_release pivot=2.0
+---
+> git_dir_release pivot=1-1 # invalid
+ERROR: git_dir_release: pivot cannot contain dashes.
+git_dir_release pivot=1-1 # invalid failed with value 1.
+---
+> git_dir_release name= # invalid
+ERROR: git_dir_release: name cannot be empty.
+git_dir_release name= # invalid failed with value 1.
+---
+> git_dir_release name="$(git_name)"
+---
 > git_dir_vcs
 ---
 > git_dir_vcs subtree=foo
@@ -210,6 +254,28 @@ git_cwd_version name= # invalid failed with value 1.
 ---
 > git_cwd_version name="$(git_cwd_name)"
 ---
+> git_cwd_release
+---
+> git_cwd_release name=foo
+---
+> git_cwd_release pivot=1
+---
+> git_cwd_release name=foo pivot=1
+---
+> git_cwd_release pivot=x
+---
+> git_cwd_release pivot=2.0
+---
+> git_cwd_release pivot=1-1 # invalid
+ERROR: git_cwd_release: pivot cannot contain dashes.
+git_cwd_release pivot=1-1 # invalid failed with value 1.
+---
+> git_cwd_release name= # invalid
+ERROR: git_cwd_release: name cannot be empty.
+git_cwd_release name= # invalid failed with value 1.
+---
+> git_cwd_release name="$(git_name)"
+---
 > git_cwd_vcs
 ---
 > git_cwd_vcs subtree=foo
diff --git a/macros/tests/test_dirty/output b/macros/tests/test_dirty/output
index d1c2e9b..6eaa662 100644
--- a/macros/tests/test_dirty/output
+++ b/macros/tests/test_dirty/output
@@ -20,6 +20,16 @@ git_version follow=2-2 # invalid:
 git_version name= # invalid: 
 git_version name="$(git_name)": 0.0.git.1.xxxxxxx.wtree.xxxxxx
 
+git_release: 0.git.1.xxxxxxx.wtree.xxxxxx
+git_release name=foo: 0.git.1.xxxxxxx.wtree.xxxxxx
+git_release pivot=1: 1.git.1.xxxxxxx.wtree.xxxxxx
+git_release name=foo pivot=1: 1.git.1.xxxxxxx.wtree.xxxxxx
+git_release pivot=x: x.git.1.xxxxxxx.wtree.xxxxxx
+git_release pivot=2.0: 2.0.git.1.xxxxxxx.wtree.xxxxxx
+git_release pivot=1-1 # invalid: 
+git_release name= # invalid: 
+git_release name="$(git_name)": 0.git.1.xxxxxxx.wtree.xxxxxx
+
 git_vcs: git+https://pagure.io/clime/test.git#xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx:
 git_vcs subtree=foo: git+https://pagure.io/clime/test.git#xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx:foo
 
@@ -76,6 +86,16 @@ git_dir_version follow=2-2 # invalid:
 git_dir_version name= # invalid: 
 git_dir_version name="$(git_name)": 0.0.git.1.xxxxxxx.wtree.xxxxxx
 
+git_dir_release: 0.git.1.xxxxxxx.wtree.xxxxxx
+git_dir_release name=foo: 0.git.1.xxxxxxx.wtree.xxxxxx
+git_dir_release pivot=1: 1.git.1.xxxxxxx.wtree.xxxxxx
+git_dir_release name=foo pivot=1: 1.git.1.xxxxxxx.wtree.xxxxxx
+git_dir_release pivot=x: x.git.1.xxxxxxx.wtree.xxxxxx
+git_dir_release pivot=2.0: 2.0.git.1.xxxxxxx.wtree.xxxxxx
+git_dir_release pivot=1-1 # invalid: 
+git_dir_release name= # invalid: 
+git_dir_release name="$(git_name)": 0.git.1.xxxxxxx.wtree.xxxxxx
+
 git_dir_vcs: git+https://pagure.io/clime/test.git#xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx:
 git_dir_vcs subtree=foo: git+https://pagure.io/clime/test.git#xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx:foo
 
@@ -132,6 +152,16 @@ git_cwd_version follow=2-2 # invalid:
 git_cwd_version name= # invalid: 
 git_cwd_version name="$(git_cwd_name)": 0.0.git.1.xxxxxxx.wtree.xxxxxx
 
+git_cwd_release: 0.git.1.xxxxxxx.wtree.xxxxxx
+git_cwd_release name=foo: 0.git.1.xxxxxxx.wtree.xxxxxx
+git_cwd_release pivot=1: 1.git.1.xxxxxxx.wtree.xxxxxx
+git_cwd_release name=foo pivot=1: 1.git.1.xxxxxxx.wtree.xxxxxx
+git_cwd_release pivot=x: x.git.1.xxxxxxx.wtree.xxxxxx
+git_cwd_release pivot=2.0: 2.0.git.1.xxxxxxx.wtree.xxxxxx
+git_cwd_release pivot=1-1 # invalid: 
+git_cwd_release name= # invalid: 
+git_cwd_release name="$(git_name)": 0.git.1.xxxxxxx.wtree.xxxxxx
+
 git_cwd_vcs: git+https://pagure.io/clime/test.git#xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx:
 git_cwd_vcs subtree=foo: git+https://pagure.io/clime/test.git#xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx:foo
 
diff --git a/macros/tests/test_inited/log b/macros/tests/test_inited/log
index 69802fa..baed2cb 100644
--- a/macros/tests/test_inited/log
+++ b/macros/tests/test_inited/log
@@ -57,6 +57,31 @@ ERROR: git_name: Could not get remote URL.
 ERROR: git_version: name cannot be empty.
 git_version name="$(git_name)" failed with value 1.
 ---
+> git_release
+---
+> git_release name=foo
+---
+> git_release pivot=1
+---
+> git_release name=foo pivot=1
+---
+> git_release pivot=x
+---
+> git_release pivot=2.0
+---
+> git_release pivot=1-1 # invalid
+ERROR: git_release: pivot cannot contain dashes.
+git_release pivot=1-1 # invalid failed with value 1.
+---
+> git_release name= # invalid
+ERROR: git_release: name cannot be empty.
+git_release name= # invalid failed with value 1.
+---
+> git_release name="$(git_name)"
+ERROR: git_name: Could not get remote URL.
+ERROR: git_release: name cannot be empty.
+git_release name="$(git_name)" failed with value 1.
+---
 > git_vcs
 ERROR: git_vcs: Start by setting origin URL.
 git_vcs failed with value 1.
@@ -154,6 +179,31 @@ ERROR: git_name: Could not get remote URL.
 ERROR: git_dir_version: name cannot be empty.
 git_dir_version name="$(git_name)" failed with value 1.
 ---
+> git_dir_release
+---
+> git_dir_release name=foo
+---
+> git_dir_release pivot=1
+---
+> git_dir_release name=foo pivot=1
+---
+> git_dir_release pivot=x
+---
+> git_dir_release pivot=2.0
+---
+> git_dir_release pivot=1-1 # invalid
+ERROR: git_dir_release: pivot cannot contain dashes.
+git_dir_release pivot=1-1 # invalid failed with value 1.
+---
+> git_dir_release name= # invalid
+ERROR: git_dir_release: name cannot be empty.
+git_dir_release name= # invalid failed with value 1.
+---
+> git_dir_release name="$(git_name)"
+ERROR: git_name: Could not get remote URL.
+ERROR: git_dir_release: name cannot be empty.
+git_dir_release name="$(git_name)" failed with value 1.
+---
 > git_dir_vcs
 ERROR: git_dir_vcs: Start by setting origin URL.
 git_dir_vcs failed with value 1.
@@ -251,6 +301,31 @@ ERROR: git_cwd_name: Could not get remote URL.
 ERROR: git_cwd_version: name cannot be empty.
 git_cwd_version name="$(git_cwd_name)" failed with value 1.
 ---
+> git_cwd_release
+---
+> git_cwd_release name=foo
+---
+> git_cwd_release pivot=1
+---
+> git_cwd_release name=foo pivot=1
+---
+> git_cwd_release pivot=x
+---
+> git_cwd_release pivot=2.0
+---
+> git_cwd_release pivot=1-1 # invalid
+ERROR: git_cwd_release: pivot cannot contain dashes.
+git_cwd_release pivot=1-1 # invalid failed with value 1.
+---
+> git_cwd_release name= # invalid
+ERROR: git_cwd_release: name cannot be empty.
+git_cwd_release name= # invalid failed with value 1.
+---
+> git_cwd_release name="$(git_name)"
+ERROR: git_name: Could not get remote URL.
+ERROR: git_cwd_release: name cannot be empty.
+git_cwd_release name="$(git_name)" failed with value 1.
+---
 > git_cwd_vcs
 ERROR: git_cwd_vcs: Start by setting origin URL.
 git_cwd_vcs failed with value 1.
diff --git a/macros/tests/test_inited/output b/macros/tests/test_inited/output
index 76b3bb0..ef4f480 100644
--- a/macros/tests/test_inited/output
+++ b/macros/tests/test_inited/output
@@ -20,6 +20,16 @@ git_version follow=2-2 # invalid:
 git_version name= # invalid: 
 git_version name="$(git_name)": 
 
+git_release: 0.wtree.xxxxxx
+git_release name=foo: 0.wtree.xxxxxx
+git_release pivot=1: 1.wtree.xxxxxx
+git_release name=foo pivot=1: 1.wtree.xxxxxx
+git_release pivot=x: x.wtree.xxxxxx
+git_release pivot=2.0: 2.0.wtree.xxxxxx
+git_release pivot=1-1 # invalid: 
+git_release name= # invalid: 
+git_release name="$(git_name)": 
+
 git_vcs: 
 git_vcs subtree=foo: 
 
@@ -76,6 +86,16 @@ git_dir_version follow=2-2 # invalid:
 git_dir_version name= # invalid: 
 git_dir_version name="$(git_name)": 
 
+git_dir_release: 0.wtree.xxxxxx
+git_dir_release name=foo: 0.wtree.xxxxxx
+git_dir_release pivot=1: 1.wtree.xxxxxx
+git_dir_release name=foo pivot=1: 1.wtree.xxxxxx
+git_dir_release pivot=x: x.wtree.xxxxxx
+git_dir_release pivot=2.0: 2.0.wtree.xxxxxx
+git_dir_release pivot=1-1 # invalid: 
+git_dir_release name= # invalid: 
+git_dir_release name="$(git_name)": 
+
 git_dir_vcs: 
 git_dir_vcs subtree=foo: 
 
@@ -132,6 +152,16 @@ git_cwd_version follow=2-2 # invalid:
 git_cwd_version name= # invalid: 
 git_cwd_version name="$(git_cwd_name)": 
 
+git_cwd_release: 0.wtree.xxxxxx
+git_cwd_release name=foo: 0.wtree.xxxxxx
+git_cwd_release pivot=1: 1.wtree.xxxxxx
+git_cwd_release name=foo pivot=1: 1.wtree.xxxxxx
+git_cwd_release pivot=x: x.wtree.xxxxxx
+git_cwd_release pivot=2.0: 2.0.wtree.xxxxxx
+git_cwd_release pivot=1-1 # invalid: 
+git_cwd_release name= # invalid: 
+git_cwd_release name="$(git_name)": 
+
 git_cwd_vcs: 
 git_cwd_vcs subtree=foo: 
 
diff --git a/macros/tests/test_inited_origin_set/log b/macros/tests/test_inited_origin_set/log
index d899e8d..b77d196 100644
--- a/macros/tests/test_inited_origin_set/log
+++ b/macros/tests/test_inited_origin_set/log
@@ -46,6 +46,28 @@ git_version name= # invalid failed with value 1.
 ---
 > git_version name="$(git_name)"
 ---
+> git_release
+---
+> git_release name=foo
+---
+> git_release pivot=1
+---
+> git_release name=foo pivot=1
+---
+> git_release pivot=x
+---
+> git_release pivot=2.0
+---
+> git_release pivot=1-1 # invalid
+ERROR: git_release: pivot cannot contain dashes.
+git_release pivot=1-1 # invalid failed with value 1.
+---
+> git_release name= # invalid
+ERROR: git_release: name cannot be empty.
+git_release name= # invalid failed with value 1.
+---
+> git_release name="$(git_name)"
+---
 > git_vcs
 ---
 > git_vcs subtree=foo
@@ -128,6 +150,28 @@ git_dir_version name= # invalid failed with value 1.
 ---
 > git_dir_version name="$(git_name)"
 ---
+> git_dir_release
+---
+> git_dir_release name=foo
+---
+> git_dir_release pivot=1
+---
+> git_dir_release name=foo pivot=1
+---
+> git_dir_release pivot=x
+---
+> git_dir_release pivot=2.0
+---
+> git_dir_release pivot=1-1 # invalid
+ERROR: git_dir_release: pivot cannot contain dashes.
+git_dir_release pivot=1-1 # invalid failed with value 1.
+---
+> git_dir_release name= # invalid
+ERROR: git_dir_release: name cannot be empty.
+git_dir_release name= # invalid failed with value 1.
+---
+> git_dir_release name="$(git_name)"
+---
 > git_dir_vcs
 ---
 > git_dir_vcs subtree=foo
@@ -210,6 +254,28 @@ git_cwd_version name= # invalid failed with value 1.
 ---
 > git_cwd_version name="$(git_cwd_name)"
 ---
+> git_cwd_release
+---
+> git_cwd_release name=foo
+---
+> git_cwd_release pivot=1
+---
+> git_cwd_release name=foo pivot=1
+---
+> git_cwd_release pivot=x
+---
+> git_cwd_release pivot=2.0
+---
+> git_cwd_release pivot=1-1 # invalid
+ERROR: git_cwd_release: pivot cannot contain dashes.
+git_cwd_release pivot=1-1 # invalid failed with value 1.
+---
+> git_cwd_release name= # invalid
+ERROR: git_cwd_release: name cannot be empty.
+git_cwd_release name= # invalid failed with value 1.
+---
+> git_cwd_release name="$(git_name)"
+---
 > git_cwd_vcs
 ---
 > git_cwd_vcs subtree=foo
diff --git a/macros/tests/test_inited_origin_set/output b/macros/tests/test_inited_origin_set/output
index f9cf718..15f7fdc 100644
--- a/macros/tests/test_inited_origin_set/output
+++ b/macros/tests/test_inited_origin_set/output
@@ -20,6 +20,16 @@ git_version follow=2-2 # invalid:
 git_version name= # invalid: 
 git_version name="$(git_name)": 0.0.wtree.xxxxxx
 
+git_release: 0.wtree.xxxxxx
+git_release name=foo: 0.wtree.xxxxxx
+git_release pivot=1: 1.wtree.xxxxxx
+git_release name=foo pivot=1: 1.wtree.xxxxxx
+git_release pivot=x: x.wtree.xxxxxx
+git_release pivot=2.0: 2.0.wtree.xxxxxx
+git_release pivot=1-1 # invalid: 
+git_release name= # invalid: 
+git_release name="$(git_name)": 0.wtree.xxxxxx
+
 git_vcs: git+https://pagure.io/clime/test.git#HEAD:
 git_vcs subtree=foo: git+https://pagure.io/clime/test.git#HEAD:foo
 
@@ -76,6 +86,16 @@ git_dir_version follow=2-2 # invalid:
 git_dir_version name= # invalid: 
 git_dir_version name="$(git_name)": 0.0.wtree.xxxxxx
 
+git_dir_release: 0.wtree.xxxxxx
+git_dir_release name=foo: 0.wtree.xxxxxx
+git_dir_release pivot=1: 1.wtree.xxxxxx
+git_dir_release name=foo pivot=1: 1.wtree.xxxxxx
+git_dir_release pivot=x: x.wtree.xxxxxx
+git_dir_release pivot=2.0: 2.0.wtree.xxxxxx
+git_dir_release pivot=1-1 # invalid: 
+git_dir_release name= # invalid: 
+git_dir_release name="$(git_name)": 0.wtree.xxxxxx
+
 git_dir_vcs: git+https://pagure.io/clime/test.git#HEAD:
 git_dir_vcs subtree=foo: git+https://pagure.io/clime/test.git#HEAD:foo
 
@@ -132,6 +152,16 @@ git_cwd_version follow=2-2 # invalid:
 git_cwd_version name= # invalid: 
 git_cwd_version name="$(git_cwd_name)": 0.0.wtree.xxxxxx
 
+git_cwd_release: 0.wtree.xxxxxx
+git_cwd_release name=foo: 0.wtree.xxxxxx
+git_cwd_release pivot=1: 1.wtree.xxxxxx
+git_cwd_release name=foo pivot=1: 1.wtree.xxxxxx
+git_cwd_release pivot=x: x.wtree.xxxxxx
+git_cwd_release pivot=2.0: 2.0.wtree.xxxxxx
+git_cwd_release pivot=1-1 # invalid: 
+git_cwd_release name= # invalid: 
+git_cwd_release name="$(git_name)": 0.wtree.xxxxxx
+
 git_cwd_vcs: git+https://pagure.io/clime/test.git#HEAD:
 git_cwd_vcs subtree=foo: git+https://pagure.io/clime/test.git#HEAD:foo
 
diff --git a/macros/tests/test_subdir/log b/macros/tests/test_subdir/log
index d899e8d..b77d196 100644
--- a/macros/tests/test_subdir/log
+++ b/macros/tests/test_subdir/log
@@ -46,6 +46,28 @@ git_version name= # invalid failed with value 1.
 ---
 > git_version name="$(git_name)"
 ---
+> git_release
+---
+> git_release name=foo
+---
+> git_release pivot=1
+---
+> git_release name=foo pivot=1
+---
+> git_release pivot=x
+---
+> git_release pivot=2.0
+---
+> git_release pivot=1-1 # invalid
+ERROR: git_release: pivot cannot contain dashes.
+git_release pivot=1-1 # invalid failed with value 1.
+---
+> git_release name= # invalid
+ERROR: git_release: name cannot be empty.
+git_release name= # invalid failed with value 1.
+---
+> git_release name="$(git_name)"
+---
 > git_vcs
 ---
 > git_vcs subtree=foo
@@ -128,6 +150,28 @@ git_dir_version name= # invalid failed with value 1.
 ---
 > git_dir_version name="$(git_name)"
 ---
+> git_dir_release
+---
+> git_dir_release name=foo
+---
+> git_dir_release pivot=1
+---
+> git_dir_release name=foo pivot=1
+---
+> git_dir_release pivot=x
+---
+> git_dir_release pivot=2.0
+---
+> git_dir_release pivot=1-1 # invalid
+ERROR: git_dir_release: pivot cannot contain dashes.
+git_dir_release pivot=1-1 # invalid failed with value 1.
+---
+> git_dir_release name= # invalid
+ERROR: git_dir_release: name cannot be empty.
+git_dir_release name= # invalid failed with value 1.
+---
+> git_dir_release name="$(git_name)"
+---
 > git_dir_vcs
 ---
 > git_dir_vcs subtree=foo
@@ -210,6 +254,28 @@ git_cwd_version name= # invalid failed with value 1.
 ---
 > git_cwd_version name="$(git_cwd_name)"
 ---
+> git_cwd_release
+---
+> git_cwd_release name=foo
+---
+> git_cwd_release pivot=1
+---
+> git_cwd_release name=foo pivot=1
+---
+> git_cwd_release pivot=x
+---
+> git_cwd_release pivot=2.0
+---
+> git_cwd_release pivot=1-1 # invalid
+ERROR: git_cwd_release: pivot cannot contain dashes.
+git_cwd_release pivot=1-1 # invalid failed with value 1.
+---
+> git_cwd_release name= # invalid
+ERROR: git_cwd_release: name cannot be empty.
+git_cwd_release name= # invalid failed with value 1.
+---
+> git_cwd_release name="$(git_name)"
+---
 > git_cwd_vcs
 ---
 > git_cwd_vcs subtree=foo
diff --git a/macros/tests/test_subdir/output b/macros/tests/test_subdir/output
index 91e231e..1e6dfc0 100644
--- a/macros/tests/test_subdir/output
+++ b/macros/tests/test_subdir/output
@@ -20,6 +20,16 @@ git_version follow=2-2 # invalid:
 git_version name= # invalid: 
 git_version name="$(git_name)": 0.0.wtree.xxxxxx
 
+git_release: 0.wtree.xxxxxx
+git_release name=foo: 0.wtree.xxxxxx
+git_release pivot=1: 1.wtree.xxxxxx
+git_release name=foo pivot=1: 1.wtree.xxxxxx
+git_release pivot=x: x.wtree.xxxxxx
+git_release pivot=2.0: 2.0.wtree.xxxxxx
+git_release pivot=1-1 # invalid: 
+git_release name= # invalid: 
+git_release name="$(git_name)": 0.wtree.xxxxxx
+
 git_vcs: git+https://pagure.io/clime/test.git#HEAD:
 git_vcs subtree=foo: git+https://pagure.io/clime/test.git#HEAD:foo
 
@@ -76,6 +86,16 @@ git_dir_version follow=2-2 # invalid:
 git_dir_version name= # invalid: 
 git_dir_version name="$(git_name)": 0.0.wtree.xxxxxx
 
+git_dir_release: 0.wtree.xxxxxx
+git_dir_release name=foo: 0.wtree.xxxxxx
+git_dir_release pivot=1: 1.wtree.xxxxxx
+git_dir_release name=foo pivot=1: 1.wtree.xxxxxx
+git_dir_release pivot=x: x.wtree.xxxxxx
+git_dir_release pivot=2.0: 2.0.wtree.xxxxxx
+git_dir_release pivot=1-1 # invalid: 
+git_dir_release name= # invalid: 
+git_dir_release name="$(git_name)": 0.wtree.xxxxxx
+
 git_dir_vcs: git+https://pagure.io/clime/test.git#HEAD:subdir2/
 git_dir_vcs subtree=foo: git+https://pagure.io/clime/test.git#HEAD:foo
 
@@ -132,6 +152,16 @@ git_cwd_version follow=2-2 # invalid:
 git_cwd_version name= # invalid: 
 git_cwd_version name="$(git_cwd_name)": 0.0.wtree.xxxxxx
 
+git_cwd_release: 0.wtree.xxxxxx
+git_cwd_release name=foo: 0.wtree.xxxxxx
+git_cwd_release pivot=1: 1.wtree.xxxxxx
+git_cwd_release name=foo pivot=1: 1.wtree.xxxxxx
+git_cwd_release pivot=x: x.wtree.xxxxxx
+git_cwd_release pivot=2.0: 2.0.wtree.xxxxxx
+git_cwd_release pivot=1-1 # invalid: 
+git_cwd_release name= # invalid: 
+git_cwd_release name="$(git_name)": 0.wtree.xxxxxx
+
 git_cwd_vcs: git+https://pagure.io/clime/test.git#HEAD:subdir1/
 git_cwd_vcs subtree=foo: git+https://pagure.io/clime/test.git#HEAD:foo
 
diff --git a/macros/tests/test_tagged/log b/macros/tests/test_tagged/log
index d899e8d..b77d196 100644
--- a/macros/tests/test_tagged/log
+++ b/macros/tests/test_tagged/log
@@ -46,6 +46,28 @@ git_version name= # invalid failed with value 1.
 ---
 > git_version name="$(git_name)"
 ---
+> git_release
+---
+> git_release name=foo
+---
+> git_release pivot=1
+---
+> git_release name=foo pivot=1
+---
+> git_release pivot=x
+---
+> git_release pivot=2.0
+---
+> git_release pivot=1-1 # invalid
+ERROR: git_release: pivot cannot contain dashes.
+git_release pivot=1-1 # invalid failed with value 1.
+---
+> git_release name= # invalid
+ERROR: git_release: name cannot be empty.
+git_release name= # invalid failed with value 1.
+---
+> git_release name="$(git_name)"
+---
 > git_vcs
 ---
 > git_vcs subtree=foo
@@ -128,6 +150,28 @@ git_dir_version name= # invalid failed with value 1.
 ---
 > git_dir_version name="$(git_name)"
 ---
+> git_dir_release
+---
+> git_dir_release name=foo
+---
+> git_dir_release pivot=1
+---
+> git_dir_release name=foo pivot=1
+---
+> git_dir_release pivot=x
+---
+> git_dir_release pivot=2.0
+---
+> git_dir_release pivot=1-1 # invalid
+ERROR: git_dir_release: pivot cannot contain dashes.
+git_dir_release pivot=1-1 # invalid failed with value 1.
+---
+> git_dir_release name= # invalid
+ERROR: git_dir_release: name cannot be empty.
+git_dir_release name= # invalid failed with value 1.
+---
+> git_dir_release name="$(git_name)"
+---
 > git_dir_vcs
 ---
 > git_dir_vcs subtree=foo
@@ -210,6 +254,28 @@ git_cwd_version name= # invalid failed with value 1.
 ---
 > git_cwd_version name="$(git_cwd_name)"
 ---
+> git_cwd_release
+---
+> git_cwd_release name=foo
+---
+> git_cwd_release pivot=1
+---
+> git_cwd_release name=foo pivot=1
+---
+> git_cwd_release pivot=x
+---
+> git_cwd_release pivot=2.0
+---
+> git_cwd_release pivot=1-1 # invalid
+ERROR: git_cwd_release: pivot cannot contain dashes.
+git_cwd_release pivot=1-1 # invalid failed with value 1.
+---
+> git_cwd_release name= # invalid
+ERROR: git_cwd_release: name cannot be empty.
+git_cwd_release name= # invalid failed with value 1.
+---
+> git_cwd_release name="$(git_name)"
+---
 > git_cwd_vcs
 ---
 > git_cwd_vcs subtree=foo
diff --git a/macros/tests/test_tagged/output b/macros/tests/test_tagged/output
index 1d21da7..a462a08 100644
--- a/macros/tests/test_tagged/output
+++ b/macros/tests/test_tagged/output
@@ -20,6 +20,16 @@ git_version follow=2-2 # invalid:
 git_version name= # invalid: 
 git_version name="$(git_name)": 0.0.git.1.xxxxxxx
 
+git_release: 0.git.1.xxxxxxx
+git_release name=foo: 1
+git_release pivot=1: 1.git.1.xxxxxxx
+git_release name=foo pivot=1: 1
+git_release pivot=x: x.git.1.xxxxxxx
+git_release pivot=2.0: 2.0.git.1.xxxxxxx
+git_release pivot=1-1 # invalid: 
+git_release name= # invalid: 
+git_release name="$(git_name)": 0.git.1.xxxxxxx
+
 git_vcs: git+https://pagure.io/clime/test.git#xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx:
 git_vcs subtree=foo: git+https://pagure.io/clime/test.git#xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx:foo
 
@@ -109,6 +119,16 @@ git_dir_version follow=2-2 # invalid:
 git_dir_version name= # invalid: 
 git_dir_version name="$(git_name)": 0.0.git.1.xxxxxxx
 
+git_dir_release: 0.git.1.xxxxxxx
+git_dir_release name=foo: 1
+git_dir_release pivot=1: 1.git.1.xxxxxxx
+git_dir_release name=foo pivot=1: 1
+git_dir_release pivot=x: x.git.1.xxxxxxx
+git_dir_release pivot=2.0: 2.0.git.1.xxxxxxx
+git_dir_release pivot=1-1 # invalid: 
+git_dir_release name= # invalid: 
+git_dir_release name="$(git_name)": 0.git.1.xxxxxxx
+
 git_dir_vcs: git+https://pagure.io/clime/test.git#xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx:
 git_dir_vcs subtree=foo: git+https://pagure.io/clime/test.git#xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx:foo
 
@@ -198,6 +218,16 @@ git_cwd_version follow=2-2 # invalid:
 git_cwd_version name= # invalid: 
 git_cwd_version name="$(git_cwd_name)": 0.0.git.1.xxxxxxx
 
+git_cwd_release: 0.git.1.xxxxxxx
+git_cwd_release name=foo: 1
+git_cwd_release pivot=1: 1.git.1.xxxxxxx
+git_cwd_release name=foo pivot=1: 1
+git_cwd_release pivot=x: x.git.1.xxxxxxx
+git_cwd_release pivot=2.0: 2.0.git.1.xxxxxxx
+git_cwd_release pivot=1-1 # invalid: 
+git_cwd_release name= # invalid: 
+git_cwd_release name="$(git_name)": 0.git.1.xxxxxxx
+
 git_cwd_vcs: git+https://pagure.io/clime/test.git#xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx:
 git_cwd_vcs subtree=foo: git+https://pagure.io/clime/test.git#xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx:foo
 
diff --git a/macros/tests/test_tagged_committed/log b/macros/tests/test_tagged_committed/log
index d899e8d..b77d196 100644
--- a/macros/tests/test_tagged_committed/log
+++ b/macros/tests/test_tagged_committed/log
@@ -46,6 +46,28 @@ git_version name= # invalid failed with value 1.
 ---
 > git_version name="$(git_name)"
 ---
+> git_release
+---
+> git_release name=foo
+---
+> git_release pivot=1
+---
+> git_release name=foo pivot=1
+---
+> git_release pivot=x
+---
+> git_release pivot=2.0
+---
+> git_release pivot=1-1 # invalid
+ERROR: git_release: pivot cannot contain dashes.
+git_release pivot=1-1 # invalid failed with value 1.
+---
+> git_release name= # invalid
+ERROR: git_release: name cannot be empty.
+git_release name= # invalid failed with value 1.
+---
+> git_release name="$(git_name)"
+---
 > git_vcs
 ---
 > git_vcs subtree=foo
@@ -128,6 +150,28 @@ git_dir_version name= # invalid failed with value 1.
 ---
 > git_dir_version name="$(git_name)"
 ---
+> git_dir_release
+---
+> git_dir_release name=foo
+---
+> git_dir_release pivot=1
+---
+> git_dir_release name=foo pivot=1
+---
+> git_dir_release pivot=x
+---
+> git_dir_release pivot=2.0
+---
+> git_dir_release pivot=1-1 # invalid
+ERROR: git_dir_release: pivot cannot contain dashes.
+git_dir_release pivot=1-1 # invalid failed with value 1.
+---
+> git_dir_release name= # invalid
+ERROR: git_dir_release: name cannot be empty.
+git_dir_release name= # invalid failed with value 1.
+---
+> git_dir_release name="$(git_name)"
+---
 > git_dir_vcs
 ---
 > git_dir_vcs subtree=foo
@@ -210,6 +254,28 @@ git_cwd_version name= # invalid failed with value 1.
 ---
 > git_cwd_version name="$(git_cwd_name)"
 ---
+> git_cwd_release
+---
+> git_cwd_release name=foo
+---
+> git_cwd_release pivot=1
+---
+> git_cwd_release name=foo pivot=1
+---
+> git_cwd_release pivot=x
+---
+> git_cwd_release pivot=2.0
+---
+> git_cwd_release pivot=1-1 # invalid
+ERROR: git_cwd_release: pivot cannot contain dashes.
+git_cwd_release pivot=1-1 # invalid failed with value 1.
+---
+> git_cwd_release name= # invalid
+ERROR: git_cwd_release: name cannot be empty.
+git_cwd_release name= # invalid failed with value 1.
+---
+> git_cwd_release name="$(git_name)"
+---
 > git_cwd_vcs
 ---
 > git_cwd_vcs subtree=foo
diff --git a/macros/tests/test_tagged_committed/output b/macros/tests/test_tagged_committed/output
index 0b3663b..f27f83c 100644
--- a/macros/tests/test_tagged_committed/output
+++ b/macros/tests/test_tagged_committed/output
@@ -20,6 +20,16 @@ git_version follow=2-2 # invalid:
 git_version name= # invalid: 
 git_version name="$(git_name)": 0.0.git.2.xxxxxxx
 
+git_release: 0.git.2.xxxxxxx
+git_release name=foo: 1.git.1.xxxxxxx
+git_release pivot=1: 1.git.2.xxxxxxx
+git_release name=foo pivot=1: 1.git.1.xxxxxxx
+git_release pivot=x: x.git.2.xxxxxxx
+git_release pivot=2.0: 2.0.git.2.xxxxxxx
+git_release pivot=1-1 # invalid: 
+git_release name= # invalid: 
+git_release name="$(git_name)": 0.git.2.xxxxxxx
+
 git_vcs: git+https://pagure.io/clime/test.git#xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx:
 git_vcs subtree=foo: git+https://pagure.io/clime/test.git#xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx:foo
 
@@ -77,6 +87,16 @@ git_dir_version follow=2-2 # invalid:
 git_dir_version name= # invalid: 
 git_dir_version name="$(git_name)": 0.0.git.2.xxxxxxx
 
+git_dir_release: 0.git.2.xxxxxxx
+git_dir_release name=foo: 1.git.1.xxxxxxx
+git_dir_release pivot=1: 1.git.2.xxxxxxx
+git_dir_release name=foo pivot=1: 1.git.1.xxxxxxx
+git_dir_release pivot=x: x.git.2.xxxxxxx
+git_dir_release pivot=2.0: 2.0.git.2.xxxxxxx
+git_dir_release pivot=1-1 # invalid: 
+git_dir_release name= # invalid: 
+git_dir_release name="$(git_name)": 0.git.2.xxxxxxx
+
 git_dir_vcs: git+https://pagure.io/clime/test.git#xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx:
 git_dir_vcs subtree=foo: git+https://pagure.io/clime/test.git#xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx:foo
 
@@ -134,6 +154,16 @@ git_cwd_version follow=2-2 # invalid:
 git_cwd_version name= # invalid: 
 git_cwd_version name="$(git_cwd_name)": 0.0.git.2.xxxxxxx
 
+git_cwd_release: 0.git.2.xxxxxxx
+git_cwd_release name=foo: 1.git.1.xxxxxxx
+git_cwd_release pivot=1: 1.git.2.xxxxxxx
+git_cwd_release name=foo pivot=1: 1.git.1.xxxxxxx
+git_cwd_release pivot=x: x.git.2.xxxxxxx
+git_cwd_release pivot=2.0: 2.0.git.2.xxxxxxx
+git_cwd_release pivot=1-1 # invalid: 
+git_cwd_release name= # invalid: 
+git_cwd_release name="$(git_name)": 0.git.2.xxxxxxx
+
 git_cwd_vcs: git+https://pagure.io/clime/test.git#xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx:
 git_cwd_vcs subtree=foo: git+https://pagure.io/clime/test.git#xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx:foo
 
diff --git a/macros/tests/test_uninited/log b/macros/tests/test_uninited/log
index 9ace337..74295cf 100644
--- a/macros/tests/test_uninited/log
+++ b/macros/tests/test_uninited/log
@@ -57,6 +57,31 @@ ERROR: git_name: Not a Git repository.
 ERROR: git_version: name cannot be empty.
 git_version name="$(git_name)" failed with value 1.
 ---
+> git_release
+---
+> git_release name=foo
+---
+> git_release pivot=1
+---
+> git_release name=foo pivot=1
+---
+> git_release pivot=x
+---
+> git_release pivot=2.0
+---
+> git_release pivot=1-1 # invalid
+ERROR: git_release: pivot cannot contain dashes.
+git_release pivot=1-1 # invalid failed with value 1.
+---
+> git_release name= # invalid
+ERROR: git_release: name cannot be empty.
+git_release name= # invalid failed with value 1.
+---
+> git_release name="$(git_name)"
+ERROR: git_name: Not a Git repository.
+ERROR: git_release: name cannot be empty.
+git_release name="$(git_name)" failed with value 1.
+---
 > git_vcs
 ERROR: git_vcs: Start by setting origin URL.
 git_vcs failed with value 1.
@@ -154,6 +179,31 @@ ERROR: git_name: Not a Git repository.
 ERROR: git_dir_version: name cannot be empty.
 git_dir_version name="$(git_name)" failed with value 1.
 ---
+> git_dir_release
+---
+> git_dir_release name=foo
+---
+> git_dir_release pivot=1
+---
+> git_dir_release name=foo pivot=1
+---
+> git_dir_release pivot=x
+---
+> git_dir_release pivot=2.0
+---
+> git_dir_release pivot=1-1 # invalid
+ERROR: git_dir_release: pivot cannot contain dashes.
+git_dir_release pivot=1-1 # invalid failed with value 1.
+---
+> git_dir_release name= # invalid
+ERROR: git_dir_release: name cannot be empty.
+git_dir_release name= # invalid failed with value 1.
+---
+> git_dir_release name="$(git_name)"
+ERROR: git_name: Not a Git repository.
+ERROR: git_dir_release: name cannot be empty.
+git_dir_release name="$(git_name)" failed with value 1.
+---
 > git_dir_vcs
 ERROR: git_dir_vcs: Start by setting origin URL.
 git_dir_vcs failed with value 1.
@@ -251,6 +301,31 @@ ERROR: git_cwd_name: Not a Git repository.
 ERROR: git_cwd_version: name cannot be empty.
 git_cwd_version name="$(git_cwd_name)" failed with value 1.
 ---
+> git_cwd_release
+---
+> git_cwd_release name=foo
+---
+> git_cwd_release pivot=1
+---
+> git_cwd_release name=foo pivot=1
+---
+> git_cwd_release pivot=x
+---
+> git_cwd_release pivot=2.0
+---
+> git_cwd_release pivot=1-1 # invalid
+ERROR: git_cwd_release: pivot cannot contain dashes.
+git_cwd_release pivot=1-1 # invalid failed with value 1.
+---
+> git_cwd_release name= # invalid
+ERROR: git_cwd_release: name cannot be empty.
+git_cwd_release name= # invalid failed with value 1.
+---
+> git_cwd_release name="$(git_name)"
+ERROR: git_name: Not a Git repository.
+ERROR: git_cwd_release: name cannot be empty.
+git_cwd_release name="$(git_name)" failed with value 1.
+---
 > git_cwd_vcs
 ERROR: git_cwd_vcs: Start by setting origin URL.
 git_cwd_vcs failed with value 1.
diff --git a/macros/tests/test_uninited/output b/macros/tests/test_uninited/output
index 0169d69..9c138bb 100644
--- a/macros/tests/test_uninited/output
+++ b/macros/tests/test_uninited/output
@@ -20,6 +20,16 @@ git_version follow=2-2 # invalid:
 git_version name= # invalid: 
 git_version name="$(git_name)": 
 
+git_release: 0
+git_release name=foo: 0
+git_release pivot=1: 1
+git_release name=foo pivot=1: 1
+git_release pivot=x: x
+git_release pivot=2.0: 2.0
+git_release pivot=1-1 # invalid: 
+git_release name= # invalid: 
+git_release name="$(git_name)": 
+
 git_vcs: 
 git_vcs subtree=foo: 
 
@@ -76,6 +86,16 @@ git_dir_version follow=2-2 # invalid:
 git_dir_version name= # invalid: 
 git_dir_version name="$(git_name)": 
 
+git_dir_release: 0
+git_dir_release name=foo: 0
+git_dir_release pivot=1: 1
+git_dir_release name=foo pivot=1: 1
+git_dir_release pivot=x: x
+git_dir_release pivot=2.0: 2.0
+git_dir_release pivot=1-1 # invalid: 
+git_dir_release name= # invalid: 
+git_dir_release name="$(git_name)": 
+
 git_dir_vcs: 
 git_dir_vcs subtree=foo: 
 
@@ -132,6 +152,16 @@ git_cwd_version follow=2-2 # invalid:
 git_cwd_version name= # invalid: 
 git_cwd_version name="$(git_cwd_name)": 
 
+git_cwd_release: 0
+git_cwd_release name=foo: 0
+git_cwd_release pivot=1: 1
+git_cwd_release name=foo pivot=1: 1
+git_cwd_release pivot=x: x
+git_cwd_release pivot=2.0: 2.0
+git_cwd_release pivot=1-1 # invalid: 
+git_cwd_release name= # invalid: 
+git_cwd_release name="$(git_name)": 
+
 git_cwd_vcs: 
 git_cwd_vcs subtree=foo: 
 

