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

Re: [PATCH] Add test-string-list.c

From
Junio C Hamano <gitster@pobox.com>
Date
Sep 6, 2010, 06:12 UTC
Message-ID
<7v7hizwgc0.fsf@alter.siamese.dyndns.org>
In-Reply-To
<20100905050254.GA6134@burratino>
Jonathan Nieder <jrnieder@gmail.com> writes:
Show 9 quoted lines
> Git programs tend to start with 
>
>  #include "cache.h"
>
> or
>
>  #include "git-compat-util.h"
>
> to get all the portability niceties.

Quote Documentation/CodingGuidelines here, too. And use of these headers is not merely "niceties"--some exotic platforms tend to want standard system headers in particular inclusion order and what git-compat-util.h does is the result of us painfully finding these rules out over years.

Show 12 quoted lines
> Thoughts separate from the code:
>
>  * it is probably worth mentioning Documentation/technical/api-string-list.txt
>    for people who do not know about it.
>
>  * for this to be useful as a test I think one has to sort of believe
>    that it can break.  That is, a test of something this basic (which
>    is already demonstrated and exercised by code throughout git, after
>    all) would tend to be especially devious.
>
>  * api-string-list.txt does not mention the STRING_LIST_INIT macros
>    you introduced.  Maybe that would be worth improving.
 * this may be built but nothing exercises it.  Is it worth adding
   tNNNN-run-string-list-test.sh for some value of NNNN?  

I tend to agree with your second point and have a moderately negative feeling against the patch. An addition to API documentation like you suggested would be more useful for people, and what Thiago did perhaps might be useful in its sample code section, but then we already have plenty of working samples in live code and they are single "git grep" away, so...

Previous: Jonathan NiederNext: Thiago Farina
Message 3 of 6 in “Add test-string-list.c”
  1. Add test-string-list.cThiago Farina, Sep 5, 2010
  2. Jonathan NiederSep 5, 2010
  3. Junio C HamanoSep 6, 2010
  4. Thiago FarinaSep 6, 2010
  5. Jonathan NiederSep 7, 2010
  6. Thiago FarinaSep 7, 2010

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.