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

Re: [PATCH] hashmap: adjust documentation to reflect reality

From
Junio C Hamano <gitster@pobox.com>
Date
Dec 3, 2017, 05:35 UTC
Message-ID
<xmqqindojrw1.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<20171130030727.GA24732@sigill.intra.peff.net>
Jeff King <peff@peff.net> writes:
> My second suggestion (which I'm on the fence about) is: would it better
> to just say "see t/helper/test-hashmap.c for a representative example?"

I also had the same thought. It is rather unwieldy to ask people to lift code from comment text, and it is also hard to maintain such a commented out code to make sure it is up to date.

> I'm all for code examples in documentation, but this one is quite
> complex. The code in test-hashmap.c is not much more complex, and is at
> least guaranteed to compile and run.
Yup.  Exactly.
> It doesn't show off how to combine a flex-array with a hashmap as
> well, but I'm not sure how important that is. So I could go either
> way.
Likewise.

In any case, keeping a bad example as-is is less good than replacing it with a corrected one, so I do not mind taking this patch as an immediate first step, whether we later decide to remove it and refer to an external file that has a real example that will be easier to maintain and use.

Thanks.
Previous: Jeff KingNext: Stefan Beller
Message 4 of 7 in “hashmap: adjust documentation to reflect reality”
  1. hashmap: adjust documentation to reflect realityJohannes Schindelin, Nov 29, 2017
  2. Jonathan NiederNov 30, 2017
  3. Jeff KingNov 30, 2017
  4. Junio C HamanoDec 3, 2017
  5. Stefan BellerDec 4, 2017
  6. Johannes SchindelinDec 7, 2017
  7. Jeff KingDec 8, 2017

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.