Created
July 5, 2023 01:03
-
-
Save mmcclimon/9410bfa7ef7d4302edd3bb49414f0b88 to your computer and use it in GitHub Desktop.
goofy program: git log, but with sign-off lines
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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