You can get it from `git tag` output which is probably unnecessary complication. What about this ?

```
0.12rc1    0.12.0.0.0.1
...
0.12rc<n>  0.12.0.0.0.<n>
0.12       0.12.0.0.1.0 # release
0.12.0.1   0.12.0.0.1.1 # respin
...
0.12.0.<k> 0.12.0.0.1.<k> # last respin
0.12.1     0.12.1.0.0.0 # first stable
...
0.12.<m>   0.12.<m>.0.0.0 # last stable
```