{"thread":{"id":"15885","subject":"Puzzled by a t9500 test failure","startedAt":"2008-10-13T23:40:54Z","lastAt":"2008-10-15T04:27:12Z","messageCount":6,"participants":["Junio C Hamano","Shawn O. Pearce"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"92982","messageId":"7vljws83nd.fsf@gitster.siamese.dyndns.org","threadId":"15885","inReplyTo":null,"subject":"Puzzled by a t9500 test failure","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-10-13T23:40:54Z","receivedAt":"2008-10-13T23:40:54Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"With recent tip of 'master':\n\n    $ make\n    $ mkdir t/trash\n    $ cd t && sh t9500-*.sh -i\n\nfails at the very first test.  Can anybody figure out why?\n"},{"id":"92984","messageId":"20081013234851.GY4856@spearce.org","threadId":"15885","inReplyTo":"7vljws83nd.fsf@gitster.siamese.dyndns.org","subject":"Re: Puzzled by a t9500 test failure","fromName":"Shawn O. Pearce","fromEmail":"spearce@spearce.org","sentAt":"2008-10-13T23:48:51Z","receivedAt":"2008-10-13T23:48:51Z","isPatch":false,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"Junio C Hamano <gitster@pobox.com> wrote:\n> With recent tip of 'master':\n> \n>     $ make\n>     $ mkdir t/trash\n>     $ cd t && sh t9500-*.sh -i\n> \n> fails at the very first test.  Can anybody figure out why?\n\nHmmph.  Near as I can tell its because gitweb.log has this in it:\n\n$ cat gitweb.log\n[Mon Oct 13 23:43:36 2008] gitweb.perl: Use of uninitialized value in scalar chomp at /home/sop/local/maint-git/t/../gitweb/gitweb.perl line 1811.\n[Mon Oct 13 23:43:36 2008] gitweb.perl: Use of uninitialized value in addition (+) at /home/sop/local/maint-git/t/../gitweb/gitweb.perl line 3772.\nHASH..\n\nThe test does a grep for '[[]' and if it matches, fails.  I'm not\nsure why this started showing up now.  Obviously I merged something\nthat failed the test suite, but I was pretty sure I had run the full\nset before publishing anything.\n\n-- \nShawn.\n"},{"id":"92985","messageId":"20081014000812.GZ4856@spearce.org","threadId":"15885","inReplyTo":"20081013234851.GY4856@spearce.org","subject":"Re: Puzzled by a t9500 test failure","fromName":"Shawn O. Pearce","fromEmail":"spearce@spearce.org","sentAt":"2008-10-14T00:08:12Z","receivedAt":"2008-10-14T00:08:12Z","isPatch":false,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"\"Shawn O. Pearce\" <spearce@spearce.org> wrote:\n> Junio C Hamano <gitster@pobox.com> wrote:\n> > With recent tip of 'master':\n> > \n> >     $ make\n> >     $ mkdir t/trash\n> >     $ cd t && sh t9500-*.sh -i\n> > \n> > fails at the very first test.  Can anybody figure out why?\n> \n> Hmmph.  Near as I can tell its because gitweb.log has this in it:\n> \n> $ cat gitweb.log\n> [Mon Oct 13 23:43:36 2008] gitweb.perl: Use of uninitialized value in scalar chomp at /home/sop/local/maint-git/t/../gitweb/gitweb.perl line 1811.\n> [Mon Oct 13 23:43:36 2008] gitweb.perl: Use of uninitialized value in addition (+) at /home/sop/local/maint-git/t/../gitweb/gitweb.perl line 3772.\n> HASH..\n\nbisect says its aed93de428d7d12ee23d84d27265af1e37eb348f,\n\"gitweb: Support for tag clouds\".\n\nThis appears to fix it.  As for how I missed this, I do not know.\nI usually tested topic branches pretty heavily before merging them\nto next, and I tested both master and next daily.  So I thought\nthe topic was ready to merge into master.  Apparently it was not.\nHow I missed the failed merge, I don't know. :-\\\n\ndiff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl\nindex 1116800..793166e 100755\n--- a/gitweb/gitweb.perl\n+++ b/gitweb/gitweb.perl\n@@ -1808,7 +1808,7 @@ sub git_get_project_ctags {\n \tforeach (<$git_dir/ctags/*>) {\n \t\topen CT, $_ or next;\n \t\tmy $val = <CT>;\n-\t\tchomp $val;\n+\t\tchomp $val if defined $val;\n \t\tclose CT;\n \t\tmy $ctag = $_; $ctag =~ s#.*/##;\n \t\t$ctags->{$ctag} = $val;\n@@ -1822,7 +1822,11 @@ sub git_populate_project_tagcloud {\n \t# First, merge different-cased tags; tags vote on casing\n \tmy %ctags_lc;\n \tforeach (keys %$ctags) {\n-\t\t$ctags_lc{lc $_}->{count} += $ctags->{$_};\n+\t\tif (defined ($ctags_lc{lc $_}->{count})) {\n+\t\t\t$ctags_lc{lc $_}->{count} += $ctags->{$_};\n+\t\t} else {\n+\t\t\t$ctags_lc{lc $_}->{count} = $ctags->{$_};\n+\t\t}\n \t\tif (not $ctags_lc{lc $_}->{topcount}\n \t\t    or $ctags_lc{lc $_}->{topcount} < $ctags->{$_}) {\n \t\t\t$ctags_lc{lc $_}->{topcount} = $ctags->{$_};\n@@ -3769,7 +3773,11 @@ sub git_project_list_body {\n \t\tmy %ctags;\n \t\tforeach my $p (@projects) {\n \t\t\tforeach my $ct (keys %{$p->{'ctags'}}) {\n-\t\t\t\t$ctags{$ct} += $p->{'ctags'}->{$ct};\n+\t\t\t\tif (defined $ctags{$ct}) {\n+\t\t\t\t\t$ctags{$ct} += $p->{'ctags'}->{$ct};\n+\t\t\t\t} else {\n+\t\t\t\t\t$ctags{$ct} = $p->{'ctags'}->{$ct};\n+\t\t\t\t}\n \t\t\t}\n \t\t}\n \t\tmy $cloud = git_populate_project_tagcloud(\\%ctags);\n\n-- \nShawn.\n"},{"id":"92986","messageId":"7vhc7g8257.fsf@gitster.siamese.dyndns.org","threadId":"15885","inReplyTo":"20081013234851.GY4856@spearce.org","subject":"Re: Puzzled by a t9500 test failure","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-10-14T00:13:24Z","receivedAt":"2008-10-14T00:13:24Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Shawn O. Pearce\" <spearce@spearce.org> writes:\n\n> Junio C Hamano <gitster@pobox.com> wrote:\n>> With recent tip of 'master':\n>> \n>>     $ make\n>>     $ mkdir t/trash\n>>     $ cd t && sh t9500-*.sh -i\n>> \n>> fails at the very first test.  Can anybody figure out why?\n>\n> Hmmph.  Near as I can tell its because gitweb.log has this in it:\n>\n> $ cat gitweb.log\n> [Mon Oct 13 23:43:36 2008] gitweb.perl: Use of uninitialized value in scalar chomp at /home/sop/local/maint-git/t/../gitweb/gitweb.perl line 1811.\n> [Mon Oct 13 23:43:36 2008] gitweb.perl: Use of uninitialized value in addition (+) at /home/sop/local/maint-git/t/../gitweb/gitweb.perl line 3772.\n> HASH..\n>\n> The test does a grep for '[[]' and if it matches, fails.  I'm not\n> sure why this started showing up now.  Obviously I merged something\n> that failed the test suite, but I was pretty sure I had run the full\n> set before publishing anything.\n\nNothing as far as I can tell changed while you were the pumpking.\n\nI was just wondering why the presense of that extra, should-be-unused,\nt/trash directory affects the outcome of the test.\n"},{"id":"92987","messageId":"20081014002246.GA4856@spearce.org","threadId":"15885","inReplyTo":"7vhc7g8257.fsf@gitster.siamese.dyndns.org","subject":"Re: Puzzled by a t9500 test failure","fromName":"Shawn O. Pearce","fromEmail":"spearce@spearce.org","sentAt":"2008-10-14T00:22:46Z","receivedAt":"2008-10-14T00:22:46Z","isPatch":false,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"Junio C Hamano <gitster@pobox.com> wrote:\n> \"Shawn O. Pearce\" <spearce@spearce.org> writes:\n> \n> > Junio C Hamano <gitster@pobox.com> wrote:\n> >> With recent tip of 'master':\n> >> \n> >>     $ make\n> >>     $ mkdir t/trash\n> >>     $ cd t && sh t9500-*.sh -i\n> >> \n> >> fails at the very first test.  Can anybody figure out why?\n> >\n> > Hmmph.  Near as I can tell its because gitweb.log has this in it:\n> >\n> > $ cat gitweb.log\n> > [Mon Oct 13 23:43:36 2008] gitweb.perl: Use of uninitialized value in scalar chomp at /home/sop/local/maint-git/t/../gitweb/gitweb.perl line 1811.\n> > [Mon Oct 13 23:43:36 2008] gitweb.perl: Use of uninitialized value in addition (+) at /home/sop/local/maint-git/t/../gitweb/gitweb.perl line 3772.\n> > HASH..\n> >\n> > The test does a grep for '[[]' and if it matches, fails.  I'm not\n> > sure why this started showing up now.  Obviously I merged something\n> > that failed the test suite, but I was pretty sure I had run the full\n> > set before publishing anything.\n> \n> Nothing as far as I can tell changed while you were the pumpking.\n> \n> I was just wondering why the presense of that extra, should-be-unused,\n> t/trash directory affects the outcome of the test.\n\nSeriously?\n\nOh.  Some time with strace later...\n\nIts because Perl totally borked the $projectroot path when it was\nlooking at $GIT_DIR/ctags.  $GIT_DIR has a space in the path and\nPerl bound the first aprt, opened it, but cannot open the second\npart of the $GIT_DIR/ctags string because it doesn't exist.\n\nThe code in question is the new tag cloud code in gitweb that\nPeter added.  So bisect is still correct.\n\nMy guess is its the code in git_get_project_ctags(), around\nl.1804-1816.\n\n-- \nShawn.\n"},{"id":"93050","messageId":"7v1vyi5vq7.fsf_-_@gitster.siamese.dyndns.org","threadId":"15885","inReplyTo":"20081014000812.GZ4856@spearce.org","subject":"[PATCH] Fix reading of cloud tags","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-10-15T04:27:12Z","receivedAt":"2008-10-15T04:27:12Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"The projectroot path could have SP in it, in which case iterating over\n<$git_dir/ctags/*> does not correctly enumerate the cloud tags files at\nall.\n\nThis can be observed by creating an empty t/trash directory and running\nt9500 test.  The $projectroot ends with \"trash directory.t9500-gitweb-/\"\nand <$glob> would give \"trash\", which can be opened and reading from it\nimmediately yields undef, which in turn gives an undef value warning to\nthe standard error stream upon attempt to chomp it.\n\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\n---\n gitweb/gitweb.perl |    4 +++-\n 1 files changed, 3 insertions(+), 1 deletions(-)\n\ndiff --git c/gitweb/gitweb.perl w/gitweb/gitweb.perl\nindex 1116800..577c041 100755\n--- c/gitweb/gitweb.perl\n+++ w/gitweb/gitweb.perl\n@@ -1805,7 +1805,8 @@ sub git_get_project_ctags {\n \tmy $ctags = {};\n \n \t$git_dir = \"$projectroot/$path\";\n-\tforeach (<$git_dir/ctags/*>) {\n+\topendir D, \"$git_dir/ctags\";\n+\tforeach (grep { -f $_ } map { \"$git_dir/ctags/$_\" } readdir(D)) {\n \t\topen CT, $_ or next;\n \t\tmy $val = <CT>;\n \t\tchomp $val;\n@@ -1813,6 +1814,7 @@ sub git_get_project_ctags {\n \t\tmy $ctag = $_; $ctag =~ s#.*/##;\n \t\t$ctags->{$ctag} = $val;\n \t}\n+\tclosedir D;\n \t$ctags;\n }\n \n"}]}