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

Re: [PATCH 2/2] t5556: replace test_i18ngrep with a simple grep

From
Junio C Hamano <gitster@pobox.com>
Date
Feb 13, 2018, 07:51 UTC
Message-ID
<xmqqvaf1qqcx.fsf@gitster-ct.c.googlers.com>
In-Reply-To
<69c7dc21-fb52-5982-f7d8-04518d06db6c@ramsayjones.plus.com>
Ramsay Jones <ramsay@ramsayjones.plus.com> writes:
> I must admit that I didn't think about the effect of the useless
> "| sort" on the exit status!  What I saw was: a process that
> received no input, sorted nothing and produced no output - pretty
> much the definition of useless! ;-)

I am not sure what you mean by "receive no input, sort nothing and produce no output".

Ahh, OK, this is a funny one.  I think the original meant to do
	grep ... | grep -v ... | sort >actual
but it did
	grep ... | grep -v ... >actual | sort
instead by mistake.

And we have two possible "fixes" for that mistake. Either removing "|sort" (and replace its only effect, which is to hide brittleness of relying on exit status of the second grep, with something else) to declare that we do care about the order multiple warning messages are given by the last test in the script (by the way, the script is t5536, not t5556; the patch needs to be retitled), or keeping the "| sort" and move the redirection into ">actual" to the correct place, which is to follow through the intention of having that "sort" on the pipeline in the first place. I somewhat favor the former in this particular case myself, but the preference is not a very strong one.

Thanks.
Previous: Ramsay JonesNext: SZEDER Gábor
Message 5 of 15 in “t5556: replace test_i18ngrep with a simple grep”
  1. 2/2 t5556: replace test_i18ngrep with a simple grepRamsay Jones, Feb 12, 2018
  2. Junio C HamanoFeb 12, 2018
  3. Junio C HamanoFeb 12, 2018
  4. Ramsay JonesFeb 13, 2018
  5. Junio C HamanoFeb 13, 2018
  6. SZEDER GáborFeb 13, 2018
  7. Junio C HamanoFeb 13, 2018
  8. Jeff KingFeb 13, 2018
  9. Junio C HamanoFeb 13, 2018
  10. Junio C HamanoFeb 27, 2018
  11. Junio C HamanoFeb 27, 2018
  12. Ramsay JonesFeb 27, 2018
  13. SZEDER GáborFeb 28, 2018
  14. Ramsay JonesFeb 28, 2018
  15. Junio C HamanoFeb 28, 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.