Skip to content

Explicit branch match should override default config #881

Closed

Description

@asbjornu

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.

Activity

  1. changed the title [-]Explicit branch match should override implicit/default in config[/-] [+]Explicit branch match should override default config[/+] on May 25, 2016
  2. JakeGinnivan commented on May 26, 2016

    @JakeGinnivan
    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?

  3. asbjornu commented on May 26, 2016

    @asbjornu
    MemberAuthor

    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.

  4. JakeGinnivan commented on Nov 26, 2016

    @JakeGinnivan
    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?

  5. JakeGinnivan commented on Nov 26, 2016

    @JakeGinnivan
    Contributor

    // @cvpcs ☝️

  6. cvpcs commented on Nov 26, 2016

    @cvpcs
    Contributor

    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.

  7. JakeGinnivan commented on Nov 27, 2016

    @JakeGinnivan
    Contributor

    Sounds reasonable

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions