* Test t2028 failes
@ 2018-04-03 6:33 Jens Krüger
2018-04-03 6:58 ` Eric Sunshine
0 siblings, 1 reply; 9+ messages in thread
From: Jens Krüger @ 2018-04-03 6:33 UTC (permalink / raw)
To: git
Test 2028 failes:
Git version: 2.17.0 (checked out from github repository)
OS: Debian9(9.4), Debian 8 (8.10) and xubuntu 14.04(14.04.5 LTS)
gcc: gcc (Debian 6.3.0-18+deb9u1) 6.3.0 20170516
gcc (Debian 4.9.2-10+deb8u1) 4.9.2
gcc (Ubuntu 4.8.4-2ubuntu1~14.04.4) 4.8.4
configure generated with:
autoreconf
build with:
./configure
make
test running:
make test
Error:
*** t2028-worktree-move.sh ***
ok 1 - setup
ok 2 - lock main worktree
ok 3 - lock linked worktree
ok 4 - lock linked worktree from another worktree
ok 5 - lock worktree twice
ok 6 - lock worktree twice (from the locked worktree)
ok 7 - unlock main worktree
ok 8 - unlock linked worktree
ok 9 - unlock worktree twice
ok 10 - move non-worktree
ok 11 - move locked worktree
not ok 12 - move worktree
#
# toplevel="$(pwd)" &&
# git worktree move source destination &&
# test_path_is_missing source &&
# git worktree list --porcelain >out &&
# grep "^worktree.*/destination" out &&
# ! grep "^worktree.*/source" out &&
# git -C destination log --format=%s >actual2 &&
# echo init >expected2 &&
# test_cmp expected2 actual2
#
ok 13 - move main worktree
ok 14 - move worktree to another dir
ok 15 - remove main worktree
ok 16 - remove locked worktree
ok 17 - remove worktree with dirty tracked file
ok 18 - remove worktree with untracked file
ok 19 - force remove worktree with untracked file
ok 20 - remove missing worktree
ok 21 - NOT remove missing-but-locked worktree
# failed 1 among 21 test(s)
1..21
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Test t2028 failes
2018-04-03 6:33 Test t2028 failes Jens Krüger
@ 2018-04-03 6:58 ` Eric Sunshine
2018-04-03 8:01 ` Jens Krüger
0 siblings, 1 reply; 9+ messages in thread
From: Eric Sunshine @ 2018-04-03 6:58 UTC (permalink / raw)
To: Jens Krüger; +Cc: Git List
On Tue, Apr 3, 2018 at 2:33 AM, Jens Krüger <Jens.Krueger@frm2.tum.de> wrote:
> *** t2028-worktree-move.sh ***
> not ok 12 - move worktree
> #
> # toplevel="$(pwd)" &&
> # git worktree move source destination &&
> # test_path_is_missing source &&
> # git worktree list --porcelain >out &&
> # grep "^worktree.*/destination" out &&
> # ! grep "^worktree.*/source" out &&
> # git -C destination log --format=%s >actual2 &&
> # echo init >expected2 &&
> # test_cmp expected2 actual2
> #
Thanks for the report. Can you paste the relevant output (which
should/might include an error message) from running the test with:
./t2028-worktree-move.sh -v -i
and show an "ls -l" of t/trash directory.t2028-worktree-move
directory, as well as paste the content of files "out" and "actual2"
in that directory?
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Test t2028 failes
2018-04-03 6:58 ` Eric Sunshine
@ 2018-04-03 8:01 ` Jens Krüger
2018-04-03 8:16 ` Eric Sunshine
0 siblings, 1 reply; 9+ messages in thread
From: Jens Krüger @ 2018-04-03 8:01 UTC (permalink / raw)
To: Eric Sunshine; +Cc: Git List
[-- Attachment #1: Type: text/plain, Size: 1156 bytes --]
The actual2 file does not exists, if I call the ./t2028-worktree-move.sh
with the '-v -i' options, only without any option or with '-v' option.
Am 03.04.2018 um 08:58 schrieb Eric Sunshine:
> On Tue, Apr 3, 2018 at 2:33 AM, Jens Krüger <Jens.Krueger@frm2.tum.de> wrote:
>> *** t2028-worktree-move.sh ***
>> not ok 12 - move worktree
>> #
>> # toplevel="$(pwd)" &&
>> # git worktree move source destination &&
>> # test_path_is_missing source &&
>> # git worktree list --porcelain >out &&
>> # grep "^worktree.*/destination" out &&
>> # ! grep "^worktree.*/source" out &&
>> # git -C destination log --format=%s >actual2 &&
>> # echo init >expected2 &&
>> # test_cmp expected2 actual2
>> #
>
> Thanks for the report. Can you paste the relevant output (which
> should/might include an error message) from running the test with:
>
> ./t2028-worktree-move.sh -v -i
>
> and show an "ls -l" of t/trash directory.t2028-worktree-move
> directory, as well as paste the content of files "out" and "actual2"
> in that directory?
>
[-- Attachment #2: ls.output --]
[-- Type: text/plain, Size: 409 bytes --]
insgesamt 28
drwxr-xr-x 2 jkrueger jkrueger 4096 Apr 3 09:25 abc
-rw-r--r-- 1 jkrueger jkrueger 155 Apr 3 09:25 actual
drwxr-xr-x 2 jkrueger jkrueger 4096 Apr 3 09:25 destination
drwxr-xr-x 2 jkrueger jkrueger 4096 Apr 3 09:25 elsewhere
-rw-r--r-- 1 jkrueger jkrueger 7 Apr 3 09:25 expected
-rw-r--r-- 1 jkrueger jkrueger 5 Apr 3 09:25 init.t
-rw-r--r-- 1 jkrueger jkrueger 463 Apr 3 09:25 out
[-- Attachment #3: t2028.output --]
[-- Type: text/plain, Size: 3520 bytes --]
Initialized empty Git repository in /home/jkrueger/sources/git/t/trash directory.t2028-worktree-move/.git/
expecting success:
test_commit init &&
git worktree add source &&
git worktree list --porcelain >out &&
grep "^worktree" out >actual &&
cat <<-EOF >expected &&
worktree $(pwd)
worktree $(pwd)/source
EOF
test_cmp expected actual
[master (root-commit) 2519212] init
Author: A U Thor <author@example.com>
1 file changed, 1 insertion(+)
create mode 100644 init.t
Preparing source (identifier source)
HEAD is now at 2519212 init
ok 1 - setup
expecting success:
test_must_fail git worktree lock .
fatal: The main working tree cannot be locked or unlocked
ok 2 - lock main worktree
expecting success:
git worktree lock --reason hahaha source &&
echo hahaha >expected &&
test_cmp expected .git/worktrees/source/locked
ok 3 - lock linked worktree
expecting success:
rm .git/worktrees/source/locked &&
git worktree add elsewhere &&
git -C elsewhere worktree lock --reason hahaha ../source &&
echo hahaha >expected &&
test_cmp expected .git/worktrees/source/locked
Preparing elsewhere (identifier elsewhere)
HEAD is now at 2519212 init
ok 4 - lock linked worktree from another worktree
expecting success:
test_must_fail git worktree lock source &&
echo hahaha >expected &&
test_cmp expected .git/worktrees/source/locked
fatal: 'source' is already locked, reason: hahaha
ok 5 - lock worktree twice
expecting success:
test_must_fail git -C source worktree lock . &&
echo hahaha >expected &&
test_cmp expected .git/worktrees/source/locked
fatal: '.' is already locked, reason: hahaha
ok 6 - lock worktree twice (from the locked worktree)
expecting success:
test_must_fail git worktree unlock .
fatal: The main working tree cannot be locked or unlocked
ok 7 - unlock main worktree
expecting success:
git worktree unlock source &&
test_path_is_missing .git/worktrees/source/locked
ok 8 - unlock linked worktree
expecting success:
test_must_fail git worktree unlock source &&
test_path_is_missing .git/worktrees/source/locked
fatal: 'source' is not locked
ok 9 - unlock worktree twice
expecting success:
mkdir abc &&
test_must_fail git worktree move abc def
fatal: 'abc' is not a working tree
ok 10 - move non-worktree
expecting success:
git worktree lock source &&
test_when_finished "git worktree unlock source" &&
test_must_fail git worktree move source destination
fatal: cannot move a locked working tree
ok 11 - move locked worktree
expecting success:
toplevel="$(pwd)" &&
git worktree move source destination &&
test_path_is_missing source &&
git worktree list --porcelain >out &&
grep "^worktree.*/destination" out &&
! grep "^worktree.*/source" out &&
git -C destination log --format=%s >actual2 &&
echo init >expected2 &&
test_cmp expected2 actual2
worktree /home/jkrueger/sources/git/t/trash directory.t2028-worktree-move/destination
worktree /home/jkrueger/sources/git/t/trash directory.t2028-worktree-move
worktree /home/jkrueger/sources/git/t/trash directory.t2028-worktree-move/destination
worktree /home/jkrueger/sources/git/t/trash directory.t2028-worktree-move/elsewhere
not ok 12 - move worktree
#
# toplevel="$(pwd)" &&
# git worktree move source destination &&
# test_path_is_missing source &&
# git worktree list --porcelain >out &&
# grep "^worktree.*/destination" out &&
# ! grep "^worktree.*/source" out &&
# git -C destination log --format=%s >actual2 &&
# echo init >expected2 &&
# test_cmp expected2 actual2
#
[-- Attachment #4: actual --]
[-- Type: text/plain, Size: 155 bytes --]
worktree /home/jkrueger/sources/git/t/trash directory.t2028-worktree-move
worktree /home/jkrueger/sources/git/t/trash directory.t2028-worktree-move/source
[-- Attachment #5: out --]
[-- Type: text/plain, Size: 472 bytes --]
worktree /home/jkrueger/sources/git/t/trash directory.t2028-worktree-move
HEAD 2519212edd1f577b6196d394a0f08b31d5faa951
branch refs/heads/master
worktree /home/jkrueger/sources/git/t/trash directory.t2028-worktree-move/elsewhere
HEAD 2519212edd1f577b6196d394a0f08b31d5faa951
branch refs/heads/elsewhere
worktree /home/jkrueger/sources/git/t/trash directory.t2028-worktree-move/some-dir/destination
HEAD 2519212edd1f577b6196d394a0f08b31d5faa951
branch refs/heads/source
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Test t2028 failes
2018-04-03 8:01 ` Jens Krüger
@ 2018-04-03 8:16 ` Eric Sunshine
2018-04-03 8:38 ` Jens Krüger
2018-04-03 8:42 ` Jens Krüger
0 siblings, 2 replies; 9+ messages in thread
From: Eric Sunshine @ 2018-04-03 8:16 UTC (permalink / raw)
To: Jens Krüger; +Cc: Eric Sunshine, Git List
On Tue, Apr 3, 2018 at 4:01 AM, Jens Krüger <Jens.Krueger@frm2.tum.de> wrote:
> The actual2 file does not exists, if I call the ./t2028-worktree-move.sh
> with the '-v -i' options, only without any option or with '-v' option.
The content of the various files looks correct, and absence of
"actual2" implies that one of the grep's failed, which is very odd
considering that "out" has the expected content.
Using the "out" file you attached, can you show the output of these commands?
grep "^worktree.*/destination" out
echo $?
grep "^worktree.*/source" out
echo $?
I'd expect the first $? to report 0 and the second 1 in a working installation.
Also, are you using an unusual 'grep'? What does "command -v grep" report?
^ permalink raw reply [flat|nested] 9+ messages in thread* Re: Test t2028 failes
2018-04-03 8:16 ` Eric Sunshine
@ 2018-04-03 8:38 ` Jens Krüger
2018-04-03 8:45 ` Eric Sunshine
2018-04-03 8:42 ` Jens Krüger
1 sibling, 1 reply; 9+ messages in thread
From: Jens Krüger @ 2018-04-03 8:38 UTC (permalink / raw)
To: Eric Sunshine; +Cc: Git List
Am 03.04.2018 um 10:16 schrieb Eric Sunshine:
> On Tue, Apr 3, 2018 at 4:01 AM, Jens Krüger <Jens.Krueger@frm2.tum.de> wrote:
>> The actual2 file does not exists, if I call the ./t2028-worktree-move.sh
>> with the '-v -i' options, only without any option or with '-v' option.
>
> The content of the various files looks correct, and absence of
> "actual2" implies that one of the grep's failed, which is very odd
> considering that "out" has the expected content.
>
> Using the "out" file you attached, can you show the output of these commands?
>
> grep "^worktree.*/destination" out
> echo $?
> grep "^worktree.*/source" out
> echo $?
>
> I'd expect the first $? to report 0 and the second 1 in a working installation.
>
Both of them return 0, but I guess I found the problem. The second
'grep' call returned the following output:
worktree /home/jkrueger/sources/git/t/trash directory.t2028-worktree-move
worktree /home/jkrueger/sources/git/t/trash
directory.t2028-worktree-move/elsewhere
worktree /home/jkrueger/sources/git/t/trash
directory.t2028-worktree-move/some-dir/destination
If I move my checkout into another directory not containing 'source' in
the path it will work.
> Also, are you using an unusual 'grep'? What does "command -v grep" report?
>
alias grep='grep --color=auto'
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Test t2028 failes
2018-04-03 8:38 ` Jens Krüger
@ 2018-04-03 8:45 ` Eric Sunshine
0 siblings, 0 replies; 9+ messages in thread
From: Eric Sunshine @ 2018-04-03 8:45 UTC (permalink / raw)
To: Jens Krüger; +Cc: Eric Sunshine, Git List
On Tue, Apr 3, 2018 at 4:38 AM, Jens Krüger <Jens.Krueger@frm2.tum.de> wrote:
> Am 03.04.2018 um 10:16 schrieb Eric Sunshine:
>> Using the "out" file you attached, can you show the output of these
>> commands?
>> grep "^worktree.*/destination" out
>> echo $?
>> grep "^worktree.*/source" out
>> echo $?
>> I'd expect the first $? to report 0 and the second 1 in a working
>> installation.
>
> Both of them return 0, but I guess I found the problem. The second
> 'grep' call returned the following output:
>
> worktree /home/jkrueger/sources/git/t/trash directory.t2028-worktree-move
> worktree /home/jkrueger/sources/git/t/trash
> directory.t2028-worktree-move/elsewhere
> worktree /home/jkrueger/sources/git/t/trash
> directory.t2028-worktree-move/some-dir/destination
>
> If I move my checkout into another directory not containing 'source' in
> the path it will work.
Okay, thanks for diagnosing the problem. We can fix the test by
tightening the regex to also anchor with '$' so that it won't be
fooled like that.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Test t2028 failes
2018-04-03 8:16 ` Eric Sunshine
2018-04-03 8:38 ` Jens Krüger
@ 2018-04-03 8:42 ` Jens Krüger
2018-04-03 8:47 ` Eric Sunshine
1 sibling, 1 reply; 9+ messages in thread
From: Jens Krüger @ 2018-04-03 8:42 UTC (permalink / raw)
To: Eric Sunshine; +Cc: Git List
[-- Attachment #1: Type: text/plain, Size: 893 bytes --]
Am 03.04.2018 um 10:16 schrieb Eric Sunshine:
> On Tue, Apr 3, 2018 at 4:01 AM, Jens Krüger <Jens.Krueger@frm2.tum.de> wrote:
>> The actual2 file does not exists, if I call the ./t2028-worktree-move.sh
>> with the '-v -i' options, only without any option or with '-v' option.
>
> The content of the various files looks correct, and absence of
> "actual2" implies that one of the grep's failed, which is very odd
> considering that "out" has the expected content.
>
> Using the "out" file you attached, can you show the output of these commands?
>
> grep "^worktree.*/destination" out
> echo $?
> grep "^worktree.*/source" out
> echo $?
>
> I'd expect the first $? to report 0 and the second 1 in a working installation.
>
> Also, are you using an unusual 'grep'? What does "command -v grep" report?
>
Maybe, the attached patch may help. On my machine(s) it helped.
[-- Attachment #2: a.patch --]
[-- Type: text/x-patch, Size: 511 bytes --]
diff --git a/t/t2028-worktree-move.sh b/t/t2028-worktree-move.sh
index 5d5b3632ba..65c7311865 100755
--- a/t/t2028-worktree-move.sh
+++ b/t/t2028-worktree-move.sh
@@ -77,7 +77,7 @@ test_expect_success 'move worktree' '
test_path_is_missing source &&
git worktree list --porcelain >out &&
grep "^worktree.*/destination" out &&
- ! grep "^worktree.*/source" out &&
+ ! grep "^worktree.*/source$" out &&
git -C destination log --format=%s >actual2 &&
echo init >expected2 &&
test_cmp expected2 actual2
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: Test t2028 failes
2018-04-03 8:42 ` Jens Krüger
@ 2018-04-03 8:47 ` Eric Sunshine
2018-04-03 8:51 ` Jens Krüger
0 siblings, 1 reply; 9+ messages in thread
From: Eric Sunshine @ 2018-04-03 8:47 UTC (permalink / raw)
To: Jens Krüger; +Cc: Eric Sunshine, Git List
On Tue, Apr 3, 2018 at 4:42 AM, Jens Krüger <Jens.Krueger@frm2.tum.de> wrote:
> Maybe, the attached patch may help. On my machine(s) it helped.
> git worktree list --porcelain >out &&
> grep "^worktree.*/destination" out &&
> - ! grep "^worktree.*/source" out &&
> + ! grep "^worktree.*/source$" out &&
Our emails crossed. I suggested the same in my response (although I'd
add the '$' anchor to both grep's, not just the one).
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Test t2028 failes
2018-04-03 8:47 ` Eric Sunshine
@ 2018-04-03 8:51 ` Jens Krüger
0 siblings, 0 replies; 9+ messages in thread
From: Jens Krüger @ 2018-04-03 8:51 UTC (permalink / raw)
To: Eric Sunshine; +Cc: Git List
Am 03.04.2018 um 10:47 schrieb Eric Sunshine:
> On Tue, Apr 3, 2018 at 4:42 AM, Jens Krüger <Jens.Krueger@frm2.tum.de> wrote:
>> Maybe, the attached patch may help. On my machine(s) it helped.
>> git worktree list --porcelain >out &&
>> grep "^worktree.*/destination" out &&
>> - ! grep "^worktree.*/source" out &&
>> + ! grep "^worktree.*/source$" out &&
>
> Our emails crossed. I suggested the same in my response (although I'd
> add the '$' anchor to both grep's, not just the one).
>
I think so, that both of grep commands needs the '$' anchor.
Thanks, for your help.
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2018-04-03 8:51 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-04-03 6:33 Test t2028 failes Jens Krüger
2018-04-03 6:58 ` Eric Sunshine
2018-04-03 8:01 ` Jens Krüger
2018-04-03 8:16 ` Eric Sunshine
2018-04-03 8:38 ` Jens Krüger
2018-04-03 8:45 ` Eric Sunshine
2018-04-03 8:42 ` Jens Krüger
2018-04-03 8:47 ` Eric Sunshine
2018-04-03 8:51 ` Jens Krüger
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).