-
Notifications
You must be signed in to change notification settings - Fork 2.5k
cred: change enum to git_credential_t and GIT_CREDENTIAL_* #5336
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
8e409a4
to
d40bfe3
Compare
We've gone on a tear and removed abbreviations. Maybe |
Hm, I'm honestly not too sure about this. I mean we are discerning credential types here, right? There's definitely some inconsistencies in our tree:
Well, seeing that we've already moved from And yes, if we're already dropping "type" then I'd vote for going with "git_credential_t". |
I'll knock this out over the weekend. |
edc46fe
to
31afa04
Compare
I did this over in #5364 |
a6d305c
to
17446ba
Compare
OK, I've refactored I also renamed the |
17446ba
to
87a39e0
Compare
87a39e0
to
441cb2d
Compare
/* These declarations have moved. */ | ||
#ifndef GIT_DEPRECATE_HARD | ||
# include "git2/credential_helpers.h" | ||
#endif |
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.
Wouldn't we want to do the same header-forwarding for "git2/cred.h"?
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.
We could, but our guidance has always been for people to include git2.h
, which will bring in all the things except sys/
and - somewhat oddly - cred_helpers.h
. So people should not have been including git2/cred.h
directly.
This feels a little weird to me though. I almost feel like we should just include these functions as part of the overall git2.h
experience.
src/streams/openssl.c.bak
Outdated
@@ -0,0 +1,795 @@ | |||
/* |
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 file doesn't look like it belongs here :)
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.
Oops. Thanks - fixed!
441cb2d
to
7acde3c
Compare
We avoid abbreviations where possible; rename git_cred to git_credential. In addition, we have standardized on a trailing `_t` for enum types, instead of using "type" in the name. So `git_credtype_t` has become `git_credential_t` and its members have become `GIT_CREDENTIAL` instead of `GIT_CREDTYPE`. Finally, the source and header files have been renamed to `credential` instead of `cred`. Keep previous name and values as deprecated, and include the new header files from the previous ones.
7acde3c
to
3f54ba8
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.
Let's not hold this up because of that missing space, right? ;) Thanks a lot for your work, @ethomson!
const char *username, | ||
const char *password) | ||
{ | ||
return git_credential_userpass_plaintext_new(out,username, password); |
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.
Missing space
We have standardized on a trailing
_t
for enum types, instead of using "type" in the name. Sogit_credtype_t
is more appropriately namedgit_credential_t
.Change the name, keeping the previous name and values as deprecated.