-
Notifications
You must be signed in to change notification settings - Fork 652
Feature/pathfilter #2862
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
Feature/pathfilter #2862
Conversation
Questions to @asbjornu:
|
Is there a hope that this pull request gets merged in some time soon? |
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.
Is there a hope that this pull request gets merged in some time soon?
Sorry for leaving this unreviewed for so long.
Questions to @asbjornu:
- The path filters are currently applied as commit filter in
GetIncrementForCommits
inIncrementStrategyFinder
but in the debug session, this method is not executed. Did I understand something wrong?
Perhaps you didn't have the right mode
configured in the debug session? A bit hard to say without more information.
- Could you please advice me how to get the reference to IGitRepository in the PathFilter? Is the current approach acceptable or am I on a completely wrong track?
I think the current solution with using GitVersionContext
is fine, but I'd like @arturcic's input here as well.
- The configuration is instantiated many times but only once with the content from the configuration yaml file. So only one object has the correct filters in it. Do you build the default config multiple times in the code?
Not deliberately. I'm not sure why we would need several Config
objects. I would think that should be an immutable singleton.
if (version == null) throw new ArgumentNullException(nameof(version)); | ||
|
||
reason = null; | ||
if (version.Source.StartsWith("Fallback") || version.Source.StartsWith("Git tag") || version.Source.StartsWith("NextVersion")) return false; |
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.
These string matches feel fragile. Is there not something more constant and typesafe we can base this comparison on?
|
||
reason = null; | ||
|
||
var match = new System.Text.RegularExpressions.Regex($"^({context.Configuration.GitTagPrefix}).*$", System.Text.RegularExpressions.RegexOptions.Compiled); |
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.
Please add a using
statement to make the code terser.
var match = new System.Text.RegularExpressions.Regex($"^({context.Configuration.GitTagPrefix}).*$", System.Text.RegularExpressions.RegexOptions.Compiled); | |
var match = new Regex($"^({context.Configuration.GitTagPrefix}).*$", System.Text.RegularExpressions.RegexOptions.Compiled); |
This issue has been automatically marked as stale because it has not had recent activity. After 30 days from now, it will be closed if no further activity occurs. Thank you for your contributions. |
@marc-mueller, do you think you could spend a few minutes going over my feedback and rebasing this onto the |
This issue has been automatically marked as stale because it has not had recent activity. After 30 days from now, it will be closed if no further activity occurs. Thank you for your contributions. |
:-( |
@gentledepp you are free to fork this PR and submit a new one. |
9801764
to
b7a7608
Compare
42cdd67
to
7979c63
Compare
0debb99
to
aefb1fa
Compare
@asbjornu I'm going to close this draft as the difference is already too huge for us to maintain. If the author wants to continue the work I would say he needs to re-create the Draft or PR from the current main |
Description
Filter on tags on prefix or regex, to make it possible to use multiple git versions in one repository.
Related Issue
Resolves #2436
https://github.com/sebastienwarin/GitVersion/commits/feature/pathfilters
Motivation and Context
Use multiple git versions in one repository
How Has This Been Tested?
Screenshots (if appropriate):
Checklist: