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

Re: [PATCH 2/3] t7406: avoid having git commands upstream of a pipe

From
Elijah Newren <newren@gmail.com>
Date
Aug 6, 2018, 16:09 UTC
Message-ID
<CABPp-BEJn3fj8y_K27MOX48t9W9DRS-OOGuJGhq+zuHsMz3SrA@mail.gmail.com>
In-Reply-To
<20180806154814.24585-1-szeder.dev@gmail.com>
On Mon, Aug 6, 2018 at 8:48 AM SZEDER Gábor <szeder.dev@gmail.com> wrote:
Show 27 quoted lines
> > @@ -922,7 +928,7 @@ test_expect_success 'submodule update clone shallow submodule' '
> >               sed -e "s#url = ../#url = file://$pwd/#" <.gitmodules >.gitmodules.tmp &&
> >               mv -f .gitmodules.tmp .gitmodules &&
> >               git submodule update --init --depth=$commit_count &&
> > -             test 1 = $(git -C submodule log --oneline | wc -l)
> > +             test 1 = $(git -C submodule rev-list --count HEAD)
> >       )
> >  '
> >
> > @@ -938,7 +944,7 @@ test_expect_success 'submodule update clone shallow submodule outside of depth'
> >               test_i18ngrep "Direct fetching of that commit failed." actual &&
> >               git -C ../submodule config uploadpack.allowReachableSHA1InWant true &&
> >               git submodule update --init --depth=1 >actual &&
> > -             test 1 = $(git -C submodule log --oneline | wc -l)
> > +             test 1 = $(git -C submodule rev-list --count HEAD)
> >       )
> >  '
>
> These two hunks don't have the desired effect, because command
> substitutions used like this will hide the exit code anyway.  I'd
> suggest
>
>   git -C submodule log --oneline >out &&
>   test_line_count = 1 out
>
> instead, with the additional benefit of a nice error message on
> failure.

Ah, good point...and good suggestion. I'll wait for further feedback then resend with this change.

Previous: SZEDER GáborNext: Elijah Newren
Message 9 of 33 in “t7406: Make a test_must_fail call fail for the right reason”
  1. t7406: Make a test_must_fail call fail for the right reasonElijah Newren, Aug 3, 2018
  2. Junio C HamanoAug 3, 2018
  3. Eric SunshineAug 3, 2018
  4. Eric SunshineAug 3, 2018
  5. 0/2 Simple fixes to t7406Elijah Newren, Aug 6, 2018
  6. 1/3 t7406: simplify by using diff --name-only instead of diff --rawElijah Newren, Aug 6, 2018
  7. 2/3 t7406: avoid having git commands upstream of a pipeElijah Newren, Aug 6, 2018
  8. SZEDER GáborAug 6, 2018
  9. Elijah NewrenAug 6, 2018
  10. 3/3 t7406: make a test_must_fail call fail for the right reasonElijah Newren, Aug 6, 2018
  11. SZEDER GáborAug 7, 2018
  12. Elijah NewrenAug 7, 2018
  13. Martin ÅgrenAug 7, 2018
  14. Elijah NewrenAug 7, 2018
  15. 0/5 Simple fixes to t7406Elijah Newren, Aug 7, 2018
  16. 1/5 t7406: simplify by using diff --name-only instead of diff --rawElijah Newren, Aug 7, 2018
  17. Junio C HamanoAug 7, 2018
  18. Elijah NewrenAug 7, 2018
  19. Junio C HamanoAug 7, 2018
  20. 3/5 t7406: prefer test_* helper functions to test -[feds]Elijah Newren, Aug 7, 2018
  21. Junio C HamanoAug 7, 2018
  22. 5/5 t7406: fix call that was failing for the wrong reasonElijah Newren, Aug 7, 2018
  23. Junio C HamanoAug 7, 2018
  24. 4/5 t7406: avoid using test_must_fail for commands other than gitElijah Newren, Aug 7, 2018
  25. 2/5 t7406: avoid having git commands upstream of a pipeElijah Newren, Aug 7, 2018
  26. 0/5 Simple fixes to t7406Elijah Newren, Aug 8, 2018
  27. 5/5 t7406: avoid using test_must_fail for commands other than gitElijah Newren, Aug 8, 2018
  28. 2/5 t7406: simplify by using diff --name-only instead of diff --rawElijah Newren, Aug 8, 2018
  29. 4/5 t7406: prefer test_* helper functions to test -[feds]Elijah Newren, Aug 8, 2018
  30. 1/5 t7406: fix call that was failing for the wrong reasonElijah Newren, Aug 8, 2018
  31. 3/5 t7406: avoid having git commands upstream of a pipeElijah Newren, Aug 8, 2018
  32. SZEDER GáborAug 13, 2018
  33. Elijah NewrenAug 18, 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.