-
Notifications
You must be signed in to change notification settings - Fork 651
Failing inheritance fixes #456
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
Conversation
@@ -117,8 +131,8 @@ public class BranchConfigurationCalculator | |||
else | |||
errorMessage = "Failed to inherit Increment branch configuration, ended up with: " + string.Join(", ", possibleParents.Select(p => p.Name)); | |||
|
|||
var hasDevelop = repository.Branches["develop"] != null; | |||
var branchName = hasDevelop ? "develop" : "master"; | |||
var developBranch = repository.Branches.FirstOrDefault(b => Regex.IsMatch(b.Name, "^develop", RegexOptions.IgnoreCase)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why using regex for this one? Maybe it's even better to make this a setting (I see some people using "dev" instead on the inet).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A setting for this is already available (as per #292), no?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then we should use it :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this can be removed. The new logic should allow not having this fallback. Let me look into it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can't be removed at the moment. If the code gets to the point where it cannot figure out which branch to inherit from then this code needs to be able to pick between master and develop.
An example:
* [master, develop]
|
* [feature/foo]
In this scenario there is no way to know if GitVersion should inheirit the config from master or develop, this code makes sure that develop gets selected. It isn't great but I can't think of a better solution?
I think it looks good, but I am not 100 % into GitVersion (yet), so might have overseen something. |
Builds on @rcknight's pull request at #429. This fixed the perf issues when inheriting branch config and also fixes the failing test in #429
@asbjornu @GeertvanHorrik fyi and code review would be grand
@nulltoken could you have a look at the libgit2 stuff?