Skip to content

Commit cceefcd

Browse files
authored
Merge pull request libgit2#4827 from tiennou/fix/documentation-fixups
Documentation fixups
2 parents 1621a37 + 25da1ac commit cceefcd

File tree

3 files changed

+59
-20
lines changed

3 files changed

+59
-20
lines changed

include/git2/checkout.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ GIT_BEGIN_DECL
6767
* To emulate `git checkout -f`, use `GIT_CHECKOUT_FORCE`.
6868
*
6969
*
70-
* There are some additional flags to modified the behavior of checkout:
70+
* There are some additional flags to modify the behavior of checkout:
7171
*
7272
* - GIT_CHECKOUT_ALLOW_CONFLICTS makes SAFE mode apply safe file updates
7373
* even if there are conflicts (instead of cancelling the checkout).

include/git2/config.h

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,17 @@ typedef struct git_config_entry {
7575
*/
7676
GIT_EXTERN(void) git_config_entry_free(git_config_entry *);
7777

78-
typedef int (*git_config_foreach_cb)(const git_config_entry *, void *);
78+
/**
79+
* A config enumeration callback
80+
*
81+
* @param entry the entry currently being enumerated
82+
* @param payload a user-specified pointer
83+
*/
84+
typedef int (*git_config_foreach_cb)(const git_config_entry *entry, void *payload);
85+
86+
/**
87+
* An opaque structure for a configuration iterator
88+
*/
7989
typedef struct git_config_iterator git_config_iterator;
8090

8191
/**
@@ -252,7 +262,7 @@ GIT_EXTERN(int) git_config_open_level(
252262
* Open the global/XDG configuration file according to git's rules
253263
*
254264
* Git allows you to store your global configuration at
255-
* `$HOME/.config` or `$XDG_CONFIG_HOME/git/config`. For backwards
265+
* `$HOME/.gitconfig` or `$XDG_CONFIG_HOME/git/config`. For backwards
256266
* compatability, the XDG file shouldn't be used unless the use has
257267
* created it explicitly. With this function you'll open the correct
258268
* one to write to.
@@ -581,7 +591,7 @@ GIT_EXTERN(int) git_config_iterator_glob_new(git_config_iterator **out, const gi
581591
/**
582592
* Perform an operation on each config variable matching a regular expression.
583593
*
584-
* This behaviors like `git_config_foreach` with an additional filter of a
594+
* This behaves like `git_config_foreach` with an additional filter of a
585595
* regular expression that filters which config keys are passed to the
586596
* callback.
587597
*
@@ -711,11 +721,11 @@ GIT_EXTERN(int) git_config_parse_int64(int64_t *out, const char *value);
711721
GIT_EXTERN(int) git_config_parse_path(git_buf *out, const char *value);
712722

713723
/**
714-
* Perform an operation on each config variable in given config backend
724+
* Perform an operation on each config variable in a given config backend,
715725
* matching a regular expression.
716726
*
717-
* This behaviors like `git_config_foreach_match` except instead of all config
718-
* entries it just enumerates through the given backend entry.
727+
* This behaves like `git_config_foreach_match` except that only config
728+
* entries from the given backend entry are enumerated.
719729
*
720730
* The regular expression is applied case-sensitively on the normalized form of
721731
* the variable name: the section and variable parts are lower-cased. The

include/git2/transport.h

Lines changed: 42 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -77,44 +77,73 @@ typedef struct {
7777
*** Begin interface for credentials acquisition ***
7878
*/
7979

80-
/** Authentication type requested */
80+
/**
81+
* Supported credential types
82+
*
83+
* This represents the various types of authentication methods supported by
84+
* the library.
85+
*/
8186
typedef enum {
82-
/* git_cred_userpass_plaintext */
87+
/**
88+
* A vanilla user/password request
89+
* @see git_cred_userpass_plaintext_new
90+
*/
8391
GIT_CREDTYPE_USERPASS_PLAINTEXT = (1u << 0),
8492

85-
/* git_cred_ssh_key */
93+
/**
94+
* An SSH key-based authentication request
95+
* @see git_cred_ssh_key_new
96+
*/
8697
GIT_CREDTYPE_SSH_KEY = (1u << 1),
8798

88-
/* git_cred_ssh_custom */
99+
/**
100+
* An SSH key-based authentication request, with a custom signature
101+
* @see git_cred_ssh_custom_new
102+
*/
89103
GIT_CREDTYPE_SSH_CUSTOM = (1u << 2),
90104

91-
/* git_cred_default */
105+
/**
106+
* An NTLM/Negotiate-based authentication request.
107+
* @see git_cred_default
108+
*/
92109
GIT_CREDTYPE_DEFAULT = (1u << 3),
93110

94-
/* git_cred_ssh_interactive */
111+
/**
112+
* An SSH interactive authentication request
113+
* @see git_cred_ssh_interactive_new
114+
*/
95115
GIT_CREDTYPE_SSH_INTERACTIVE = (1u << 4),
96116

97117
/**
98-
* Username-only information
118+
* Username-only authentication request
99119
*
100-
* If the SSH transport does not know which username to use,
101-
* it will ask via this credential type.
120+
* Used as a pre-authentication step if the underlying transport
121+
* (eg. SSH, with no username in its URL) does not know which username
122+
* to use.
123+
*
124+
* @see git_cred_username_new
102125
*/
103126
GIT_CREDTYPE_USERNAME = (1u << 5),
104127

105128
/**
106-
* Credentials read from memory.
129+
* An SSH key-based authentication request
130+
*
131+
* Allows credentials to be read from memory instead of files.
132+
* Note that because of differences in crypto backend support, it might
133+
* not be functional.
107134
*
108-
* Only available for libssh2+OpenSSL for now.
135+
* @see git_cred_ssh_key_memory_new
109136
*/
110137
GIT_CREDTYPE_SSH_MEMORY = (1u << 6),
111138
} git_credtype_t;
112139

113-
/* The base structure for all credential types */
114140
typedef struct git_cred git_cred;
115141

142+
/**
143+
* The base structure for all credential types
144+
*/
116145
struct git_cred {
117-
git_credtype_t credtype;
146+
git_credtype_t credtype; /**< A type of credential */
118147
void (*free)(git_cred *cred);
119148
};
120149

0 commit comments

Comments
 (0)