7 my ($branches, $fname) = @_;
9 # requires perl 5.8. Avoids shell issues if we ever get a changes
10 # file named by the parents of Little Johnny Tables.
11 open F
, "-|", "git", "log", "--pretty=format:%H", $branches, "--", $fname
14 return scalar @changes
17 my $look_for_type = "merged";
22 findMergedChanges.pl [--merged/--unmerged/--weird/--list] changes/*
24 A change is "merged" if it has ever been merged to release-0.2.2 and it has had
25 no subsequent changes in master.
27 A change is "unmerged" if it has never been merged to release-0.2.2 and it
28 has had changes in master.
30 A change is "weird" if it has been merged to release-0.2.2 and it *has* had
31 subsequent changes in master.
33 Suggested application:
34 findMergedChanges.pl --merged changes/* | xargs -n 1 git rm
39 while (@ARGV and $ARGV[0] =~ /^--/) {
40 my $flag = shift @ARGV;
41 if ($flag =~ /^--(weird|merged|unmerged|list)/) {
44 die "Unrecognized flag $flag";
48 for my $changefile (@ARGV) {
49 my $n_merged = nChanges
("origin/release-0.2.2", $changefile);
50 my $n_postmerged = nChanges
("origin/release-0.2.2..origin/master", $changefile);
53 if ($n_merged != 0 and $n_postmerged == 0) {
55 } elsif ($n_merged == 0 and $n_postmerged != 0) {
61 if ($type eq $look_for_type) {
62 print "$changefile\n";
63 } elsif ($look_for_type eq 'list') {
64 printf "% 8s: %s\n", $type, $changefile;