ssoma-mda: Use the email subject as the commit message
[ssoma-mda.git] / ssoma-rm
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;
15 {
16         local $/; # slurp message from stdin
17         $simple = Email::Simple->new(<>);
18 };
19 $rm->remove_simple($simple);