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

Re: What's cooking in git.git (Nov 2012, #02; Fri, 9)

From
SZEDER Gábor <szeder@ira.uka.de>
Date
Nov 10, 2012, 12:32 UTC
Message-ID
<20121110123250.GR12052@goldbirke>
In-Reply-To
<20121110003331.GA12567@sigill.intra.peff.net>
Hi,
On Fri, Nov 09, 2012 at 07:33:31PM -0500, Jeff King wrote:
Show 18 quoted lines
> On Sat, Nov 10, 2012 at 12:21:48AM +0100, Felipe Contreras wrote:
> > > * fc/completion-test-simplification (2012-10-29) 2 commits
> > >  - completion: simplify __gitcomp test helper
> > >  - completion: refactor __gitcomp related tests
> > >
> > >  Clean up completion tests.
> > >
> > >  There were some comments on the list.
> > >
> > >  Expecting a re-roll.
> > 
> > The second patch I can re-roll, but the first patch needs some
> > external input. My preference is that tests should also be simple and
> > maintainable, SZEDER's preference is that tests are better being
> > explicit and verbose (even if harder to maintain) to minimize possible
> > issues in the tests.
> 
> I think it is better to keep the tests simple and maintainable.

Maintainable? There is nothing to maintain here. Users' completion scripts depend on __gitcomp(), so its behavior shouldn't be changed. It can only be extended by a fifth parameter or by quoting words when necessary, but these future changes must not alter the current behavior checked by these tests, therefore even then these tests must be left intact.

Simple? Currently you only need to look at __gitcomp() and the test itself to understand what's going on. With this series you'll also need to look at test_gitcomp(), figure out what its parameters are supposed to mean, and possibly get puzzled on the way why __gitcomp() is now seemingly called with only one parameter.

So, I don't see much benefit in this series (except the part to use print_comp instead of "change IFS && echo", but that's already done in this patch: http://article.gmane.org/gmane.comp.version-control.git/207927).

OTOH, this series has some serious drawbacks.

It makes debugging more difficult. While working on the quoting issues I managed to break completion tests many-many times lately. In normal tests I could add a few debugging instructions to the failed test to find out where the breakage lies, without affecting other tests. However, if the failed test uses the test_completion() helper, then I have to add debugging instructions to test_completion() itself, too. This is bad, because many tests use this helper function and are therefore affected by the debugging instructions, producing truckloads of output making it difficult to dig out the relevant parts, or, worse yet, causing breakages in other tests. With this series the same difficulties will come to __gitcomp() tests, too.

It can also encourage writing bad tests, similar to those that managed to cram many test_completion() lines into a single tests, giving me headaches to figure out what went wrong this time.

Best, Gábor

Previous: Felipe ContrerasNext: Felipe Contreras
Message 36 of 38 in “What's cooking in git.git (Nov 2012, #02; Fri, 9)”
  1. Jeff KingNov 9, 2012
  2. Ralf ThielowNov 9, 2012
  3. Ralf ThielowNov 9, 2012
  4. Jeff KingNov 9, 2012
  5. Junio C HamanoNov 9, 2012
  6. Jeff KingNov 10, 2012
  7. Junio C HamanoNov 10, 2012
  8. Kalle Olavi NiemitaloNov 9, 2012
  9. Paul FoxNov 10, 2012
  10. Kalle Olavi NiemitaloNov 10, 2012
  11. Andreas SchwabNov 10, 2012
  12. Paul FoxNov 10, 2012
  13. Kalle Olavi NiemitaloNov 11, 2012
  14. Andreas SchwabNov 11, 2012
  15. Jeff KingNov 11, 2012
  16. 0/5 ignore SIGINT while editor runsJeff King, Nov 11, 2012
  17. 1/5 launch_editor: refactor to use start/finish_commandJeff King, Nov 11, 2012
  18. 2/5 launch_editor: ignore SIGINT while the editor has controlPaul Fox, Nov 11, 2012
  19. Junio C HamanoNov 12, 2012
  20. Jeff KingNov 12, 2012
  21. 3/5 run-command: drop silent_exec_failure arg from wait_or_whineJeff King, Nov 11, 2012
  22. Felipe ContrerasNov 11, 2012
  23. 4/5 run-command: do not warn about child death by SIGINTJeff King, Nov 11, 2012
  24. 5/5 launch_editor: propagate SIGINT from editor to gitJeff King, Nov 11, 2012
  25. Johannes SixtNov 11, 2012
  26. Jeff KingNov 30, 2012
  27. 2/5 launch_editor: ignore SIGINT while the editor has controlJeff King, Nov 11, 2012
  28. Paul FoxNov 11, 2012
  29. Krzysztof MazurNov 11, 2012
  30. Paul FoxNov 11, 2012
  31. Krzysztof MazurNov 11, 2012
  32. Andreas SchwabNov 11, 2012
  33. Felipe ContrerasNov 9, 2012
  34. Jeff KingNov 10, 2012
  35. Felipe ContrerasNov 10, 2012
  36. SZEDER GáborNov 10, 2012
  37. Felipe ContrerasNov 10, 2012
  38. Junio C HamanoNov 10, 2012

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.