Skip to content

Instantly share code, notes, and snippets.

@fukata
Last active December 12, 2015 05:08
Show Gist options
  • Save fukata/4719609 to your computer and use it in GitHub Desktop.
Save fukata/4719609 to your computer and use it in GitHub Desktop.
All git branches last commit author.
#!/usr/bin/env perl
use strict;
use warnings;
use utf8;
{
my @lines = `git branch -rv`;
foreach my $line ( @lines ) {
chomp $line;
my ( $branch, $commit, @messages ) = split ' ', $line;
my $msg = join ' ', @messages;
next unless $commit =~ qr/^[0-9a-zA-Z]+$/;
my @show_lines = `git show --format=format:%an $commit`;
chomp( my $author = $show_lines[0] );
print "branch: $branch, author: $author, msg: $msg, commit: $commit\n";
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment