threads / discuss / 8681

Failure in t5516, tests 15 and 16

Subject: Failure in t5516, tests 15 and 16

## tl;dr

4 messages between Jun 22, 2007 and Jun 27, 2007.

replies: 3people: 2as markdown or json

Brian Gernhardt· Jun 22, 2007, 14:50 UTC · lore

Tests 15 and 16 in script "t5516-fetch-push.sh" fails with "notice: HEAD points to an unborn branch (master)". Is this just bad tests or an actual failure? This is with current master (45fd8bd32dd68ce6b14a406d0abbd6f56490131c) on OS X.

Detailed test results follow.
~~ Brian
----- 8< -----
* expecting success:
         mk_test &&
         if git show-ref --verify -q refs/tags/frotz
         then
                 git tag -d frotz
         fi &&
         git branch -f frotz master &&
         git push testrepo frotz &&
         check_push_result $the_commit heads/frotz &&
         test "$( cd testrepo && git show-ref | wc -l )" = 1
Initialized empty Git repository in .git/
notice: HEAD points to an unborn branch (master)
notice: No default references
Deleted tag frotz.
updating 'refs/heads/frotz'
   from 0000000000000000000000000000000000000000
   to   9ad36e1e54b2130a20d55abb4f0f3ca8494ead3f
Generating pack...
Done counting 5 objects.
Deltifying 5 objects...
  100% (5/5) done
Writing 5 objects...
  100% (5/5) done
Total 5 (delta 0), reused 0 (delta 0)
Unpacking 5 objects...
  100% (5/5) done
refs/heads/frotz: 0000000000000000000000000000000000000000 ->  
9ad36e1e54b2130a20d55abb4f0f3ca8494ead3f
notice: HEAD points to an unborn branch (master)
* FAIL 15: push with colon-less refspec (3)
                 mk_test &&
                 if git show-ref --verify -q refs/tags/frotz
                 then
                         git tag -d frotz
                 fi &&
                 git branch -f frotz master &&
                 git push testrepo frotz &&
                 check_push_result $the_commit heads/frotz &&
                 test "$( cd testrepo && git show-ref | wc -l )" = 1
* expecting success:
         mk_test &&
         if git show-ref --verify -q refs/heads/frotz
         then
                 git branch -D frotz
         fi &&
         git tag -f frotz &&
         git push testrepo frotz &&
         check_push_result $the_commit tags/frotz &&
         test "$( cd testrepo && git show-ref | wc -l )" = 1
Initialized empty Git repository in .git/
notice: HEAD points to an unborn branch (master)
notice: No default references
Deleted branch frotz.
updating 'refs/tags/frotz'
   from 0000000000000000000000000000000000000000
   to   9ad36e1e54b2130a20d55abb4f0f3ca8494ead3f
Generating pack...
Done counting 5 objects.
Deltifying 5 objects...
  100% (5/5) done
Writing 5 objects...
  100% (5/5) done
Total 5 (delta 0), reused 0 (delta 0)
Unpacking 5 objects...
  100% (5/5) done
refs/tags/frotz: 0000000000000000000000000000000000000000 ->  
9ad36e1e54b2130a20d55abb4f0f3ca8494ead3f
notice: HEAD points to an unborn branch (master)
* FAIL 16: push with colon-less refspec (4)
                 mk_test &&
                 if git show-ref --verify -q refs/heads/frotz
                 then
                         git branch -D frotz
                 fi &&
                 git tag -f frotz &&
                 git push testrepo frotz &&
                 check_push_result $the_commit tags/frotz &&
                 test "$( cd testrepo && git show-ref | wc -l )" = 1
* failed 2 among 16 test(s)
Brian Gernhardt· Jun 27, 2007, 01:29 UTC · re: Brian Gernhardt · lore

Re: Failure in t5516, tests 15 and 16

On Jun 22, 2007, at 10:50 AM, Brian Gernhardt wrote:
> Tests 15 and 16 in script "t5516-fetch-push.sh" fails with "notice:  
> HEAD points to an unborn branch (master)".  Is this just bad tests  
> or an actual failure?  This is with current master  
> (45fd8bd32dd68ce6b14a406d0abbd6f56490131c) on OS X.

Okay, I just did used the wonderful "git bisect run" to find out where this error started happening. The answer appears to be in the first commit the tests appeared in: 1ed10b886bc69c129c06772ee4310c00e001657f

I dislike that immensely. Can anyone help me figure out why the test fails? There is no error message printed. I thought the "HEAD points to an unborn branch" was the error, but that doesn't seem to be it.

Again, the test results are below.
~~ Brian
----- 8< -----
* expecting success:
         mk_test &&
         if git show-ref --verify -q refs/tags/frotz
         then
                 git tag -d frotz
         fi &&
         git branch -f frotz master &&
         git push testrepo frotz &&
         check_push_result $the_commit heads/frotz &&
         test "$( cd testrepo && git show-ref | wc -l )" = 1
Initialized empty Git repository in .git/
notice: HEAD points to an unborn branch (master)
notice: No default references
Deleted tag frotz.
updating 'refs/heads/frotz'
   from 0000000000000000000000000000000000000000
   to   9ad36e1e54b2130a20d55abb4f0f3ca8494ead3f
Generating pack...
Done counting 5 objects.
Deltifying 5 objects...
  100% (5/5) done
Writing 5 objects...
  100% (5/5) done
Total 5 (delta 0), reused 0 (delta 0)
Unpacking 5 objects...
  100% (5/5) done
refs/heads/frotz: 0000000000000000000000000000000000000000 ->  
9ad36e1e54b2130a20d55abb4f0f3ca8494ead3f
notice: HEAD points to an unborn branch (master)
* FAIL 15: push with colon-less refspec (3)
                 mk_test &&
                 if git show-ref --verify -q refs/tags/frotz
                 then
                         git tag -d frotz
                 fi &&
                 git branch -f frotz master &&
                 git push testrepo frotz &&
                 check_push_result $the_commit heads/frotz &&
                 test "$( cd testrepo && git show-ref | wc -l )" = 1
* expecting success:
         mk_test &&
         if git show-ref --verify -q refs/heads/frotz
         then
                 git branch -D frotz
         fi &&
         git tag -f frotz &&
         git push testrepo frotz &&
         check_push_result $the_commit tags/frotz &&
         test "$( cd testrepo && git show-ref | wc -l )" = 1
Initialized empty Git repository in .git/
notice: HEAD points to an unborn branch (master)
notice: No default references
Deleted branch frotz.
updating 'refs/tags/frotz'
   from 0000000000000000000000000000000000000000
   to   9ad36e1e54b2130a20d55abb4f0f3ca8494ead3f
Generating pack...
Done counting 5 objects.
Deltifying 5 objects...
  100% (5/5) done
Writing 5 objects...
  100% (5/5) done
Total 5 (delta 0), reused 0 (delta 0)
Unpacking 5 objects...
  100% (5/5) done
refs/tags/frotz: 0000000000000000000000000000000000000000 ->  
9ad36e1e54b2130a20d55abb4f0f3ca8494ead3f
notice: HEAD points to an unborn branch (master)
* FAIL 16: push with colon-less refspec (4)
                 mk_test &&
                 if git show-ref --verify -q refs/heads/frotz
                 then
                         git branch -D frotz
                 fi &&
                 git tag -f frotz &&
                 git push testrepo frotz &&
                 check_push_result $the_commit tags/frotz &&
                 test "$( cd testrepo && git show-ref | wc -l )" = 1
* failed 2 among 16 test(s)
Junio C Hamano· Jun 27, 2007, 01:44 UTC · re: Brian Gernhardt · lore

Re: Failure in t5516, tests 15 and 16

Brian Gernhardt <benji@silverinsanity.com> writes:
Show 6 quoted lines
> On Jun 22, 2007, at 10:50 AM, Brian Gernhardt wrote:
>
>> Tests 15 and 16 in script "t5516-fetch-push.sh" fails with "notice:
>> HEAD points to an unborn branch (master)".  Is this just bad tests
>> or an actual failure?  This is with current master
>> (45fd8bd32dd68ce6b14a406d0abbd6f56490131c) on OS X.
Can you check "cd t && sh -x t5516-fetch-push.sh -i -v"?
I am suspecting that
                test "$( cd testrepo && git show-ref | wc -l )" = 1

may have an interesting effect when "wc -l" emits extra whitespaces. Does this fix it for you?

diff --git a/t/t5516-fetch-push.sh b/t/t5516-fetch-push.sh
index 08d58e1..c0fa2ba 100755
--- a/t/t5516-fetch-push.sh
+++ b/t/t5516-fetch-push.sh
@@ -226,7 +226,7 @@ test_expect_success 'push with colon-less refspec (3)' '
 	git branch -f frotz master &&
 	git push testrepo frotz &&
 	check_push_result $the_commit heads/frotz &&
-	test "$( cd testrepo && git show-ref | wc -l )" = 1
+	test 1 = $(cd testrepo && git show-ref | wc -l)
 '
 
 test_expect_success 'push with colon-less refspec (4)' '
@@ -239,7 +239,7 @@ test_expect_success 'push with colon-less refspec (4)' '
 	git tag -f frotz &&
 	git push testrepo frotz &&
 	check_push_result $the_commit tags/frotz &&
-	test "$( cd testrepo && git show-ref | wc -l )" = 1
+	test 1 = $(cd testrepo && git show-ref | wc -l)
 
 '
 
Brian Gernhardt· Jun 27, 2007, 01:59 UTC · re: Junio C Hamano · lore

Re: Failure in t5516, tests 15 and 16

On Jun 26, 2007, at 9:44 PM, Junio C Hamano wrote:
Show 8 quoted lines
> Can you check "cd t && sh -x t5516-fetch-push.sh -i -v"?
>
> I am suspecting that
>
>                 test "$( cd testrepo && git show-ref | wc -l )" = 1
>
> may have an interesting effect when "wc -l" emits extra
> whitespaces.  Does this fix it for you?

Exactly right. This bit me a while back on some other test as well. Should have thought of it this time. Removing the quotes (done manually, as it was faster than extracting your patch from the mail) fixed it and that test works properly now. I'm now getting errors in some CVS test... I'll figure that out later, but it appears completely unrelated.

I'm beginning to despise several of the OS X utilities. I wonder if this is inherited from some BSD, or if it's all new. Doesn't matter though, if you'd be so kind as to remove those quotes from git.git. :-)

~~ Brian

← back to recent threads