Skip to content

How to override version strategy computation #1419

@Bhaal22

Description

@Bhaal22

Hi,

First, I want to say we are definitely in a bad state regarding semver.
We have a library which was is submodule of our global product. We never wanted to ship the library as a single component to external teams. So we tagged / branched the library repository with the version of the global product.

That's why we have such a log while running gitversion

INFO [06/04/18 12:13:34:70] Begin: Calculating base versions
  INFO [06/04/18 12:13:34:73] Fallback base version: 0.1.0 with commit count source bf49308fd315ba63da4c0ee557d8d888332fbfe6 (Incremented: None)
  INFO [06/04/18 12:13:34:81] Git tag 'v4.0.1': 4.0.1 with commit count source 8647a67c17b054caa58b8aa2281246a208ecfa28 (Incremented: 4.0.2)
  INFO [06/04/18 12:13:34:84] Git tag 'v3.2': 3.2.0 with commit count source 81f5503ab4fc25ae3ffd174cc063b0ec2295a733 (Incremented: 3.2.1)
  INFO [06/04/18 12:13:34:87] Git tag 'v3.1': 3.1.0 with commit count source 289a40aea81b3ab07a01f5631fd2a257c0108208 (Incremented: 3.0.1)
  INFO [06/04/18 12:13:34:91] Git tag 'v3.0': 3.0.0 with commit count source 289a40aea81b3ab07a01f5631fd2a257c0108208 (Incremented: 3.0.1)
  INFO [06/04/18 12:13:34:94] Git tag 'v2.0': 2.0.0 with commit count source e32304b92f52af200d097cccfe0b8197986e12f5 (Incremented: 2.0.1)
  INFO [06/04/18 12:13:34:96] Git tag '11.0.0': 11.0.0 with commit count source e32304b92f52af200d097cccfe0b8197986e12f5 (Incremented: 11.0.1)
  INFO [06/04/18 12:13:34:98] Merge message 'Merge remote-tracking branch 'origin/v11.2' into develop': 11.2.0 with commit count source 5dc711c6637d54cae35bd6eef6f17e26441f6376 (Incremented: None)
  INFO [06/04/18 12:13:34:99] Found multiple base versions which will produce the same SemVer (11.2.0), taking oldest source for commit counting (Merge message 'Merge remote-tracking branch 'origin/v11.2' into develop')
  INFO [06/04/18 12:13:34:99] Base version used: Merge message 'Merge remote-tracking branch 'origin/v11.2' into develop': 11.2.0 with commit count source 5dc711c6637d54cae35bd6eef6f17e26441f6376 (Incremented: None) 

You can see at the end thatt we have merge commits.
Since I would not like to tag all my commits, I would like to know if there is a way to run only the TaggedCommitVersionStrategy and not use old commits to make version computations.

Our global product is now in 12.x I would not like to make my library pass to v12.x just to be upper than the computed version.

Is there a way maybe to use the more recent commit in this history to be considered as the last version to use as a base to compute next versions?

Thank you.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions