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

Re: [PATCHv2 1/2] fast-import: test behavior of garbage after mark references

From
Jonathan Nieder <jrnieder@gmail.com>
Date
Apr 4, 2012, 05:43 UTC
Message-ID
<20120404054316.GB2460@burratino>
In-Reply-To
<20120404004610.GA4124@padd.com>
On Tue, Apr 03, 2012 at 08:46:10PM -0400, Pete Wyckoff wrote:
> jrnieder@gmail.com wrote on Tue, 03 Apr 2012 09:00 -0500:
>> Is this using "grep -q" to avoid repeating the same line in the output
>> twice?  It seems better to use plain grep or test_i18ngrep.
[...]
Show 5 quoted lines
> What I want to test here is that the functionality works: do the
> right untranslated messages get printed.
>
> Changing the "Missing" to "missing" would require fixing the
> tests, and that seems okay.
Let me reiterate this a little then.

Suppose I mark the messages in fast-import.c with _() so they get translated. Then your tests will fail, so I have to tweak them. Fine --- the test tweaks take some time, but they're doable. Nothing lost, right?

No, something major would be lost.

Tests normally save later coders time, by giving immediate feedback that they would normally only get by letting a feature be used over a long time by real users. They also dissuade people from changing git's behavior without thinking carefully about the consequences --- each broken test represents a class of script or user expectation that is potentially being broken.

Similarly, a test that checks that git produces such-and-such exact output is dissuading me from making certain behavior changes by adding to the work needed to make them (I have to adjust tests, too). So now I am less likely to

 (1) reword the message to make it clearer in some way in response to
     user feedback
 (2) mark it for translation so the operator can see a message in her
     native language
How is making that hard in any way a good thing?

Relaxing the pattern addresses (1). Using test_i18ngrep instead of grep addresses (2).

Jonathan
Previous: Pete WyckoffNext: Pete Wyckoff
Message 12 of 22 in “fast-import: catch garbage after marks in from/merge”
  1. fast-import: catch garbage after marks in from/mergePete Wyckoff, Apr 1, 2012
  2. Jonathan NiederApr 1, 2012
  3. Pete WyckoffApr 2, 2012
  4. Dmitry IvankovApr 2, 2012
  5. Junio C HamanoApr 2, 2012
  6. Jonathan NiederApr 2, 2012
  7. Junio C HamanoApr 2, 2012
  8. 0/2 fast-import: tighten parsing of mark referencesPete Wyckoff, Apr 3, 2012
  9. 1/2 fast-import: test behavior of garbage after mark referencesPete Wyckoff, Apr 3, 2012
  10. Jonathan NiederApr 3, 2012
  11. Pete WyckoffApr 4, 2012
  12. Jonathan NiederApr 4, 2012
  13. 2/2 fast-import: tighten parsing of mark referencesPete Wyckoff, Apr 3, 2012
  14. Jonathan NiederApr 3, 2012
  15. Pete WyckoffApr 4, 2012
  16. Jonathan NiederApr 4, 2012
  17. Sverre RabbelierApr 3, 2012
  18. [PATCHv3] fast-import: tighten parsing of mark referencesPete Wyckoff, Apr 5, 2012
  19. Jonathan NiederApr 5, 2012
  20. Junio C HamanoApr 5, 2012
  21. [PATCHv4] fast-import: tighten parsing of datarefsPete Wyckoff, Apr 7, 2012
  22. Junio C HamanoApr 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.