]>
git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/blob - debian/scripts/misc/git-ubuntu-log
2967d875bd64b8ef660eace07186674955139f04
6 my $kernel_auth = "Upstream Kernel Changes";
17 if ($opt eq "--no-kern-log") {
19 } elsif ($opt eq "--print-shas") {
22 print STDERR
"Unknown options: $opt\n";
27 sub check_reverts
($) {
31 foreach $check (reverse @reverts) {
32 my $desc = "Revert \"" . $entry->{'desc'} . "\"";
33 if ($check->{'desc'} eq $desc) {
34 @reverts = grep($_->{'desc'} ne $desc, @reverts);
44 my $key = $entry->{'author'};
46 # store description in array, in email->{desc list} map
47 if (exists $map{$key}) {
54 # create new array, containing 1 item
62 sub shortlog_entry
($$$$$) {
63 my ($name, $desc, $bug, $cve, $commit) = @_;
66 $desc =~ s
#/pub/scm/linux/kernel/git/#/.../#g;
67 $desc =~ s
#\[PATCH\] ##g;
70 $desc =~ s
# *UBUNTU: ##g;
72 $entry->{'desc'} = $desc;
74 $entry->{'bugno'} = $bug;
76 $entry->{'cve'} = $cve;
77 $entry->{'commit'} = $commit;
78 $entry->{'author'} = $name;
80 if ($desc =~ /^Revert "/) {
81 push(@reverts, $entry);
85 return if check_reverts
($entry);
90 # sort comparison function
98 my ($obj, $key, $entry);
100 foreach $key (sort by_name
keys %map) {
101 next if $key eq $kernel_auth and $no_kern_log;
103 print "\n" unless $first_print;
107 printf " [ %s ]\n\n", $key;
109 # output author's 1-line summaries
111 foreach $entry (reverse @$obj) {
112 print wrap
(" * ", " ", $entry->{'desc'}) . "\n";
113 # For non upstream changes, add other info.
114 if ($key ne $kernel_auth) {
116 print " - GIT-SHA " . $entry->{'commit'} .
120 if (defined($entry->{'bugno'})) {
121 print " - LP: #" . $entry->{'bugno'} . "\n";
123 if (defined($entry->{'cve'})) {
124 print " - " . $entry->{'cve'} . "\n";
130 sub changelog_input
{
131 my ($author, $desc, $commit, $entry, $cve);
136 next unless /^commit (.*)/;
143 # get author and email
144 elsif ($pstate == 2) {
147 next unless /^[Aa]uthor:?\s*(.*?)\s*<(.*)>/;
162 elsif ($pstate == 3) {
167 # skip to non-blank line
168 elsif ($pstate == 4) {
169 next unless /^\s*?(.*)/;
176 # skip lines that are obviously not
177 # a 1-line cset description
178 next if /^\s*From: /;
183 if ($desc =~ /^ *(Revert "|)UBUNTU:/) {
187 $author = $kernel_auth;
188 $ignore = 1 if $desc =~ /Merge /;
191 $ignore = 1 if ($do_ignore && /^ *Ignore: yes/i);
192 if (/^ *Bug: *(#|)([0-9#,\s]*)\s*$/i) {
193 foreach $k (split('(,|\s)\s*(#|)', $2)) {
194 $bugz{$k} = 1 if (($k ne '') and ($k =~ /[0-9]+/));
197 elsif (/^ *BugLink: *http.*:\/\
/.*\/([0-9]+)/i
) {
200 elsif (/^ *(CVE-.*)/) {
206 $bug = join(", #", sort keys(%bugz));
208 &shortlog_entry
($author, $desc, $bug,
213 if ($_ && /^commit (.*)/) {
220 die "invalid parse state $pstate";
224 foreach $entry (@reverts) {