Tommy[D] reported this on #gentoo-infra a few days ago. I could not reproduce it, as the code should always have it defined. remote: Warning: Use of uninitialized value $field in string eq at ./hooks/post-receive.gentoo-commits line 374. remote: Warning: Use of uninitialized value $field in string eq at ./hooks/post-receive.gentoo-commits line 389. remote: Warning: Use of uninitialized value $field in string eq at ./hooks/post-receive.gentoo-commits line 389. remote: Warning: Use of uninitialized value $field in hash element at ./hooks/post-receive.gentoo-commits line 414. remote: Warning: Use of uninitialized value $field in string eq at ./hooks/post-receive.gentoo-commits line 374. remote: Warning: Use of uninitialized value $field in string eq at ./hooks/post-receive.gentoo-commits line 389. remote: Warning: Use of uninitialized value $field in string eq at ./hooks/post-receive.gentoo-commits line 389. remote: Warning: Use of uninitialized value $field in hash element at ./hooks/post-receive.gentoo-commits line 414.
I added a detection block in cfengine.git:6dba36f and cfengine.git:70f09bb that asks users to report it here.
Here's the original problematic code, before the warning per comment #1 was made, which shifted the lines after line 373 by +3 lines. 368) foreach my $line (split("\n", $rawcommit)) { 369) if($inheader eq 1) { 370) if ($line or length($line) > 0) { 371) my @fields = split(/\s+/, $line); 372) my $field = shift(@fields); 373) 374) if ($inpgpsig || $field eq "gpgsig") { ... 387) } 388) 389) if($field eq "author" or $field eq "committer") { ... 412) } 413) else { 414) $data{$field} = join(" ", @fields); 415) }
mrueg reports it happened on this commit: https://gitweb.gentoo.org/user/mrueg.git/commit/?id=aa6d4f2525dfc4e84b50592f17795e8e4b5993d3
Mrueg's comment triggered the warning output of: Warning: $field is undefined, input line was ' ';
I added a more detailed error output, as well as a possible fix, if the problem lies in the gpgsig header. Testing welcomed after the change is deployed by cfengine (give it 45 minutes for good measure, so say after 2015/05/07 23:00 UTC).
Ok, it was inside the gpgsig header, which can legitimately contain otherwise blank lines with leading whitespace. Thanks for helping debug. There is a fix in place for it now.
seems like this was not completly fixed, got the messages again after merging tags 2.2.19 to 2.2.22 into the multilib branch of portage and pushing that: git push Zähle Objekte: 48, Fertig. Delta compression using up to 8 threads. Komprimiere Objekte: 100% (48/48), Fertig. Schreibe Objekte: 100% (48/48), 20.28 KiB | 0 bytes/s, Fertig. Total 48 (delta 35), reused 0 (delta 0) remote: Warning: $field is undefined, input line (#10) was '', previous field was ' '; please report the repo & commitid to Gentoo bug #548876 remote: Warning: Use of uninitialized value $field in string eq at ./hooks/post-receive.gentoo-commits line 391. remote: Warning: Use of uninitialized value $field in string eq at ./hooks/post-receive.gentoo-commits line 406. remote: Warning: Use of uninitialized value $field in string eq at ./hooks/post-receive.gentoo-commits line 406. remote: Warning: Use of uninitialized value $field in hash element at ./hooks/post-receive.gentoo-commits line 431. remote: Warning: $field is undefined, input line (#14) was '', previous field was ' '; please report the repo & commitid to Gentoo bug #548876 remote: Warning: Use of uninitialized value $field in string eq at ./hooks/post-receive.gentoo-commits line 391. remote: Warning: Use of uninitialized value $field in string eq at ./hooks/post-receive.gentoo-commits line 406. remote: Warning: Use of uninitialized value $field in string eq at ./hooks/post-receive.gentoo-commits line 406. remote: Warning: Use of uninitialized value $field in hash element at ./hooks/post-receive.gentoo-commits line 431. remote: Warning: $field is undefined, input line (#10) was '', previous field was ' '; please report the repo & commitid to Gentoo bug #548876 remote: Warning: Use of uninitialized value $field in string eq at ./hooks/post-receive.gentoo-commits line 391. remote: Warning: Use of uninitialized value $field in string eq at ./hooks/post-receive.gentoo-commits line 406. remote: Warning: Use of uninitialized value $field in string eq at ./hooks/post-receive.gentoo-commits line 406. remote: Warning: Use of uninitialized value $field in hash element at ./hooks/post-receive.gentoo-commits line 431. remote: Warning: $field is undefined, input line (#14) was '', previous field was ' '; please report the repo & commitid to Gentoo bug #548876 remote: Warning: Use of uninitialized value $field in string eq at ./hooks/post-receive.gentoo-commits line 391. remote: Warning: Use of uninitialized value $field in string eq at ./hooks/post-receive.gentoo-commits line 406. remote: Warning: Use of uninitialized value $field in string eq at ./hooks/post-receive.gentoo-commits line 406. remote: Warning: Use of uninitialized value $field in hash element at ./hooks/post-receive.gentoo-commits line 431. remote: Warning: $field is undefined, input line (#10) was '', previous field was ' '; please report the repo & commitid to Gentoo bug #548876 remote: Warning: Use of uninitialized value $field in string eq at ./hooks/post-receive.gentoo-commits line 391. remote: Warning: Use of uninitialized value $field in string eq at ./hooks/post-receive.gentoo-commits line 406. remote: Warning: Use of uninitialized value $field in string eq at ./hooks/post-receive.gentoo-commits line 406. remote: Warning: Use of uninitialized value $field in hash element at ./hooks/post-receive.gentoo-commits line 431. remote: Warning: $field is undefined, input line (#14) was '', previous field was ' '; please report the repo & commitid to Gentoo bug #548876 remote: Warning: Use of uninitialized value $field in string eq at ./hooks/post-receive.gentoo-commits line 391. remote: Warning: Use of uninitialized value $field in string eq at ./hooks/post-receive.gentoo-commits line 406. remote: Warning: Use of uninitialized value $field in string eq at ./hooks/post-receive.gentoo-commits line 406. remote: Warning: Use of uninitialized value $field in hash element at ./hooks/post-receive.gentoo-commits line 431. remote: Warning: $field is undefined, input line (#10) was '', previous field was ' '; please report the repo & commitid to Gentoo bug #548876 remote: Warning: Use of uninitialized value $field in string eq at ./hooks/post-receive.gentoo-commits line 391. remote: Warning: Use of uninitialized value $field in string eq at ./hooks/post-receive.gentoo-commits line 406. remote: Warning: Use of uninitialized value $field in string eq at ./hooks/post-receive.gentoo-commits line 406. remote: Warning: Use of uninitialized value $field in hash element at ./hooks/post-receive.gentoo-commits line 431. remote: Warning: $field is undefined, input line (#14) was '', previous field was ' '; please report the repo & commitid to Gentoo bug #548876 remote: Warning: Use of uninitialized value $field in string eq at ./hooks/post-receive.gentoo-commits line 391. remote: Warning: Use of uninitialized value $field in string eq at ./hooks/post-receive.gentoo-commits line 406. remote: Warning: Use of uninitialized value $field in string eq at ./hooks/post-receive.gentoo-commits line 406. remote: Warning: Use of uninitialized value $field in hash element at ./hooks/post-receive.gentoo-commits line 431. remote: Warning: $field is undefined, input line (#10) was '', previous field was ' '; please report the repo & commitid to Gentoo bug #548876 remote: Warning: Use of uninitialized value $field in string eq at ./hooks/post-receive.gentoo-commits line 391. remote: Warning: Use of uninitialized value $field in string eq at ./hooks/post-receive.gentoo-commits line 406. remote: Warning: Use of uninitialized value $field in string eq at ./hooks/post-receive.gentoo-commits line 406. remote: Warning: Use of uninitialized value $field in hash element at ./hooks/post-receive.gentoo-commits line 431. remote: Warning: $field is undefined, input line (#14) was '', previous field was ' '; please report the repo & commitid to Gentoo bug #548876 remote: Warning: Use of uninitialized value $field in string eq at ./hooks/post-receive.gentoo-commits line 391. remote: Warning: Use of uninitialized value $field in string eq at ./hooks/post-receive.gentoo-commits line 406. remote: Warning: Use of uninitialized value $field in string eq at ./hooks/post-receive.gentoo-commits line 406. remote: Warning: Use of uninitialized value $field in hash element at ./hooks/post-receive.gentoo-commits line 431. To git+ssh://git@git.gentoo.org/proj/portage.git cf7284c..0c879b9 multilib -> multilib
Ok, I reproduced the remaining error case. It's specifically caused by doing a non-fast-forward merge of a SIGNED tag, which adds a 'mergetag' block to the raw commit. The body of that block starts with lines with a leading space. We need to put together a better parser for the raw commits, one that handles continued lines properly
Any status update for this? I am still getting those warnings, when merging commits into the multilib branch of portage: remote: Warning: $field is undefined, input line (#10) was '', previous field was ' '; please report the repo & commitid to Gentoo bug #548876 remote: Warning: Use of uninitialized value $field in string eq at hooks/post-receive.h01-gentoo-commits line 395. remote: Warning: Use of uninitialized value $field in string eq at hooks/post-receive.h01-gentoo-commits line 410. remote: Warning: Use of uninitialized value $field in string eq at hooks/post-receive.h01-gentoo-commits line 410. remote: Warning: Use of uninitialized value $field in hash element at hooks/post-receive.h01-gentoo-commits line 435. remote: Warning: $field is undefined, input line (#14) was '', previous field was ' '; please report the repo & commitid to Gentoo bug #548876 remote: Warning: Use of uninitialized value $field in string eq at hooks/post-receive.h01-gentoo-commits line 395. remote: Warning: Use of uninitialized value $field in string eq at hooks/post-receive.h01-gentoo-commits line 410. remote: Warning: Use of uninitialized value $field in string eq at hooks/post-receive.h01-gentoo-commits line 410. remote: Warning: Use of uninitialized value $field in hash element at hooks/post-receive.h01-gentoo-commits line 435.
% cvs push Enumerating objects: 6, done. Counting objects: 100% (6/6), done. Delta compression using up to 3 threads. Compressing objects: 100% (4/4), done. Writing objects: 100% (4/4), 967 bytes | 241.00 KiB/s, done. Total 4 (delta 2), reused 0 (delta 0) remote: Warning: $field is undefined, input line (#16) was '', previous field was ' '; please report the repo & commitid to Gentoo bug #548876 remote: Warning: Use of uninitialized value $field in string eq at hooks/post-receive.h01-gentoo-commits line 395. remote: Warning: Use of uninitialized value $field in string eq at hooks/post-receive.h01-gentoo-commits line 410. remote: Warning: Use of uninitialized value $field in string eq at hooks/post-receive.h01-gentoo-commits line 410. remote: Warning: Use of uninitialized value $field in hash element at hooks/post-receive.h01-gentoo-commits line 435. To git+ssh://git.gentoo.org/proj/portage-utils.git c73ba1a..223d945 master -> master I was pushing a merge commit made by GitHub from a PR, perhaps that that introduces something weird.