]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blob - debian/scripts/misc/retag
UBUNTU: [Packaging] resync git-ubuntu-log
[mirror_ubuntu-bionic-kernel.git] / debian / scripts / misc / retag
1 #!/usr/bin/perl -w
2
3 open(TAGS, "git tag -l |") or die "Could not get list of tags";
4 @tags = <TAGS>;
5 close(TAGS);
6
7 open(LOGS, "git log --pretty=short |") or die "ERROR: Calling git log";
8 my $commit = "";
9
10 while (<LOGS>) {
11 my $origtag;
12
13 if (m|^commit (.*)$|) {
14 $commit = $1;
15 next;
16 }
17
18 m|\s*UBUNTU: (Ubuntu-2\.6\..*)| or next;
19
20 $tag = $1;
21
22 ($origtag) = grep(/^$tag.orig$/, @tags);
23
24 if (!defined($origtag)) {
25 print "I: Adding original tag for $tag\n";
26 system("git tag -m $tag $tag.orig $tag");
27 }
28
29 print "I: Tagging $tag => $commit\n";
30
31 system("git tag -f -m $tag $tag $commit");
32 }
33
34 close(LOGS);