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

Re: [PATCH v1] Git config cache & special querying api utilizing the cache

From
Matthieu Moy <matthieu.moy@grenoble-inp.fr>
Date
Jun 11, 2014, 14:01 UTC
Message-ID
<vpqr42v35qb.fsf@anie.imag.fr>
In-Reply-To
<1402318146-5062-1-git-send-email-tanayabh@gmail.com>
Tanay Abhra <tanayabh@gmail.com> writes:
> I have run the tests and debug the code using custom functions and it works
> fine.

I understand that you wrote the custom functions for you, but didn't include them in the patch, right?

If so, wouldn't it make sense to include these as unit-tests for your code? See what Git already does with test-*.c, e.g.

$ git grep test-hashmap .gitignore:/test-hashmap Documentation/technical/api-hashmap.txt:See test-hashmap.c for an example using arbitrary-length strings as keys. Makefile:TEST_PROGRAMS_NEED_X += test-hashmap t/t0011-hashmap.sh: echo "$1" | test-hashmap $3 > actual && t/t0011-hashmap.sh: cat in | test-hashmap > out && test-hashmap.c: * Usage: time echo "perfhashmap method rounds" | test-hashmap

for examples. The resulting binary would be a good candidate for valgrind --leak-check=full.

The tests are not just for you, they are also:
* For reviewers, to show an example of correct usage of the new API,
* For people of the future, to avoid regressions.
-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/
Previous: Eric Sunshine
Message 11 of 11 in “Git config cache & special querying api utilizing the cache”
  1. Git config cache & special querying api utilizing the cacheTanay Abhra, Jun 9, 2014
  2. config: Add hashtable for config parsing & retrivalTanay Abhra, Jun 9, 2014
  3. Matthieu MoyJun 9, 2014
  4. Eric SunshineJun 10, 2014
  5. Eric SunshineJun 10, 2014
  6. Tanay AbhraJun 10, 2014
  7. Eric SunshineJun 10, 2014
  8. Eric SunshineJun 10, 2014
  9. Tanay AbhraJun 10, 2014
  10. Eric SunshineJun 10, 2014
  11. Matthieu MoyJun 11, 2014

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.