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

Re: [PATCH] p3400: stop using tac(1)

From
René Scharfe <l.s.r@web.de>
Date
Oct 5, 2021, 19:54 UTC
Message-ID
<6c817b65-1699-72d2-892a-3610dcbdf6a5@web.de>
In-Reply-To
<YVyppmEGkNCxZ+5L@coredump.intra.peff.net>
Am 05.10.21 um 21:38 schrieb Jeff King:
Show 24 quoted lines
> On Tue, Oct 05, 2021 at 08:45:38PM +0200, René Scharfe wrote:
>
>> Am 04.10.21 um 10:31 schrieb Jeff King:
>>> On Sat, Oct 02, 2021 at 07:44:14PM +0200, René Scharfe wrote:
>>>
>>>> b3dfeebb92 (rebase: avoid computing unnecessary patch IDs, 2016-07-29)
>>>> added a perf test that calls tac(1) from GNU core utilities.  Support
>>>> systems without it by reversing the generated list using sort -nr
>>>> instead.  sort(1) with options -n and -r is already used in other tests.
>>>
>>> Cute fix. With regular seq(1), this whole thing can become:
>>>
>>>   seq 1000 -1 1
>>>
>>> without the extra process, but our test_seq doesn't understand non-1
>>> increments (nor comparisons besides -le). It wouldn't be that hard to
>>> teach it, but given that this is the first time we've wanted it, it may
>>> not be worth the effort.
>>
>> Right.  The original also allows "seq 1000 1", by the way.  Not sure we
>> need that either.
>
> I'm not sure what you mean by "original" here. "seq 1000 1" produces no
> output for me (nor does it work with test_seq).

I meant the non-shell one, i.e. seq(1). I somehow expected everyone to use the same, but of course there is GNU seq, which has "an omitted INCREMENT defaults to 1 even when LAST is smaller than FIRST" [1] and BSD seq with "When first is larger than last the default incr is -1" [2].

[1] https://www.man7.org/linux/man-pages/man1/seq.1.html [2] https://man.netbsd.org/seq.1

René
Previous: Jeff KingNext: René Scharfe
Message 5 of 7 in “p3400: stop using tac(1)”
  1. p3400: stop using tac(1)René Scharfe, Oct 2, 2021
  2. Jeff KingOct 4, 2021
  3. René ScharfeOct 5, 2021
  4. Jeff KingOct 5, 2021
  5. René ScharfeOct 5, 2021
  6. René ScharfeOct 7, 2021
  7. Junio C HamanoOct 7, 2021

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.