git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 1/1] config: add documentation to config.h

From
Heba Waly <heba.waly@gmail.com>
Date
Oct 20, 2019, 08:05 UTC
Message-ID
<CACg5j25HsQwjjruHJ2E7F6UF4jP70x436km8r52qpzNSHXfpbA@mail.gmail.com>
In-Reply-To
<20191018220705.241778-1-jonathantanmy@google.com>
On Sat, Oct 19, 2019 at 11:07 AM Jonathan Tan <jonathantanmy@google.com> wrote:
Show 19 quoted lines
>
> > From: Heba Waly <heba.waly@gmail.com>
> >
> > This commit is copying and summarizing the documentation from
> > documentation/technical/api-config.txt to comments in config.h
>
> Thanks for this commit!
>
> As for your commit message, as far as I know, the idea is to move the
> documentation, not to copy it. Also, write this in imperative form,
> e.g.:
>
>   Move the documentation from Documentation/technical/api-config.txt
>   into config.h.
>
> Also change the title of the commit message accordingly, e.g.:
>
>   config: move documentation to header file
>
Ok.
> Also, include the deletion of api-config.txt in this commit.

I wasn't sure if the api-config.txt should be removed or not so I decided to keep it and wait for feedback. I assume I'll need to delete api-config.html as well?

> If you are doing any summarizing, describe what summarizing you are
> doing in the commit message too.
Ok, will do so.
Show 29 quoted lines
> > + * A config callback function takes three parameters:
> > + *
> > + * - the name of the parsed variable. This is in canonical "flat" form: the
> > + *   section, subsection, and variable segments will be separated by dots,
> > + *   and the section and variable segments will be all lowercase. E.g.,
> > + *   `core.ignorecase`, `diff.SomeType.textconv`.
> > + *
> > + * - the value of the found variable, as a string. If the variable had no
> > + *   value specified, the value will be NULL (typically this means it
> > + *   should be interpreted as boolean true).
> > + *
> > + * - a void pointer passed in by the caller of the config API; this can
> > + *   contain callback-specific data
> > + *
> > + * A config callback should return 0 for success, or -1 if the variable
> > + * could not be parsed properly.
> > + */
> > +
> >  struct object_id;
> >
> >  /* git_config_parse_key() returns these negated: */
> > @@ -73,6 +107,11 @@ struct config_options {
> >
> >  typedef int (*config_fn_t)(const char *, const char *, void *);
> >  int git_default_config(const char *, const char *, void *);
>
> The config callback is config_fn_t so that documentation should be
> placed above that typedef.
>
Cool, I couldn't find it, thanks!
> Other than that, this looks good to me. The result is perhaps not as
> tidy as we would like (especially with some functions being documented
> and others not) but I think, anyway, that a verbatim movement should be
> done in one commit (this one) and improvements, in a subsequent commit.

You're right, I would have loved to get all the functions documented, but that's something I'm not able to do right now as I'm still getting familiar with the code base. But it's a good start! I agree with you about moving the documentation and deleting the file in one commit. Will do so.

Thank you for the feedback!
Heba
Previous: Jonathan TanNext: Emily Shaffer
Message 4 of 16 in “config: add documentation to config.h”
  1. 0/1 config: add documentation to config.hHeba Waly via GitGitGadget, Oct 18, 2019
  2. 1/1 config: add documentation to config.hHeba Waly via GitGitGadget, Oct 18, 2019
  3. Jonathan TanOct 18, 2019
  4. Heba WalyOct 20, 2019
  5. Emily ShafferOct 18, 2019
  6. Heba WalyOct 20, 2019
  7. Emily ShafferOct 22, 2019
  8. 0/1 [Outreachy] config: move documentation to config.hHeba Waly via GitGitGadget, Oct 22, 2019
  9. 1/1 config: move documentation to config.hHeba Waly via GitGitGadget, Oct 22, 2019
  10. Emily ShafferOct 22, 2019
  11. Junio C HamanoOct 23, 2019
  12. Heba WalyOct 23, 2019
  13. 0/1 [Outreachy] config: move documentation to config.hHeba Waly via GitGitGadget, Oct 23, 2019
  14. 1/1 config: move documentation to config.hHeba Waly via GitGitGadget, Oct 23, 2019
  15. Emily ShafferOct 23, 2019
  16. Junio C HamanoOct 24, 2019

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.