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

Re: [PATCH] tests: Introduce test_seq

From
Jeff King <peff@peff.net>
Date
Aug 6, 2012, 20:16 UTC
Message-ID
<20120806201600.GA11078@sigill.intra.peff.net>
In-Reply-To
<501D4FF0.4060109@kdbg.org>
On Sat, Aug 04, 2012 at 06:38:08PM +0200, Johannes Sixt wrote:
Show 22 quoted lines
> And the reason for this is that we always told people "don't use seq"
> and they submitted an updated patch. What would we have to do now? We
> have to tell them "don't use seq, use test_seq". Therefore, the patch
> does not accomplish anything useful, IMO.
> 
> The function should really just be named 'seq'.
> 
> Or how about this strategy:
> 
> seq () {
> 	unset -f seq
> 	if ! seq 1 2 >/dev/null 2>&1
> 	then
> 		# don't have a working seq; provide it as a function
> 		seq () {
> 			insert your definition here
> 		}
> 	fi
> 	seq "$@"
> }
> 
> but it is not my favorite.

No, falling back just makes that problem worse. Our test_seq is not fully compatible with seq. So anyone who uses an advanced feature of seq (like "seq 0 100 10" or "seq -f %02g 1 10") will have the test work on their system (with seq) and then break on some other random platform. So instead of saying "no, don't use seq, use test_seq", reviewers have to catch it and say "don't use some features of seq, because the fallback doesn't have them".

If you eliminate the fallback, then at least the reviewers do not have to catch it (the tests will never work for the patch writer, since they will always use our feature-less seq replacement). But I find it slightly confusion-inducing to call something that is not seq-compatible "seq".

-Peff
Previous: Michał KiedrowiczNext: Michał Kiedrowicz
Message 17 of 34 in “Fix 'No newline...' annotation in rewrite diffs.”
  1. Fix 'No newline...' annotation in rewrite diffs.Adam Butcher, Aug 2, 2012
  2. Jeff KingAug 2, 2012
  3. Junio C HamanoAug 2, 2012
  4. Jeff KingAug 2, 2012
  5. Michał KiedrowiczAug 3, 2012
  6. Jeff KingAug 3, 2012
  7. Junio C HamanoAug 3, 2012
  8. Jeff KingAug 3, 2012
  9. tests: Introduce test_seqMichał Kiedrowicz, Aug 3, 2012
  10. Jeff KingAug 3, 2012
  11. Junio C HamanoAug 3, 2012
  12. Jeff KingAug 3, 2012
  13. Michał KiedrowiczAug 3, 2012
  14. Johannes SixtAug 4, 2012
  15. Junio C HamanoAug 4, 2012
  16. Michał KiedrowiczAug 6, 2012
  17. Jeff KingAug 6, 2012
  18. tests: Introduce test_seqMichał Kiedrowicz, Aug 3, 2012
  19. Junio C HamanoAug 3, 2012
  20. Jeff KingAug 3, 2012
  21. Junio C HamanoAug 3, 2012
  22. Michał KiedrowiczAug 4, 2012
  23. Adam ButcherAug 4, 2012
  24. tests: Introduce test_seqMichał Kiedrowicz, Aug 3, 2012
  25. Jeff KingAug 3, 2012
  26. Michał KiedrowiczAug 3, 2012
  27. tests: Introduce test_seqMichał Kiedrowicz, Aug 3, 2012
  28. Jeff KingAug 3, 2012
  29. Adam ButcherAug 2, 2012
  30. Junio C HamanoAug 2, 2012
  31. Adam ButcherAug 2, 2012
  32. Adam ButcherAug 4, 2012
  33. Junio C HamanoAug 5, 2012
  34. Fix '\ No newline...' annotation in rewrite diffsAdam Butcher, Aug 5, 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.