forked from spacewalkproject/spacewalk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgit-untagged-commits.pl
executable file
·46 lines (41 loc) · 1.13 KB
/
git-untagged-commits.pl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/usr/bin/perl
use strict;
use warnings FATAL => 'all';
use File::Basename ();
my ($self_dir) = ($0 =~ m!(.*/)!);
if (not $self_dir) {
$self_dir = './';
}
my $cdup = `git rev-parse --show-cdup`;
if (defined $cdup) {
$cdup =~ s/\n.*//s;
}
my @files;
if (@ARGV) {
for my $name (@ARGV) {
my $path = "${self_dir}packages/$name";
if (-f $path) {
push @files, $path;
} else {
print STDERR "$name: file ${self_dir}packages/$name does not exist.\n";
}
}
} else {
@files = sort < ${self_dir}packages/* >;
}
for my $file (@files) {
local *FILE;
open FILE, $file or die "Error reading [$file]: $!\n";
my $line = <FILE>;
close FILE;
my $name = File::Basename::basename($file);
my ($version, $dir) = split /\s/, $line;
my @changes =
grep { not /^\S+\s([Bb]umping package versions for|%defattr is not needed since rpm 4\.4|Purging %changelog entries|replace legacy name of Tagger with new one|fixed tito build warning)/ }
`git log --pretty=format:'%h %s (%ae)' $name-$version..HEAD -- $cdup$dir`;
if (@changes) {
print "$name-$version..HEAD:\n";
print @changes, "\n";
print "------------------------------------------\n";
}
}