{"thread":{"id":"48206","subject":"Test t2028 failes","startedAt":"2018-04-03T06:46:22Z","lastAt":"2018-04-03T08:51:45Z","messageCount":9,"participants":["Jens Krüger","Eric Sunshine"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"343656","messageId":"dfb01281-2ffb-a0ac-a44d-74ccd304a7ea@frm2.tum.de","threadId":"48206","inReplyTo":null,"subject":"Test t2028 failes","fromName":"Jens Krüger","fromEmail":"jens.krueger@frm2.tum.de","sentAt":"2018-04-03T06:33:36Z","receivedAt":"2018-04-03T06:46:22Z","isPatch":false,"sender":{"key":"jens.krueger@frm2.tum.de","avatar":null},"body":"Test 2028 failes:\n\nGit version: 2.17.0 (checked out from github repository)\n\nOS: Debian9(9.4), Debian 8 (8.10) and xubuntu 14.04(14.04.5 LTS)\n\ngcc: gcc (Debian 6.3.0-18+deb9u1) 6.3.0 20170516\n      gcc (Debian 4.9.2-10+deb8u1) 4.9.2\n      gcc (Ubuntu 4.8.4-2ubuntu1~14.04.4) 4.8.4\n\n\nconfigure generated with:\n\nautoreconf\n\nbuild with:\n\n./configure\nmake\n\ntest running:\n\nmake test\n\nError:\n\n*** t2028-worktree-move.sh ***\nok 1 - setup\nok 2 - lock main worktree\nok 3 - lock linked worktree\nok 4 - lock linked worktree from another worktree\nok 5 - lock worktree twice\nok 6 - lock worktree twice (from the locked worktree)\nok 7 - unlock main worktree\nok 8 - unlock linked worktree\nok 9 - unlock worktree twice\nok 10 - move non-worktree\nok 11 - move locked worktree\nnot ok 12 - move worktree\n#\n#               toplevel=\"$(pwd)\" &&\n#               git worktree move source destination &&\n#               test_path_is_missing source &&\n#               git worktree list --porcelain >out &&\n#               grep \"^worktree.*/destination\" out &&\n#               ! grep \"^worktree.*/source\" out &&\n#               git -C destination log --format=%s >actual2 &&\n#               echo init >expected2 &&\n#               test_cmp expected2 actual2\n#\nok 13 - move main worktree\nok 14 - move worktree to another dir\nok 15 - remove main worktree\nok 16 - remove locked worktree\nok 17 - remove worktree with dirty tracked file\nok 18 - remove worktree with untracked file\nok 19 - force remove worktree with untracked file\nok 20 - remove missing worktree\nok 21 - NOT remove missing-but-locked worktree\n# failed 1 among 21 test(s)\n1..21\n\n\n"},{"id":"343657","messageId":"CAPig+cRTf+WHaSJsLhbPuG0fwd6zkTP_zhwLhB14GdC81xiHRQ@mail.gmail.com","threadId":"48206","inReplyTo":"dfb01281-2ffb-a0ac-a44d-74ccd304a7ea@frm2.tum.de","subject":"Re: Test t2028 failes","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2018-04-03T06:58:15Z","receivedAt":"2018-04-03T06:58:22Z","isPatch":false,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"On Tue, Apr 3, 2018 at 2:33 AM, Jens Krüger <Jens.Krueger@frm2.tum.de> wrote:\n> *** t2028-worktree-move.sh ***\n> not ok 12 - move worktree\n> #\n> #               toplevel=\"$(pwd)\" &&\n> #               git worktree move source destination &&\n> #               test_path_is_missing source &&\n> #               git worktree list --porcelain >out &&\n> #               grep \"^worktree.*/destination\" out &&\n> #               ! grep \"^worktree.*/source\" out &&\n> #               git -C destination log --format=%s >actual2 &&\n> #               echo init >expected2 &&\n> #               test_cmp expected2 actual2\n> #\n\nThanks for the report. Can you paste the relevant output (which\nshould/might include an error message) from running the test with:\n\n   ./t2028-worktree-move.sh -v -i\n\nand show an \"ls -l\" of t/trash directory.t2028-worktree-move\ndirectory, as well as paste the content of files \"out\" and \"actual2\"\nin that directory?\n"},{"id":"343659","messageId":"cdec466c-ecc9-b1d7-c637-04e63552c759@frm2.tum.de","threadId":"48206","inReplyTo":"CAPig+cRTf+WHaSJsLhbPuG0fwd6zkTP_zhwLhB14GdC81xiHRQ@mail.gmail.com","subject":"Re: Test t2028 failes","fromName":"Jens Krüger","fromEmail":"jens.krueger@frm2.tum.de","sentAt":"2018-04-03T08:01:59Z","receivedAt":"2018-04-03T08:03:02Z","isPatch":false,"sender":{"key":"jens.krueger@frm2.tum.de","avatar":null},"body":"The actual2 file does not exists, if I call the ./t2028-worktree-move.sh\nwith the '-v -i' options, only without any option or with '-v' option.\n\nAm 03.04.2018 um 08:58 schrieb Eric Sunshine:\n> On Tue, Apr 3, 2018 at 2:33 AM, Jens Krüger <Jens.Krueger@frm2.tum.de> wrote:\n>> *** t2028-worktree-move.sh ***\n>> not ok 12 - move worktree\n>> #\n>> #               toplevel=\"$(pwd)\" &&\n>> #               git worktree move source destination &&\n>> #               test_path_is_missing source &&\n>> #               git worktree list --porcelain >out &&\n>> #               grep \"^worktree.*/destination\" out &&\n>> #               ! grep \"^worktree.*/source\" out &&\n>> #               git -C destination log --format=%s >actual2 &&\n>> #               echo init >expected2 &&\n>> #               test_cmp expected2 actual2\n>> #\n> \n> Thanks for the report. Can you paste the relevant output (which\n> should/might include an error message) from running the test with:\n> \n>     ./t2028-worktree-move.sh -v -i\n> \n> and show an \"ls -l\" of t/trash directory.t2028-worktree-move\n> directory, as well as paste the content of files \"out\" and \"actual2\"\n> in that directory?\n> \n\n\ninsgesamt 28\ndrwxr-xr-x 2 jkrueger jkrueger 4096 Apr  3 09:25 abc\n-rw-r--r-- 1 jkrueger jkrueger  155 Apr  3 09:25 actual\ndrwxr-xr-x 2 jkrueger jkrueger 4096 Apr  3 09:25 destination\ndrwxr-xr-x 2 jkrueger jkrueger 4096 Apr  3 09:25 elsewhere\n-rw-r--r-- 1 jkrueger jkrueger    7 Apr  3 09:25 expected\n-rw-r--r-- 1 jkrueger jkrueger    5 Apr  3 09:25 init.t\n-rw-r--r-- 1 jkrueger jkrueger  463 Apr  3 09:25 out\n\n\nInitialized empty Git repository in /home/jkrueger/sources/git/t/trash directory.t2028-worktree-move/.git/\nexpecting success: \n\ttest_commit init &&\n\tgit worktree add source &&\n\tgit worktree list --porcelain >out &&\n\tgrep \"^worktree\" out >actual &&\n\tcat <<-EOF >expected &&\n\tworktree $(pwd)\n\tworktree $(pwd)/source\n\tEOF\n\ttest_cmp expected actual\n\n[master (root-commit) 2519212] init\n Author: A U Thor <author@example.com>\n 1 file changed, 1 insertion(+)\n create mode 100644 init.t\nPreparing source (identifier source)\nHEAD is now at 2519212 init\nok 1 - setup\n\nexpecting success: \n\ttest_must_fail git worktree lock .\n\nfatal: The main working tree cannot be locked or unlocked\nok 2 - lock main worktree\n\nexpecting success: \n\tgit worktree lock --reason hahaha source &&\n\techo hahaha >expected &&\n\ttest_cmp expected .git/worktrees/source/locked\n\nok 3 - lock linked worktree\n\nexpecting success: \n\trm .git/worktrees/source/locked &&\n\tgit worktree add elsewhere &&\n\tgit -C elsewhere worktree lock --reason hahaha ../source &&\n\techo hahaha >expected &&\n\ttest_cmp expected .git/worktrees/source/locked\n\nPreparing elsewhere (identifier elsewhere)\nHEAD is now at 2519212 init\nok 4 - lock linked worktree from another worktree\n\nexpecting success: \n\ttest_must_fail git worktree lock source &&\n\techo hahaha >expected &&\n\ttest_cmp expected .git/worktrees/source/locked\n\nfatal: 'source' is already locked, reason: hahaha\nok 5 - lock worktree twice\n\nexpecting success: \n\ttest_must_fail git -C source worktree lock . &&\n\techo hahaha >expected &&\n\ttest_cmp expected .git/worktrees/source/locked\n\nfatal: '.' is already locked, reason: hahaha\nok 6 - lock worktree twice (from the locked worktree)\n\nexpecting success: \n\ttest_must_fail git worktree unlock .\n\nfatal: The main working tree cannot be locked or unlocked\nok 7 - unlock main worktree\n\nexpecting success: \n\tgit worktree unlock source &&\n\ttest_path_is_missing .git/worktrees/source/locked\n\nok 8 - unlock linked worktree\n\nexpecting success: \n\ttest_must_fail git worktree unlock source &&\n\ttest_path_is_missing .git/worktrees/source/locked\n\nfatal: 'source' is not locked\nok 9 - unlock worktree twice\n\nexpecting success: \n\tmkdir abc &&\n\ttest_must_fail git worktree move abc def\n\nfatal: 'abc' is not a working tree\nok 10 - move non-worktree\n\nexpecting success: \n\tgit worktree lock source &&\n\ttest_when_finished \"git worktree unlock source\" &&\n\ttest_must_fail git worktree move source destination\n\nfatal: cannot move a locked working tree\nok 11 - move locked worktree\n\nexpecting success: \n\ttoplevel=\"$(pwd)\" &&\n\tgit worktree move source destination &&\n\ttest_path_is_missing source &&\n\tgit worktree list --porcelain >out &&\n\tgrep \"^worktree.*/destination\" out &&\n\t! grep \"^worktree.*/source\" out &&\n\tgit -C destination log --format=%s >actual2 &&\n\techo init >expected2 &&\n\ttest_cmp expected2 actual2\n\nworktree /home/jkrueger/sources/git/t/trash directory.t2028-worktree-move/destination\nworktree /home/jkrueger/sources/git/t/trash directory.t2028-worktree-move\nworktree /home/jkrueger/sources/git/t/trash directory.t2028-worktree-move/destination\nworktree /home/jkrueger/sources/git/t/trash directory.t2028-worktree-move/elsewhere\nnot ok 12 - move worktree\n#\t\n#\t\ttoplevel=\"$(pwd)\" &&\n#\t\tgit worktree move source destination &&\n#\t\ttest_path_is_missing source &&\n#\t\tgit worktree list --porcelain >out &&\n#\t\tgrep \"^worktree.*/destination\" out &&\n#\t\t! grep \"^worktree.*/source\" out &&\n#\t\tgit -C destination log --format=%s >actual2 &&\n#\t\techo init >expected2 &&\n#\t\ttest_cmp expected2 actual2\n#\t\n\n\nworktree /home/jkrueger/sources/git/t/trash directory.t2028-worktree-move\nworktree /home/jkrueger/sources/git/t/trash directory.t2028-worktree-move/source\n\n\nworktree /home/jkrueger/sources/git/t/trash directory.t2028-worktree-move\nHEAD 2519212edd1f577b6196d394a0f08b31d5faa951\nbranch refs/heads/master\n\nworktree /home/jkrueger/sources/git/t/trash directory.t2028-worktree-move/elsewhere\nHEAD 2519212edd1f577b6196d394a0f08b31d5faa951\nbranch refs/heads/elsewhere\n\nworktree /home/jkrueger/sources/git/t/trash directory.t2028-worktree-move/some-dir/destination\nHEAD 2519212edd1f577b6196d394a0f08b31d5faa951\nbranch refs/heads/source\n\n"},{"id":"343660","messageId":"CAPig+cSsTPKoLfcxrgD4+NhXa5AeWynxumo8Zed_PH-q3U163w@mail.gmail.com","threadId":"48206","inReplyTo":"cdec466c-ecc9-b1d7-c637-04e63552c759@frm2.tum.de","subject":"Re: Test t2028 failes","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2018-04-03T08:16:38Z","receivedAt":"2018-04-03T08:16:45Z","isPatch":false,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"On Tue, Apr 3, 2018 at 4:01 AM, Jens Krüger <Jens.Krueger@frm2.tum.de> wrote:\n> The actual2 file does not exists, if I call the ./t2028-worktree-move.sh\n> with the '-v -i' options, only without any option or with '-v' option.\n\nThe content of the various files looks correct, and absence of\n\"actual2\" implies that one of the grep's failed, which is very odd\nconsidering that \"out\" has the expected content.\n\nUsing the \"out\" file you attached, can you show the output of these commands?\n\n    grep \"^worktree.*/destination\" out\n    echo $?\n    grep \"^worktree.*/source\" out\n    echo $?\n\nI'd expect the first $? to report 0 and the second 1 in a working installation.\n\nAlso, are you using an unusual 'grep'? What does \"command -v grep\" report?\n"},{"id":"343662","messageId":"0156c688-2c81-1de8-f550-efb517b7707d@frm2.tum.de","threadId":"48206","inReplyTo":"CAPig+cSsTPKoLfcxrgD4+NhXa5AeWynxumo8Zed_PH-q3U163w@mail.gmail.com","subject":"Re: Test t2028 failes","fromName":"Jens Krüger","fromEmail":"jens.krueger@frm2.tum.de","sentAt":"2018-04-03T08:38:46Z","receivedAt":"2018-04-03T08:38:57Z","isPatch":false,"sender":{"key":"jens.krueger@frm2.tum.de","avatar":null},"body":"Am 03.04.2018 um 10:16 schrieb Eric Sunshine:\n> On Tue, Apr 3, 2018 at 4:01 AM, Jens Krüger <Jens.Krueger@frm2.tum.de> wrote:\n>> The actual2 file does not exists, if I call the ./t2028-worktree-move.sh\n>> with the '-v -i' options, only without any option or with '-v' option.\n> \n> The content of the various files looks correct, and absence of\n> \"actual2\" implies that one of the grep's failed, which is very odd\n> considering that \"out\" has the expected content.\n> \n> Using the \"out\" file you attached, can you show the output of these commands?\n> \n>      grep \"^worktree.*/destination\" out\n>      echo $?\n>      grep \"^worktree.*/source\" out\n>      echo $?\n> \n> I'd expect the first $? to report 0 and the second 1 in a working installation.\n> \n\nBoth of them return 0, but I guess I found the problem. The second\n'grep' call returned the following output:\n\nworktree /home/jkrueger/sources/git/t/trash directory.t2028-worktree-move\nworktree /home/jkrueger/sources/git/t/trash \ndirectory.t2028-worktree-move/elsewhere\nworktree /home/jkrueger/sources/git/t/trash \ndirectory.t2028-worktree-move/some-dir/destination\n\nIf I move my checkout into another directory not containing 'source' in\nthe path it will work.\n\n> Also, are you using an unusual 'grep'? What does \"command -v grep\" report?\n> \n\nalias grep='grep --color=auto'\n"},{"id":"343663","messageId":"6d28dbb1-0c4c-6fca-555c-afb6c1c9e781@frm2.tum.de","threadId":"48206","inReplyTo":"CAPig+cSsTPKoLfcxrgD4+NhXa5AeWynxumo8Zed_PH-q3U163w@mail.gmail.com","subject":"Re: Test t2028 failes","fromName":"Jens Krüger","fromEmail":"jens.krueger@frm2.tum.de","sentAt":"2018-04-03T08:42:45Z","receivedAt":"2018-04-03T08:43:53Z","isPatch":false,"sender":{"key":"jens.krueger@frm2.tum.de","avatar":null},"body":"Am 03.04.2018 um 10:16 schrieb Eric Sunshine:\n> On Tue, Apr 3, 2018 at 4:01 AM, Jens Krüger <Jens.Krueger@frm2.tum.de> wrote:\n>> The actual2 file does not exists, if I call the ./t2028-worktree-move.sh\n>> with the '-v -i' options, only without any option or with '-v' option.\n> \n> The content of the various files looks correct, and absence of\n> \"actual2\" implies that one of the grep's failed, which is very odd\n> considering that \"out\" has the expected content.\n> \n> Using the \"out\" file you attached, can you show the output of these commands?\n> \n>      grep \"^worktree.*/destination\" out\n>      echo $?\n>      grep \"^worktree.*/source\" out\n>      echo $?\n> \n> I'd expect the first $? to report 0 and the second 1 in a working installation.\n> \n> Also, are you using an unusual 'grep'? What does \"command -v grep\" report?\n> \n\nMaybe, the attached patch may help. On my machine(s) it helped.\n\n\ndiff --git a/t/t2028-worktree-move.sh b/t/t2028-worktree-move.sh\nindex 5d5b3632ba..65c7311865 100755\n--- a/t/t2028-worktree-move.sh\n+++ b/t/t2028-worktree-move.sh\n@@ -77,7 +77,7 @@ test_expect_success 'move worktree' '\n \ttest_path_is_missing source &&\n \tgit worktree list --porcelain >out &&\n \tgrep \"^worktree.*/destination\" out &&\n-\t! grep \"^worktree.*/source\" out &&\n+\t! grep \"^worktree.*/source$\" out &&\n \tgit -C destination log --format=%s >actual2 &&\n \techo init >expected2 &&\n \ttest_cmp expected2 actual2\n"},{"id":"343664","messageId":"CAPig+cTvVwLDW+6rHNZbUwWwYUGBRioA6B+jM832JpUYAoPVWw@mail.gmail.com","threadId":"48206","inReplyTo":"0156c688-2c81-1de8-f550-efb517b7707d@frm2.tum.de","subject":"Re: Test t2028 failes","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2018-04-03T08:45:07Z","receivedAt":"2018-04-03T08:45:13Z","isPatch":false,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"On Tue, Apr 3, 2018 at 4:38 AM, Jens Krüger <Jens.Krueger@frm2.tum.de> wrote:\n> Am 03.04.2018 um 10:16 schrieb Eric Sunshine:\n>> Using the \"out\" file you attached, can you show the output of these\n>> commands?\n>>      grep \"^worktree.*/destination\" out\n>>      echo $?\n>>      grep \"^worktree.*/source\" out\n>>      echo $?\n>> I'd expect the first $? to report 0 and the second 1 in a working\n>> installation.\n>\n> Both of them return 0, but I guess I found the problem. The second\n> 'grep' call returned the following output:\n>\n> worktree /home/jkrueger/sources/git/t/trash directory.t2028-worktree-move\n> worktree /home/jkrueger/sources/git/t/trash\n> directory.t2028-worktree-move/elsewhere\n> worktree /home/jkrueger/sources/git/t/trash\n> directory.t2028-worktree-move/some-dir/destination\n>\n> If I move my checkout into another directory not containing 'source' in\n> the path it will work.\n\nOkay, thanks for diagnosing the problem. We can fix the test by\ntightening the regex to also anchor with '$' so that it won't be\nfooled like that.\n"},{"id":"343665","messageId":"CAPig+cQ8BsaxaWzSHvytx3aHbFbWjs1V=35PKtQCpwKOWBsstg@mail.gmail.com","threadId":"48206","inReplyTo":"6d28dbb1-0c4c-6fca-555c-afb6c1c9e781@frm2.tum.de","subject":"Re: Test t2028 failes","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2018-04-03T08:47:20Z","receivedAt":"2018-04-03T08:47:26Z","isPatch":false,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"On Tue, Apr 3, 2018 at 4:42 AM, Jens Krüger <Jens.Krueger@frm2.tum.de> wrote:\n> Maybe, the attached patch may help. On my machine(s) it helped.\n>   git worktree list --porcelain >out &&\n>   grep \"^worktree.*/destination\" out &&\n> - ! grep \"^worktree.*/source\" out &&\n> + ! grep \"^worktree.*/source$\" out &&\n\nOur emails crossed. I suggested the same in my response (although I'd\nadd the '$' anchor to both grep's, not just the one).\n"},{"id":"343666","messageId":"26a00c2b-c588-68d5-7085-22310c20e6df@frm2.tum.de","threadId":"48206","inReplyTo":"CAPig+cQ8BsaxaWzSHvytx3aHbFbWjs1V=35PKtQCpwKOWBsstg@mail.gmail.com","subject":"Re: Test t2028 failes","fromName":"Jens Krüger","fromEmail":"jens.krueger@frm2.tum.de","sentAt":"2018-04-03T08:51:04Z","receivedAt":"2018-04-03T08:51:45Z","isPatch":false,"sender":{"key":"jens.krueger@frm2.tum.de","avatar":null},"body":"Am 03.04.2018 um 10:47 schrieb Eric Sunshine:\n> On Tue, Apr 3, 2018 at 4:42 AM, Jens Krüger <Jens.Krueger@frm2.tum.de> wrote:\n>> Maybe, the attached patch may help. On my machine(s) it helped.\n>>    git worktree list --porcelain >out &&\n>>    grep \"^worktree.*/destination\" out &&\n>> - ! grep \"^worktree.*/source\" out &&\n>> + ! grep \"^worktree.*/source$\" out &&\n> \n> Our emails crossed. I suggested the same in my response (although I'd\n> add the '$' anchor to both grep's, not just the one).\n> \nI think so, that both of grep commands needs the '$' anchor.\n\nThanks, for your help.\n"}]}