All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Shawn O. Pearce" <spearce@spearce.org>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org, Petr Baudis <pasky@suse.cz>
Subject: Re: Puzzled by a t9500 test failure
Date: Mon, 13 Oct 2008 17:08:12 -0700	[thread overview]
Message-ID: <20081014000812.GZ4856@spearce.org> (raw)
In-Reply-To: <20081013234851.GY4856@spearce.org>

"Shawn O. Pearce" <spearce@spearce.org> wrote:
> Junio C Hamano <gitster@pobox.com> wrote:
> > With recent tip of 'master':
> > 
> >     $ make
> >     $ mkdir t/trash
> >     $ cd t && sh t9500-*.sh -i
> > 
> > fails at the very first test.  Can anybody figure out why?
> 
> Hmmph.  Near as I can tell its because gitweb.log has this in it:
> 
> $ cat gitweb.log
> [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.
> [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.
> HASH..

bisect says its aed93de428d7d12ee23d84d27265af1e37eb348f,
"gitweb: Support for tag clouds".

This appears to fix it.  As for how I missed this, I do not know.
I usually tested topic branches pretty heavily before merging them
to next, and I tested both master and next daily.  So I thought
the topic was ready to merge into master.  Apparently it was not.
How I missed the failed merge, I don't know. :-\

diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index 1116800..793166e 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -1808,7 +1808,7 @@ sub git_get_project_ctags {
 	foreach (<$git_dir/ctags/*>) {
 		open CT, $_ or next;
 		my $val = <CT>;
-		chomp $val;
+		chomp $val if defined $val;
 		close CT;
 		my $ctag = $_; $ctag =~ s#.*/##;
 		$ctags->{$ctag} = $val;
@@ -1822,7 +1822,11 @@ sub git_populate_project_tagcloud {
 	# First, merge different-cased tags; tags vote on casing
 	my %ctags_lc;
 	foreach (keys %$ctags) {
-		$ctags_lc{lc $_}->{count} += $ctags->{$_};
+		if (defined ($ctags_lc{lc $_}->{count})) {
+			$ctags_lc{lc $_}->{count} += $ctags->{$_};
+		} else {
+			$ctags_lc{lc $_}->{count} = $ctags->{$_};
+		}
 		if (not $ctags_lc{lc $_}->{topcount}
 		    or $ctags_lc{lc $_}->{topcount} < $ctags->{$_}) {
 			$ctags_lc{lc $_}->{topcount} = $ctags->{$_};
@@ -3769,7 +3773,11 @@ sub git_project_list_body {
 		my %ctags;
 		foreach my $p (@projects) {
 			foreach my $ct (keys %{$p->{'ctags'}}) {
-				$ctags{$ct} += $p->{'ctags'}->{$ct};
+				if (defined $ctags{$ct}) {
+					$ctags{$ct} += $p->{'ctags'}->{$ct};
+				} else {
+					$ctags{$ct} = $p->{'ctags'}->{$ct};
+				}
 			}
 		}
 		my $cloud = git_populate_project_tagcloud(\%ctags);

-- 
Shawn.

  reply	other threads:[~2008-10-14  0:09 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-13 23:40 Puzzled by a t9500 test failure Junio C Hamano
2008-10-13 23:48 ` Shawn O. Pearce
2008-10-14  0:08   ` Shawn O. Pearce [this message]
2008-10-15  4:27     ` [PATCH] Fix reading of cloud tags Junio C Hamano
2008-10-14  0:13   ` Puzzled by a t9500 test failure Junio C Hamano
2008-10-14  0:22     ` Shawn O. Pearce

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20081014000812.GZ4856@spearce.org \
    --to=spearce@spearce.org \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=pasky@suse.cz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.