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

Re: [PATCH 02/10] t5812: add 'test_i18ngrep's missing filename parameter

From
SZEDER Gábor <szeder.dev@gmail.com>
Date
Feb 7, 2018, 13:53 UTC
Message-ID
<CAM0VKjkf=51i1YPqdNm=pyPHaNNguXLu0T1iHDYv28jW92QTow@mail.gmail.com>
In-Reply-To
<20180126182734.GB27618@sigill.intra.peff.net>
On Fri, Jan 26, 2018 at 7:27 PM, Jeff King <peff@peff.net> wrote:
Show 21 quoted lines
> On Fri, Jan 26, 2018 at 01:37:00PM +0100, SZEDER Gábor wrote:
>
>> The second 'test_i18ngrep' invocation in the test 'curl redirects
>> respect whitelist' is missing its filename parameter.  This has
>> remained unnoticed since its introduction in f4113cac0 (http: limit
>> redirection to protocol-whitelist, 2015-09-22), because it would only
>> cause the test to fail if Git was built with a sufficiently old
>> libcurl version.  The test's two ||-chained 'test_i18ngrep'
>> invocations are supposed to check that either one of the two patterns
>> is present in 'git clone's error message.  As it happens, the first
>> invocation covers the error message from any reasonably up-to-date
>> libcurl, thus the second invocation, the one without the filename
>> parameter, isn't executed at all.  Apparently no one has run the test
>> suite's httpd tests with such an old libcurl in the last 2+ years, or
>> at least they haven't bothered to notify us about the failed test.
>
> Interesting find.
>
> The "too old" curl is older than 7.19.4, which we actually fail to build
> with since v2.12.0. So they probably did not even get as far as the
> tests. ;)

Oh, OK, I was not aware of that. The oldest non-maintenance release with the missing filename parameter is v2.7.0, so that's still a 5 releases time frame to notice it.

Anyway, I'm preparing v2 of this series, and I'm not sure what to do about this.

  - Should I simply drop the "your curl version is too old" pattern?  It
    would make sense, but it just doesn't feel quite right to remove it
    while the corresponding printf() is still there, even if it can't be
    triggered anymore.  However, cleaning up the curl version checks in
    http.c to remove this message is beyond the scope of this patch
    series.
  - Or leave it almost-as-is, only dropping the now unnecessary curly
    braces as Simon pointed out.  And perhaps a bit of update to the
    commit message.
I'd prefer the second option.
Show 8 quoted lines
>> Fix this by consolidating the two patterns into a single extended
>> regexp, eliminating the need for an ||-chained second 'test_i18ngrep'
>> invocation.
>
> OK. Once upon a time I think we had trouble with "grep -E", since some
> older systems had only "egrep". But I see we've introduced some "grep
> -E" invocations as far back as 2013 and nobody has complained, so it's
> probably fine.

Yeah, first I went with the more traditional "\(this\|that\)" pattern, but then noticed that 'grep -E' is already used in a couple of places, and picked the format that uses less escape characters.

Previous: Jeff KingNext: Jeff King
Message 33 of 49 in “'test_i18ngrep'-related fixes and improvements”
  1. 00/10 'test_i18ngrep'-related fixes and improvementsSZEDER Gábor, Jan 26, 2018
  2. 01/10 t5541: add 'test_i18ngrep's missing filename parameterSZEDER Gábor, Jan 26, 2018
  3. Jeff KingJan 26, 2018
  4. Jeff KingJan 26, 2018
  5. 04/10 t4001: don't run 'git status' upstream of a pipeSZEDER Gábor, Jan 26, 2018
  6. 07/10 t: move 'test_i18ncmp' and 'test_i18ngrep' to 'test-lib-functions.sh'SZEDER Gábor, Jan 26, 2018
  7. Junio C HamanoJan 26, 2018
  8. Jeff KingJan 26, 2018
  9. SZEDER GáborJan 26, 2018
  10. 10/10 t: make 'test_i18ngrep' more informative on failureSZEDER Gábor, Jan 26, 2018
  11. Jeff KingJan 26, 2018
  12. SZEDER GáborJan 26, 2018
  13. Jeff KingJan 26, 2018
  14. SZEDER GáborJan 26, 2018
  15. Jeff KingJan 26, 2018
  16. 06/10 t5536: let 'test_i18ngrep' read the file without redirectionSZEDER Gábor, Jan 26, 2018
  17. 09/10 t: make sure that 'test_i18ngrep' got enough parametersSZEDER Gábor, Jan 26, 2018
  18. Jeff KingJan 26, 2018
  19. Eric SunshineJan 26, 2018
  20. 05/10 t5510: consolidate 'grep' and 'test_i18ngrep' patternsSZEDER Gábor, Jan 26, 2018
  21. Junio C HamanoJan 26, 2018
  22. SZEDER GáborJan 26, 2018
  23. Junio C HamanoJan 26, 2018
  24. 08/10 t: forbid piping into 'test_i18ngrep'SZEDER Gábor, Jan 26, 2018
  25. Junio C HamanoJan 26, 2018
  26. Junio C HamanoJan 26, 2018
  27. Jeff KingJan 26, 2018
  28. SZEDER GáborJan 26, 2018
  29. Junio C HamanoJan 26, 2018
  30. Jeff KingJan 26, 2018
  31. 02/10 t5812: add 'test_i18ngrep's missing filename parameterSZEDER Gábor, Jan 26, 2018
  32. Jeff KingJan 26, 2018
  33. SZEDER GáborFeb 7, 2018
  34. Jeff KingFeb 7, 2018
  35. Simon RuderichJan 30, 2018
  36. 03/10 t6022: don't run 'git merge' upstream of a pipeSZEDER Gábor, Jan 26, 2018
  37. Jeff KingJan 26, 2018
  38. 0/9 'test_i18ngrep'-related fixes and improvementsSZEDER Gábor, Feb 8, 2018
  39. 1/9 t5541: add 'test_i18ngrep's missing filename parameterSZEDER Gábor, Feb 8, 2018
  40. 4/9 t4001: don't run 'git status' upstream of a pipeSZEDER Gábor, Feb 8, 2018
  41. 8/9 t: validate 'test_i18ngrep's parametersSZEDER Gábor, Feb 8, 2018
  42. Jeff KingFeb 8, 2018
  43. 9/9 t: make 'test_i18ngrep' more informative on failureSZEDER Gábor, Feb 8, 2018
  44. 5/9 t5510: consolidate 'grep' and 'test_i18ngrep' patternsSZEDER Gábor, Feb 8, 2018
  45. 6/9 t5536: let 'test_i18ngrep' read the file without redirectionSZEDER Gábor, Feb 8, 2018
  46. 7/9 t: move 'test_i18ncmp' and 'test_i18ngrep' to 'test-lib-functions.sh'SZEDER Gábor, Feb 8, 2018
  47. 2/9 t5812: add 'test_i18ngrep's missing filename parameterSZEDER Gábor, Feb 8, 2018
  48. 3/9 t6022: don't run 'git merge' upstream of a pipeSZEDER Gábor, Feb 8, 2018
  49. Jeff KingFeb 8, 2018

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.