ssoma-mda: Use the email subject as the commit message
[ssoma.git] / ssoma-rm
blob05f2d668a9c2e63c316f04b4e809379fa88a543f
1 #!/usr/bin/perl -w
2 # Copyright (C) 2013, Eric Wong <normalperson@yhbt.net> and all contributors
3 # License: AGPLv3 or later (https://www.gnu.org/licenses/agpl-3.0.txt)
4 # this is intended for server administrators, so it takes an absolute
5 # path (however this may be run by clients, too).
6 my $usage = "ssoma-rm /path/to/git/repo < /path/to/rfc2822_message";
7 use strict;
8 use warnings;
9 use Ssoma::Git;
10 use Ssoma::Remover;
11 my $dir = shift or die "usage: $usage\n";
12 my $git = Ssoma::Git->new($dir);
13 my $rm = Ssoma::Remover->new($git);
14 my $simple;
16 local $/; # slurp message from stdin
17 $simple = Email::Simple->new(<>);
19 $rm->remove_simple($simple);