#!/usr/bin/perl # # takes git directories as arguments and runs git cherry inside # use warnings; use strict; use Cwd; my $ret; my $startdir = Cwd::cwd(); for my $dir (@ARGV) { chdir $startdir; next unless -d $dir; chdir $dir; # ignore non git repos system("git rev-parse &>/dev/null"); if (($? >> 8) == 0) { # ignore repos without remotes $ret = `git remote`; next if ($ret eq ""); $ret = `git cherry -v origin/master 2>&1`; if ($ret ne "") { print "$dir\n"; print $ret; } } }