hartym / git-semver

git-semver is a tiny git addon to manage your project's version numbers
http://rdc.li/git-semver
16 stars 3 forks source link

flaw in detecting latest version #3

Closed eshepelyuk closed 4 years ago

eshepelyuk commented 4 years ago

Currently, the latest version is determined using git tags list independently of the current branch. This will not work for the fix branch flow. lets see in master we have tags, the minor version increases

And then we make a fix branch from tag 0.2.0. Where we want to increment patch version only, eg

With current code it will not work, because in fix branch it will detect 0.3.0 as the latest tag in repository.

Instead the latest version should be detected using

$ git describe --abbrev=0 --first-parent

This command ensures search only in current branch, making possible to keep versioning in fixe branches independently of master.

@hartym what do you think about this proposal ?

eshepelyuk commented 4 years ago

Any feedback plz ?

eshepelyuk commented 4 years ago

@hartym ?