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

Re: [PATCH v3 3/4] refs: make refs/worktree/* per-worktree

From
David Turner <dturner@twopensource.com>
Date
Aug 13, 2015, 20:32 UTC
Message-ID
<1439497946.8855.22.camel@twopensource.com>
In-Reply-To
<55CCFB32.30608@alum.mit.edu>
On Thu, 2015-08-13 at 22:16 +0200, Michael Haggerty wrote:
Show 35 quoted lines
> On 08/13/2015 07:41 PM, David Turner wrote:
> > On Thu, 2015-08-13 at 13:15 -0400, Eric Sunshine wrote:
> >> On Wed, Aug 12, 2015 at 5:57 PM, David Turner <dturner@twopensource.com> wrote:
> >>> diff --git a/t/t0060-path-utils.sh b/t/t0060-path-utils.sh
> >>> index 93605f4..28e6dff 100755
> >>> --- a/t/t0060-path-utils.sh
> >>> +++ b/t/t0060-path-utils.sh
> >>> +test_expect_success 'handle per-worktree refs in refs/worktree' '
> >>> +       git commit --allow-empty -m "initial commit" &&
> >>> +       git worktree add -b branch worktree &&
> >>> +       (
> >>> +               cd worktree &&
> >>> +               git commit --allow-empty -m "test commit"  &&
> >>> +               git for-each-ref | test_must_fail grep refs/worktree &&
> >>
> >> s/test_must_fail/!/
> >>
> >> From t/README:
> >>
> >>    On the other hand, don't use test_must_fail for running regular
> >>    platform commands; just use '! cmd'.  We are not in the business
> >>    of verifying that the world given to us sanely works.
> > 
> > When I make that change, my test fails with:
> > 
> > FATAL: Unexpected exit with code 2
> > 
> > Apparently, you can't use ! in pipelines like that.  So that's why I
> > used test_must_fail.
> 
> You would have to negate the whole pipeline, like
> 
>     ! git for-each-ref | grep refs/worktree
> 
> The result of a pipeline is taken from the last command.
Yes, but that would pass if for-each-ref fails, which I do not want.  

Jacob's suggestion of parentheses around (! grep refs/worktree) seems to work.

Previous: Michael HaggertyNext: Michael Haggerty
Message 19 of 24 in “refs: clean up common_list”
  1. 1/4 refs: clean up common_listDavid Turner, Aug 12, 2015
  2. 2/4 path: optimize common dir checkingDavid Turner, Aug 12, 2015
  3. Junio C HamanoAug 12, 2015
  4. Michael HaggertyAug 13, 2015
  5. Junio C HamanoAug 14, 2015
  6. David TurnerAug 14, 2015
  7. Junio C HamanoAug 14, 2015
  8. David TurnerAug 14, 2015
  9. Michael HaggertyAug 15, 2015
  10. Michael HaggertyAug 15, 2015
  11. Junio C HamanoAug 17, 2015
  12. Duy NguyenAug 15, 2015
  13. David TurnerAug 16, 2015
  14. Duy NguyenAug 16, 2015
  15. 3/4 refs: make refs/worktree/* per-worktreeDavid Turner, Aug 12, 2015
  16. Eric SunshineAug 13, 2015
  17. David TurnerAug 13, 2015
  18. Michael HaggertyAug 13, 2015
  19. David TurnerAug 13, 2015
  20. Michael HaggertyAug 14, 2015
  21. Junio C HamanoAug 14, 2015
  22. Duy NguyenAug 15, 2015
  23. 4/4 bisect: make bisection refs per-worktreeDavid Turner, Aug 12, 2015
  24. Duy NguyenAug 15, 2015

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.