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

Re: [PATCH 1/2] t0001: remove pipes

From
Derrick Stolee <derrickstolee@github.com>
Date
Feb 22, 2022, 13:54 UTC
Message-ID
<9d08d2a6-82ed-7d6c-6a82-0e89c55bd94a@github.com>
In-Reply-To
<20220222114313.14921-2-shivam828787@gmail.com>
On 2/22/2022 6:43 AM, Shubham Mishra wrote:
> pipes doesn't care about error codes and ignore them thus we should not use them in tests.
> As an easy alternative, I am using a tmp file to write from git command so we can test the exit code.

Please be careful about the length of your lines in your commit message. vim should auto-wrap as you write.

There are also some grammar issues, so here is an update to what you wrote:

  Pipes ignore error codes and thus we should not use them
  in tests. As an alternative, use a 'tmp' file to write the
  Git output so we can test the exit code.
(My wrapping is probably too short here.)
Show 15 quoted lines
> Signed-off-by: Shubham Mishra <shivam828787@gmail.com>
> ---
>  t/t0001-init.sh | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/t/t0001-init.sh b/t/t0001-init.sh
> index 3235ab4d53..9a8f209648 100755
> --- a/t/t0001-init.sh
> +++ b/t/t0001-init.sh
> @@ -489,11 +489,11 @@ test_expect_success 're-init from a linked worktree' '
>  		git worktree add ../linked-worktree &&
>  		mv .git/info/exclude expected-exclude &&
>  		cp .git/config expected-config &&
> -		find .git/worktrees -print | sort >expected &&
> +		find .git/worktrees -print >tmp && sort tmp >expected &&
Split each part of the &&-chain across lines, like this:

+ find .git/worktrees -print >tmp && + sort tmp >expected &&

Show 5 quoted lines
>  		git -C ../linked-worktree init &&
>  		test_cmp expected-exclude .git/info/exclude &&
>  		test_cmp expected-config .git/config &&
> -		find .git/worktrees -print | sort >actual &&
> +		find .git/worktrees -print >tmp && sort tmp >actual &&
Here, too.

I could make the same comments on patch 2, but I think you have enough info to go on.

Thanks, -Stolee

Previous: Shubham MishraNext: Shubham Mishra
Message 3 of 31 in “microproject: avoid using pipes in test”
  1. 0/2 microproject: avoid using pipes in testShubham Mishra, Feb 22, 2022
  2. 1/2 t0001: remove pipesShubham Mishra, Feb 22, 2022
  3. Derrick StoleeFeb 22, 2022
  4. Shubham MishraFeb 22, 2022
  5. Christian CouderFeb 22, 2022
  6. Junio C HamanoFeb 23, 2022
  7. Christian CouderFeb 24, 2022
  8. 2/2 t0003: remove pipesShubham Mishra, Feb 22, 2022
  9. Derrick StoleeFeb 22, 2022
  10. Ævar Arnfjörð BjarmasonFeb 22, 2022
  11. Shubham MishraFeb 22, 2022
  12. Taylor BlauFeb 22, 2022
  13. 0/2 avoid pipes with Git on LHSShubham Mishra, Feb 23, 2022
  14. 1/2 t0001: avoid pipes with Git on LHSShubham Mishra, Feb 23, 2022
  15. Taylor BlauFeb 23, 2022
  16. Shubham MishraFeb 23, 2022
  17. Taylor BlauFeb 23, 2022
  18. Junio C HamanoFeb 23, 2022
  19. Shubham MishraFeb 24, 2022
  20. 2/2 t0003: avoid pipes with Git on LHSShubham Mishra, Feb 23, 2022
  21. Taylor BlauFeb 23, 2022
  22. Shubham MishraFeb 23, 2022
  23. Shubham MishraFeb 23, 2022
  24. Shaoxuan YuanFeb 23, 2022
  25. Taylor BlauFeb 23, 2022
  26. Shubham MishraFeb 23, 2022
  27. Christian CouderFeb 24, 2022
  28. Shubham MishraFeb 24, 2022
  29. Christian CouderFeb 24, 2022
  30. Shubham MishraFeb 24, 2022
  31. Christian CouderFeb 24, 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.