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

Re: [PATCH v2] t/t0021: convert the rot13-filter.pl script to C

From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Date
Jul 28, 2022, 19:50 UTC
Message-ID
<220728.86bkt9j8xk.gmgdl@evledraar.gmail.com>
In-Reply-To
<4n20476q-6ssr-osp8-q5o3-p8ns726q4pn3@tzk.qr>
On Thu, Jul 28 2022, Johannes Schindelin wrote:
Show 15 quoted lines
> [...]
> I see why this might have been suggested, but it definitely made it more
> challenging for me to review. You see, it is easy to just fly over a patch
> that simply removes the `PERL` prereq, but it is much harder to jump back
> and forth over all of these removals when the `.c` version of the filter
> is added before them and the `.pl` version is removed after them. So I
> find that it was bad advice, but I do not fault you for following it (we
> all want reviews to just be over already and therefore sometimes pander to
> the reviewers, no matter how much or little sense their feedback makes).
> [...]
> To illustrate my point: it was a bit of a challenge to find the adjustment
> of the "smudge write error at" needle in all of that cruft. It would have
> made my life as a reviewer substantially easier had the patch
> series been organized this way (which I assume you had before the feedback
> you received demanded to squash everything in one hot pile):

If you don't think a suggestion of mine makes sense, I'd appreciate it if you just replied me directly, instead of sending this sort of comment to someone else. I find your wording here to be somewhere between snarky and mean-spirited. I didn't demand anything.

If this was the first time this sort of thing has occurred I wouldn't say anything about it, but this is far from being the first time.

In any case, if you read more than a few words into https://lore.kernel.org/git/220723.86pmhwquie.gmgdl@evledraar.gmail.com/ you'll see that I suggested splitting the removal of the PERL prereq into its own change, which I think would address what you're bringing up here.

What I was mainly commenting on was that this series could avoid introducing code in-between the v1 1/2 and 2/2 which is only needed because of that split-up. I.e. the "exec", and needing to quote those arguments.

Which I stand by, I think it's much easier to just do a "git show --word-diff" on this than reason about how that "chain-loading" is working, and whether the inter-series state is buggy. But again, the concern you about the associated verbosity is easy to mitigate.

On the point of pandering to reviewers I find it really nitpicky to ask for changes to change some working O(N^2)) code in a test-tool to O(N log(N)), or to avoid a few allocations here & there.

If it was a new git built-in, then sure, but I think our collective time is much better spend by just letting that sort of thing slide when it comes to test-tools, which are almost always going to be operating on the relatively tiny set of test data we expose them too.

Unless Matheus is keenly interested on optimizing this code, that is.
> [...]
> This does what we want it to do, but it looks as if it was code translated
> from a language that does not care one bit about allocations to a language
> that cares a lot.

FWIW Perl cares a lot about allocations, the sort of code you're commenting on here doesn't involve allocations in Perl in the general case, since it "allocates ahead", similar to how we use alloc_nr() and strbuf_reset() patterns.

What it doesn't care about is free()-ing memory, which is an orthagonal thing. But that's just an optimization, the general assumptios in that if your program ever needs X MB of memory it's likely to need at least that much again, or it'll exit() and have the OS clean it up.

Previous: Junio C HamanoNext: Matheus Tavares
Message 10 of 28 in “t0021: convert perl script to C test-tool helper”
  1. 0/2 t0021: convert perl script to C test-tool helperMatheus Tavares, Jul 22, 2022
  2. 2/2 t/t0021: replace old rot13-filter.pl uses with new test-tool cmdMatheus Tavares, Jul 22, 2022
  3. 1/2 t/t0021: convert the rot13-filter.pl script to CMatheus Tavares, Jul 22, 2022
  4. Ævar Arnfjörð BjarmasonJul 23, 2022
  5. Ævar Arnfjörð BjarmasonJul 23, 2022
  6. Matheus TavaresJul 23, 2022
  7. t/t0021: convert the rot13-filter.pl script to CMatheus Tavares, Jul 24, 2022
  8. Johannes SchindelinJul 28, 2022
  9. Junio C HamanoJul 28, 2022
  10. Ævar Arnfjörð BjarmasonJul 28, 2022
  11. Matheus TavaresJul 31, 2022
  12. Johannes SchindelinAug 9, 2022
  13. 0/3 t0021: convert perl script to C test-tool helperMatheus Tavares, Jul 31, 2022
  14. 1/3 t0021: avoid grepping for a Perl-specific string at filter outputMatheus Tavares, Jul 31, 2022
  15. Junio C HamanoAug 1, 2022
  16. 2/3 t0021: implementation the rot13-filter.pl script in CMatheus Tavares, Jul 31, 2022
  17. Ævar Arnfjörð BjarmasonAug 1, 2022
  18. Matheus TavaresAug 2, 2022
  19. Johannes SchindelinAug 9, 2022
  20. Ævar Arnfjörð BjarmasonAug 1, 2022
  21. Junio C HamanoAug 1, 2022
  22. Matheus TavaresAug 2, 2022
  23. Johannes SchindelinAug 9, 2022
  24. Junio C HamanoAug 10, 2022
  25. Junio C HamanoAug 10, 2022
  26. Johannes SchindelinAug 9, 2022
  27. Johannes SchindelinAug 9, 2022
  28. 3/3 tests: use the new C rot13-filter helper to avoid PERL prereqMatheus Tavares, Jul 31, 2022

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.