-
Notifications
You must be signed in to change notification settings - Fork 897
Should we allow Configuration to parse a local repository config? #1042
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
Would you need to do a breaking change? Why not have a
named constructor which would make sure ther's a repo at |
@carlosmn even if we make this method
|
Well, don't do that? If you do that you're ignoring the documentation which says that's a named constructor plus your IDE telling you it's a static method and you should not use an instance to refer to it. |
There's no such thing in C#
It's perfectly valid to call a static method from an instance
I think very few people actually read the documentation. Most of them rely on intellisense and try-outs.
I may indeed have little faith in humanity... |
seconded. |
@nulltoken, I think you might be confusing static methods with extension methods here. For your code example above to be valid,
but if you do it this way instead:
the method would work as @carlosmn proposes with no intellisense confusion. |
6edfe44
to
76e88dd
Compare
So, I did this thing.... which is now ready for review. |
a0c2c9c
to
b03c9d1
Compare
string xdgConfigurationFileLocation, string systemConfigurationFileLocation) | ||
{ | ||
this.repository = repository; | ||
|
||
if (repositoryConfigurationFileLocation != null) | ||
{ | ||
repoConfigPath = NormalizeConfigPath(repositoryConfigurationFileLocation); |
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.
when does this have to be normalized? Could we have a single expected format for the incoming config file location?
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 probing was added because @ethomson mentioned once that it might be interesting to not being compelled to pass the full path to the config.
As such, it would accept a working directory, a bare repository folder or a full path to a known config file.
If this is no longer required, I can easily remove it.
👍 I think this looks good! |
Note to self: drop the |
b03c9d1
to
ca4d15e
Compare
Should we allow Configuration to parse a local repository config?
Published as NuGet pre-release package |
@shiftkey in #1031 made an amazing job getting rid of the optional parameters in favor of overloads. While taking a look at the changes in Configuration, I wondered if there was a use case where one would need to access the config of a repository without instantiating it.
Should this need be fulfilled, we'd rather make it happen in v0.22 as it will be quite a nasty breaking change.
/cc @jamill @ethomson