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

Re: [PATCH v2] mingw: workaround for hangs when sending STDIN

From
Eric Sunshine <sunshine@sunshineco.com>
Date
Feb 17, 2020, 17:24 UTC
Message-ID
<CAPig+cQWMvBi4vkAFMjV7LWjKJudja08ZqVMNfLfALxbBfpzXg@mail.gmail.com>
In-Reply-To
<pull.553.v2.git.1581956750001.gitgitgadget@gmail.com>

On Mon, Feb 17, 2020 at 11:26 AM Alexandr Miloslavskiy via GitGitGadget <gitgitgadget@gmail.com> wrote:

> diff --git a/t/t3903-stash.sh b/t/t3903-stash.sh
> +test_expect_success 'stash handles large files' '
> +       x=0123456789abcde\n && # 16

Did you intend for the \n in this assignment to be a literal newline? Every shell with which I tested treats it instead as an escaped 'n'.

Show 9 quoted lines
> +       x=$x$x$x$x$x$x$x$x  && # 128
> +       x=$x$x$x$x$x$x$x$x  && # 1k
> +       x=$x$x$x$x$x$x$x$x  && # 8k
> +       x=$x$x$x$x$x$x$x$x  && # 64k
> +       x=$x$x$x$x$x$x$x$x  && # 512k
> +       x=$x$x$x$x$x$x$x$x  && # 4m
> +       x=$x$x              && # 8m
> +       echo $x >large_file.txt &&
> +       unset x             && # release memory

By the way, are the embedded newlines actually important to the test itself, or are they just for human consumption if the test fails? I ask because I was curious about how other tests create large files, and found that a mechanism similar to your original (but without the pitfalls) has been used. For instance, t1050-large.sh uses:

    printf "%2000000s" X >large1 &&

which is plenty portable and (presumably) doesn't have such demanding memory consumption.

Previous: Alexandr Miloslavskiy via GitGitGadgetNext: Junio C Hamano
Message 6 of 12 in “mingw: workaround for hangs when sending STDIN”
  1. mingw: workaround for hangs when sending STDINAlexandr Miloslavskiy via GitGitGadget, Feb 13, 2020
  2. Test program used to prove quota's behaviorAlexandr Miloslavskiy, Feb 13, 2020
  3. Eric SunshineFeb 13, 2020
  4. Alexandr MiloslavskiyFeb 13, 2020
  5. mingw: workaround for hangs when sending STDINAlexandr Miloslavskiy via GitGitGadget, Feb 17, 2020
  6. Eric SunshineFeb 17, 2020
  7. Junio C HamanoFeb 17, 2020
  8. Alexandr MiloslavskiyFeb 17, 2020
  9. mingw: workaround for hangs when sending STDINAlexandr Miloslavskiy via GitGitGadget, Feb 17, 2020
  10. Junio C HamanoFeb 18, 2020
  11. Johannes SchindelinFeb 27, 2020
  12. Junio C HamanoFeb 27, 2020

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.