You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Explicit branch match should override default config #881
As mentioned in #868, it's a bit surprising when adding custom branch config to GitVersion.yml and then have GitVersion implicitly apply its default config to match the same branch (via regex). It would be less surprising if explicit config did override the default/implicit config. If we get a branch match on the explicit config, we shouldn't apply the default one to the same branch.
changed the title [-]Explicit branch match should override implicit/default in config[/-][+]Explicit branch match should override default config[/+]on May 25, 2016
Yea, that sounds like a good way to solve it. It's just that we need to stamp matched branches as Matched somehow so future matches in the default config for a Matched branch will be ignored. Not a very hard thing to implement, but still.
I feel like there's still value in the change. Consider the scenario when you have a specific configuration you want to override on a general one. For example:
release/legacyVer - configuration for a legacy versioned release
release/ - configuration for general releases going forward
Without the change both of those would match and throw an exception. You'd have to explicitly put a negative lookahead on the general configuration's regex in order to make them mutually exclusive, which feels a bit hacky.
Activity
[-]Explicit branch match should override implicit/default in config[/-][+]Explicit branch match should override default config[/+]JakeGinnivan commentedon May 26, 2016
This will require a bit of a change to the way the config stuff works.
Maybe rather than throwing if there are multiple the configs from the version file are listed before defaults. Then we take the first matching option?
asbjornu commentedon May 26, 2016
Yea, that sounds like a good way to solve it. It's just that we need to stamp matched branches as
Matchedsomehow so future matches in the default config for aMatchedbranch will be ignored. Not a very hard thing to implement, but still.JakeGinnivan commentedon Nov 26, 2016
With the change to v4 you can now remove branch configuration but just clearing it's regex value in your config. Unsure if we need this change now?
JakeGinnivan commentedon Nov 26, 2016
// @cvpcs ☝️
cvpcs commentedon Nov 26, 2016
I feel like there's still value in the change. Consider the scenario when you have a specific configuration you want to override on a general one. For example:
release/legacyVer - configuration for a legacy versioned release
release/ - configuration for general releases going forward
Without the change both of those would match and throw an exception. You'd have to explicitly put a negative lookahead on the general configuration's regex in order to make them mutually exclusive, which feels a bit hacky.
JakeGinnivan commentedon Nov 27, 2016
Sounds reasonable