sub norm_commit_message { my $msg = shift; $msg =~ s/^commit .*?$//gm; $msg =~ s/^Date:.*?$//gm; $msg =~ s/^ Signed-off-by: .*?$//gm; $msg =~ s/^.*?cherry picked from commit.*?$//gm; $msg =~ s/^\s+$//gm; $msg =~ s/^ git-svn-id.*?$//gm; return $msg; } my %rel_2_0_commits = map { norm_commit_message($_) => 1 } (split /\000/, `git log -z origin/rel_2_0`); foreach my $commit (split /\000/, `git log -z origin/rel_2_0..origin/rel_2_1`) { unless (exists $rel_2_0_commits{norm_commit_message($commit)}) { $commit =~ s/\000//; print $commit, "\n"; } }