Skip to content

Introduce GlobalSettings.Features() #717

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

Merged
merged 1 commit into from
May 30, 2014
Merged

Conversation

ethomson
Copy link
Member

Allow consumers to see what features are included with the libgit2 build that is being used.

Right now we do a little scrubbing in our UI so that we display nicer error messages when somebody tries to clone an ssh:// URL, since we do not yet support SSH. (Instead of saying "This version of libgit2 was not built with SSH support", which is some very leaky abstraction.) If somebody were to bring their own libgit2 to the party, though, it would be nice if we would not do this, and instead just pass the URL right down to libgit2.

Thus we would like to query the built features.

@dahlbyk
Copy link
Member

dahlbyk commented May 28, 2014

Idea: leverage this to auto-skip tests that require certain features.

Also, should the enum have a default value (None or similar)?

@ethomson
Copy link
Member Author

Also, should the enum have a default value (None or similar)?

I think so? Is None the right thing here? I can see that it might be semantically nice to say Features == BuiltInFeatures.None. But saying Features.Contains(BuiltInFeatures.None) seems weird. Is there some other key for this that would make more semantic sense or should I just push this with None = 0?

@ethomson ethomson closed this May 28, 2014
@ethomson ethomson reopened this May 28, 2014
@ethomson
Copy link
Member Author

(Oops, fat-fingered the close button there.)

public enum BuiltInFeatures
{
/// <summary>
/// Threading support is compiled in to libgit2.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't it be into here and below?

@ethomson
Copy link
Member Author

Updated with the comments; not sure why travis is being so slow here.

@nulltoken nulltoken merged commit 4516af5 into libgit2:vNext May 30, 2014
@nulltoken
Copy link
Member

👍

@nulltoken nulltoken added this to the v0.18.0 milestone May 30, 2014
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.

3 participants