summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/util/list_merged_branches.pl
diff options
context:
space:
mode:
authorRaphael Langella <raphael.langella@gmail.com>2011-08-26 08:14:54 +0000
committerRaphael Langella <raphael.langella@gmail.com>2011-08-28 00:27:48 +0200
commit8a05b7378f9954cf2ac353234c9cf62c4f7e5d08 (patch)
treeca1706f21817f2c4a430ceabdeb40bac0b49c0ed /crawl-ref/source/util/list_merged_branches.pl
parent0f49582547d066a3b3ac1a75dd465665f1c7bca4 (diff)
downloadcrawl-ref-8a05b7378f9954cf2ac353234c9cf62c4f7e5d08.tar.gz
crawl-ref-8a05b7378f9954cf2ac353234c9cf62c4f7e5d08.zip
A little script for listing remote branches which have been merged.
Diffstat (limited to 'crawl-ref/source/util/list_merged_branches.pl')
-rwxr-xr-xcrawl-ref/source/util/list_merged_branches.pl25
1 files changed, 25 insertions, 0 deletions
diff --git a/crawl-ref/source/util/list_merged_branches.pl b/crawl-ref/source/util/list_merged_branches.pl
new file mode 100755
index 0000000000..5f9789deee
--- /dev/null
+++ b/crawl-ref/source/util/list_merged_branches.pl
@@ -0,0 +1,25 @@
+#!/usr/bin/perl
+
+%remote_branches;
+%merged_branches;
+
+open (REMOTE, "git branch -a|");
+while (<REMOTE>)
+{
+ my ($branch) = /remotes\/origin\/(.*)$/;
+ $remote_branches{$branch} = 1;
+}
+close REMOTE;
+
+open(LOG, "git log master|");
+while (<LOG>)
+{
+ my $branch;
+ next unless (($branch) = /Merge branch '(.*)'/);
+ next if ($branch eq "master");
+ next unless ($remote_branches{$branch});
+ next if ($merged_branches{$branch});
+ $merged_branches{$branch} = 1;
+ print "$branch\n";
+}
+close LOG;