Skip to content

Instantly share code, notes, and snippets.

@mmcclimon
Created July 5, 2023 01:03
Show Gist options
  • Save mmcclimon/9410bfa7ef7d4302edd3bb49414f0b88 to your computer and use it in GitHub Desktop.
Save mmcclimon/9410bfa7ef7d4302edd3bb49414f0b88 to your computer and use it in GitHub Desktop.
goofy program: git log, but with sign-off lines
#!/usr/bin/env perl
use strict;
use warnings;
use utf8;
binmode STDOUT, ':encoding(UTF-8)';
open my $git, '-|', (
'git',
'log',
'--color=always',
@ARGV,
'--pretty=tformat:%(trailers:key=Signed-off-by,keyonly=yes,separator=+) %C(auto)%h%d %s',
) or die "bad pipe: $!";
while (my $line = <$git>) {
my ($signoff, $hash, $rest) = split / /, $line, 3;
my $key = $signoff ? '✓' : '¿';
print "$key $hash $rest";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment