Skip to content

Address tag parsing #496

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

Conversation

JakeGinnivan
Copy link
Contributor

Opening PR to discuss changes highlighted in #495

Chris Leigh added 2 commits July 13, 2015 13:08
…int. No longer will consider any tag string containing a version as a candidate. Accordingly, default configuration no longer uses [vV] (some unit tests changed as a result) since most unit tests do no use the prefix.
@JakeGinnivan
Copy link
Contributor Author

There is a small issue (which is causing the test failure) that a tag without the prefix will fail to pass.

Changing the regex from var match = Regex.Match(version, string.Format("^({0})(?<version>.*)$", tagPrefixRegex)); to var match = Regex.Match(version, string.Format("^({0})?(?<version>.*)$", tagPrefixRegex)); (making the prefix optional) fixed the issue.

Thanks gain for the changes

@JakeGinnivan
Copy link
Contributor Author

Merged into master via 50833b4

Tungsten78 pushed a commit to Tungsten78/GitVersion that referenced this pull request Jul 14, 2015
… intended with default TagPrefix of "[vV]|"
@Tungsten78
Copy link

@JakeGinnivan, I committed another pass to better illustrate what I was trying to accomplish. The intent was to have the TagPrefix denote whether to treat as optional. This being the default should handle most legacy usages with the exception of those already carrying around the old default of "[vV]" in their GitVersionConfig.yaml. Technically, this would be a breaking change to those people.

I apologize for having left loose ends with the failed test. I'm only reiterating because I feel the partial inclusion of the "[vV]|" is leaving the code base a little off (since the ? within the regex makes this redundant).

@JakeGinnivan
Copy link
Contributor Author

I get you. The only issue is if someone has run git init it dumps the default config into the config file (I probably should fix that).

Do you see an issue with leaving the default as [vV] and making it optional in the parser. The inclusion of the ^$ should fix the issues you describe?

@Tungsten78
Copy link

Yes as merged it corrects my issue. It is only the remnants of what I was trying to accomplish that have left a bad taste in my mouth. I agree with the backwards compatibility issue. I will rework my pull tomorrow as a cleanup only. Thanks.

@JakeGinnivan
Copy link
Contributor Author

Thanks, sorry I missed part of what you were doing

Tungsten78 pushed a commit to Tungsten78/GitVersion that referenced this pull request Jul 15, 2015
…at resulted from a partial merge of pull request. More specifically TagPrefix is always considered optional.
@Tungsten78
Copy link

@JakeGinnivan Here is the cleanup I promised.

@JakeGinnivan
Copy link
Contributor Author

@Tungsten78 could you submit a PR for this?

@Tungsten78 Tungsten78 mentioned this pull request Jul 16, 2015
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

Successfully merging this pull request may close these issues.

2 participants