-
Notifications
You must be signed in to change notification settings - Fork 424
Make url optional via a new "cred" feature gate for credential helpers; disable default features #1168
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
Add an enabled-by-default feature flag for credential helpers, which are the only uses of the `url` crate. This reduces a `default-features = false` build of git2 from 54 dependencies to 17, for a configuration that many tools (e.g. anything that only cares about local repositories) can happily use. In addition to enabling it by default, make the "https" and "ssh" features depend on "cred".
4cc6bed
to
da9c98d
Compare
…inary size With current git2, this reduces lstr from 144 dependencies to 137, and from 4.3M to 3.6M. With rust-lang/git2-rs#1168 merged into upstream git2-rs, it further reduces lstr to 107 dependencies (though with negligible additional improvement to binary size as the additional dependencies were compiled out).
…inary size With current git2, this reduces lstr from 144 dependencies to 137, and from 4.3M to 3.6M. With rust-lang/git2-rs#1168 merged into upstream git2-rs, it further reduces lstr to 106 dependencies (though with negligible additional improvement to binary size as the additional dependencies were compiled out).
Wow, I did not know that's how url works. This will need to be a major change, correct? |
@ehuss The new That said, a major version bump would still be the safest approach. And, if we bump the major version, I think we should consider disabling some or all of these features by default. |
Many users of the git2 crate want to operate exclusively on local repositories, but if they don't use `default-features = false` they'll get a large set of additional dependencies they don't need.
Rather than hoping the change will have no impact on users of 0.20, I've bumped the version to 0.21, and then disabled default features (since we can do that over a semver-major release). |
da37c28
to
0b5342a
Compare
0b5342a
to
875a4cc
Compare
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.
Thanks!
@joshtriplett I'm having some second thoughts about removing the default features. For example, this essentially breaks some of the examples that are in this repository. I don't really have any data to say whether the majority of users of this library need networking or not. Generally I believe that the difficulty of carefully including the correct set of features ( |
Add a new feature flag for credential helpers, which are the only uses of the
url
crate. This reduces a build of git2 from 54 dependencies to 17, for a configuration that many tools (e.g. anything that only cares about local repositories) can happily use.Make the "https" and "ssh" features depend on "cred".
Disable all of these features by default, to avoid extra dependencies in the common case of tools that only care about local repositories.
Bump the crate version to 0.21.