summaryrefslogtreecommitdiffstats
path: root/gitmirror/filter-branches.pl
blob: 81588cfbb8a408528795a58cd1eea333a5b24444 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/usr/bin/perl
open(GIT, "-|", "git branch -r") or die;
%branches = ();
while (<GIT>) {
    chomp;
    next if (!m:^[ \*] origin/:);
    s:^[ \*] origin/::;
    next if (/ \-\> /);
    next if (/^\s*(\#.*|)$/);
    next if (/^(HEAD|build)$/);
    next if (/^auto-/);
    next if (/^tmp-/);
    next if (/^[^\/]+\/base-/);
    $branches{$_}++;
}
close(GIT);
foreach $b (sort(keys(%branches))) {
    print $b, "\n";
}