summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2021-02-24 17:12:37 -0700
committerSean Whitton <spwhitton@spwhitton.name>2021-02-24 17:12:37 -0700
commit89c16802fe2b76d5261941860aad160ff4fcd911 (patch)
tree172a7e14383a67efcc85f112cf1f771df3cf7d76 /scripts
parent6c4d75bfa31f4b45f26294590b69093a5653b576 (diff)
downloaddotfiles-89c16802fe2b76d5261941860aad160ff4fcd911.tar.gz
add fill-missing-signoffs-since
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/git/fill-missing-signoffs-since34
1 files changed, 34 insertions, 0 deletions
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'
+# });