Skip to content

Explicit branch match should override default config #881

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
asbjornu opened this issue May 25, 2016 · 6 comments
Closed

Explicit branch match should override default config #881

asbjornu opened this issue May 25, 2016 · 6 comments

Comments

@asbjornu
Copy link
Member

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.

@asbjornu asbjornu changed the title Explicit branch match should override implicit/default in config Explicit branch match should override default config May 25, 2016
@JakeGinnivan
Copy link
Contributor

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
Copy link
Member Author

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.

@JakeGinnivan
Copy link
Contributor

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
Copy link
Contributor

// @cvpcs ☝️

@cvpcs
Copy link
Contributor

cvpcs commented 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
Copy link
Contributor

Sounds reasonable

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants