Re: [PATCH v5 1/2] config: document git config getter return value
On Mon, Aug 6, 2018 at 6:32 PM Junio C Hamano wrote: > patch and queue it on its own merit (not that I think the other one > is not yet good enough---I haven't even looked at it yet ;-). I discovered that emacs tabify will happily also add tabs in the middle of the line, which breaks in the case of DUMB_SUFFIX. I can reroll a v6 if needed, though. -- Google Germany GmbH, Erika-Mann-Strasse 33, 80636 Munich Registergericht und -nummer: Hamburg, HRB 86891 Sitz der Gesellschaft: Hamburg Geschäftsführer: Paul Manicle, Halimah DeLaine Prado
Re: [PATCH v5 1/2] config: document git config getter return value
Han-Wen Nienhuys writes: > Signed-off-by: Han-Wen Nienhuys > --- > config.h | 7 ++- > 1 file changed, 6 insertions(+), 1 deletion(-) I think this is good (I read all the comments on v3 and v4 in the archive before I said this). Let's split it off from the other patch and queue it on its own merit (not that I think the other one is not yet good enough---I haven't even looked at it yet ;-). Thanks. > > diff --git a/config.h b/config.h > index bb2f506b27..183b31ebf4 100644 > --- a/config.h > +++ b/config.h > @@ -188,9 +188,14 @@ struct config_set { > > extern void git_configset_init(struct config_set *cs); > extern int git_configset_add_file(struct config_set *cs, const char > *filename); > -extern int git_configset_get_value(struct config_set *cs, const char *key, > const char **value); > extern const struct string_list *git_configset_get_value_multi(struct > config_set *cs, const char *key); > extern void git_configset_clear(struct config_set *cs); > + > +/* > + * These functions return 1 if not found, and 0 if found, leaving the found > + * value in the 'dest' pointer. > + */ > +extern int git_configset_get_value(struct config_set *cs, const char *key, > const char **dest); > extern int git_configset_get_string_const(struct config_set *cs, const char > *key, const char **dest); > extern int git_configset_get_string(struct config_set *cs, const char *key, > char **dest); > extern int git_configset_get_int(struct config_set *cs, const char *key, int > *dest);
[PATCH v5 1/2] config: document git config getter return value
Signed-off-by: Han-Wen Nienhuys --- config.h | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/config.h b/config.h index bb2f506b27..183b31ebf4 100644 --- a/config.h +++ b/config.h @@ -188,9 +188,14 @@ struct config_set { extern void git_configset_init(struct config_set *cs); extern int git_configset_add_file(struct config_set *cs, const char *filename); -extern int git_configset_get_value(struct config_set *cs, const char *key, const char **value); extern const struct string_list *git_configset_get_value_multi(struct config_set *cs, const char *key); extern void git_configset_clear(struct config_set *cs); + +/* + * These functions return 1 if not found, and 0 if found, leaving the found + * value in the 'dest' pointer. + */ +extern int git_configset_get_value(struct config_set *cs, const char *key, const char **dest); extern int git_configset_get_string_const(struct config_set *cs, const char *key, const char **dest); extern int git_configset_get_string(struct config_set *cs, const char *key, char **dest); extern int git_configset_get_int(struct config_set *cs, const char *key, int *dest); -- 2.18.0.597.ga71716f1ad-goog