4 # This uses Porting/checkAUTHORS.pl to check that any pending commit isn't
5 # about to break t/porting/authors.t
8 # t/porting/authors.t checks that the AUTHORS file is up to date, accounting
9 # for the "Author:" of every commit. However, any pending changes can't be
10 # tested, which leaves a gotcha - "make test" can pass, one then commits
11 # the passing code, pushes it uptream, and tests fail. So this test attempts
12 # to spot that problem before it happens, where it can.
14 # It's broken - how do I fix it?
15 # It will fail if you're in a git checkout, have uncommitted changes, and the
16 # e-mail address that your commit will default to is in AUTHORS, or the list
17 # of author aliases in Porting/checkAUTHORS.pl. So one of
18 # a) reset your pending changes
19 # b) change your git config user.email to the previously-known e-mail address
20 # c) add yourself to AUTHORS
21 # d) add an alias to Porting/checkAUTHORS.pl
24 @INC = '..' if -f '../TestInit.pm';
26 use TestInit qw(T); # T is chdir to the top level
31 find_git_or_skip('all');
33 my $devnull = File::Spec->devnull;
35 foreach (`git status --porcelain 2>$devnull`) {
41 skip_all("No pending changes (or git status --porcelain doesn't work here)")
46 my $value = `git config --get user.$key`;
47 unless (defined $value && $value =~ /\S/) {
48 skip_all("git config --get user.$key returned nought");
54 my $email = get('email');
55 my $name = get('name');
57 open my $fh, '|-', "$^X Porting/checkAUTHORS.pl --tap -"
59 print $fh "Author: $name <$email>\n";