From 89c16802fe2b76d5261941860aad160ff4fcd911 Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Wed, 24 Feb 2021 17:12:37 -0700 Subject: add fill-missing-signoffs-since --- scripts/git/fill-missing-signoffs-since | 34 +++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100755 scripts/git/fill-missing-signoffs-since (limited to 'scripts') diff --git a/scripts/git/fill-missing-signoffs-since b/scripts/git/fill-missing-signoffs-since new file mode 100755 index 00000000..35612cc7 --- /dev/null +++ b/scripts/git/fill-missing-signoffs-since @@ -0,0 +1,34 @@ +#!/usr/bin/perl + +# fill-missing-signoffs-since -- fill in missing Signed-off-by: lines + +use 5.032; +use strict; +use warnings; + +use File::Basename "basename"; +use Git::Wrapper; +use Try::Tiny; + +@ARGV == 1 or die "usage: " . basename $0 . " COMMITTISH\n"; +my $since = shift; +my $git = Git::Wrapper->new("."); +#<<< +try { + $git->rev_parse({ git_dir => 1 }); +} catch { + die "pwd doesn't look like a git repository ..\n"; +}; +# #>>> + +my ($name) = $git->config(qw(user.name)); +my ($email) = $git->config(qw(user.email)); +# TODO implement the "since" part of this -- the following does the entire +# repo history, rather than commits in the range $since..HEAD +# $git->filter_repo({ +# message_callback => ' +# if b"Signed-off-by:" not in message: +# message = message.rstrip() +# message += b"\n\nSigned-off-by: ' . $name . ' <' . $email . '>\n" +# return message' +# }); -- cgit v1.2.3