GitVersion icon indicating copy to clipboard operation
GitVersion copied to clipboard

increment: inherit from incoming branch

Open AurimasNav opened this issue 2 years ago • 1 comments

Detailed Description

Increment setting to "inherit" from incoming branch. I would like my main branch version increased, based on the settings of the branch being merged into it.

Context

I would like to rely on manual version bumping with +semver: minor as little as possible. If I have feature branch with configuration increment: Minor it would be nice that when I merge this branch into main it would inherit the Minor increment setting.

AurimasNav avatar May 09 '22 12:05 AurimasNav

It's actually not clear for me what you trying to achieve with the feature. Could you please write an integration test and describe in it what you are expecting from this feature?

[Test]
public void __Just_A_Test__()
{
    string yaml = @"...";

    var configuration = ConfigSerializer.Read(new StringReader(yaml));

    using var fixture = new EmptyRepositoryFixture();

    fixture.MakeATaggedCommit("2.0.0");

    // ✅ succeeds as expected
    fixture.AssertFullSemver("2.0.0", configuration);

    // ❌ expected: ...
    fixture.AssertFullSemver("...", configuration);
}

HHobeck avatar Sep 21 '22 17:09 HHobeck

This what you want is already possible in GitVersion with the usage of mainline mode:

image

This feature was introduced with issue https://github.com/GitTools/GitVersion/issues/1221. This might be also interesting https://github.com/GitTools/GitVersion/issues/2955

HHobeck avatar Mar 05 '23 08:03 HHobeck