cred: change enum to git_credential_t and GIT_CREDENTIAL_*#5336
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.
Wouldn't we want to do the same header-forwarding for "git2/cred.h"?
There was a problem hiding this comment.
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.
| @@ -0,0 +1,795 @@ | |||
| /* | |||
There was a problem hiding this comment.
This file doesn't look like it belongs here :)
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
| const char *username, | ||
| const char *password) | ||
| { | ||
| return git_credential_userpass_plaintext_new(out,username, password); |
We have standardized on a trailing
_tfor enum types, instead of using "type" in the name. Sogit_credtype_tis more appropriately namedgit_credential_t.Change the name, keeping the previous name and values as deprecated.