Skip to content

[Feature] Same version computed on different branches #3453

@xpicio

Description

@xpicio

Describe the bug
Hello, to be honest i'm not sure if it is a gitversion issue or i'm not using gitflow right. But i hope you could help me.

I created this repository https://github.com/xpicio/compute-version to test incremental version using conventional commits, the repo is based on gitflow model and i'm using git tower with the gitflow plugin.

In the actual state (after i closed an hotfix, pushed both branches develop and main, and finally added a tag) when i compute the version on develop or main branch, the version is the same: 0.2.4. This behaviour is causing an issue in CI/CD pipelines, when i need to restart a pipeline (should happen to fix a bug on the pipeline) the artifacts tagged from the develop branch will assume the same version of the artifacts from the main branch.

Expected Behavior

action branch commit message sha version
close hotfix (random)
develop 53720f5d878cbc9eab27fbb127615c3e85971409 0.3.0-alpha.9
main 53720f5d878cbc9eab27fbb127615c3e85971409 0.2.4
new tag v0.2.4 53720f5d878cbc9eab27fbb127615c3e85971409
develop 53720f5d878cbc9eab27fbb127615c3e85971409 0.x.x-alpha.x
main 53720f5d878cbc9eab27fbb127615c3e85971409 0.2.4

The version on develop branch is different to main

Actual Behavior

action branch commit message sha version
close hotfix (random)
develop 53720f5d878cbc9eab27fbb127615c3e85971409 0.3.0-alpha.9
main 53720f5d878cbc9eab27fbb127615c3e85971409 0.2.4
new tag v0.2.4 53720f5d878cbc9eab27fbb127615c3e85971409
develop 53720f5d878cbc9eab27fbb127615c3e85971409 0.2.4
main 53720f5d878cbc9eab27fbb127615c3e85971409 0.2.4

The version on develop branch is equal to main

Steps to Reproduce

docker run --rm gittools/gitversion:6.0.0-beta.1 \
    /url https://github.com/xpicio/compute-version.git \
    /b develop
docker run --rm gittools/gitversion:6.0.0-beta.1 \
    /url https://github.com/xpicio/compute-version.git \
    /b main

Your Environment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions