mirror of
https://github.com/Perl/perl5.git
synced 2026-01-26 08:38:23 +00:00
When porting/makerel runs, all files copied into the directory for the tarball have the executable bit stripped and then only a specific set of files have the executable bit restored. There are many files in the repo that have the executable bit set in the repo that will be stripped. So that the state of files in the repo is as close as possible to the state of files in the release tarball, the executable bit has been stripped from such files. In one recent case, a file added from a dual-life module needed the executable bit set. Because it had the bit in the repo but was not listed in makerel to get an executable bit, tests using it passed in the repo and failed in the tarball. This commit refactors the list into a new file, Porting/exec-bit.txt and add tests to detect a mismatch between files listed there and actual executable bits in the repo.
37 lines
905 B
Perl
37 lines
905 B
Perl
#!/usr/bin/perl
|
|
|
|
# given a perforce change number, output the equivalent git commit id
|
|
# with -c, checks out the specified commit
|
|
|
|
die "usage: $0 [-c|--checkout] [git-log-options] changenum" unless @ARGV;
|
|
|
|
my $num = 1;
|
|
my $checkout = 0;
|
|
|
|
my $before = '--before=2008-12-18'; # only changes made under perforce
|
|
|
|
for (@ARGV) {
|
|
m{^\d+$} && (($change,$_) = ($_,undef));
|
|
m{^-\d+$} && (($num,$_) = (-$_,undef));
|
|
$_ eq '-c' || $_ eq '--checkout'
|
|
and $checkout = 1;
|
|
}
|
|
|
|
my $grep = "--grep=^p4raw-id:.*\@$change\$";
|
|
@ARGV = grep { defined } @ARGV;
|
|
|
|
if ($checkout) {
|
|
my $commit = qx(git rev-list -1 --all $before '$grep');
|
|
chomp $commit;
|
|
die "no commit found" unless $commit;
|
|
system(git => checkout => $commit);
|
|
}
|
|
else {
|
|
if ( -t STDOUT or @ARGV ) {
|
|
system(qw(git log), $grep, "-$num", "--all", $before, @ARGV);
|
|
}
|
|
else {
|
|
system(qw(git rev-list -1 --all), $before, $grep);
|
|
}
|
|
}
|