Permalink
Find file
Fetching contributors…
Cannot retrieve contributors at this time
executable file 25 lines (19 sloc) 612 Bytes
#!/usr/bin/env perl
use strict;
use warnings;
use Cwd qw(realpath);
use File::Basename;
my $BASE_DIR = dirname realpath __FILE__;
my @branches = `git branch -a | cut -c3-`;
chomp @branches;
for my $branch (@branches) {
next
unless $branch =~ /\@/;
my ($base_branch, $rev) = split /\@/, $branch, 2;
($rev) = `git cat-file commit $branch` =~ /\bgit-svn-id: [^@]+\@(\d+)/;
my $result = `git log -E --grep='git-svn-id: .*\@$rev' $base_branch`;
if ($result =~ /\S/) {
# found rev in base branch, this one is useless
system "$BASE_DIR/kill-svn-branch $branch";
}
}