Permalink
Browse files

[4] Implemented function to parse `git log` command

Signed-off-by: DoesntMatter <jaed1@gmx.net>
  • Loading branch information...
DoesntMatter committed Jan 21, 2012
1 parent 9220f24 commit 7c4c8e41280872c2048570008877817a6a32d31c
Showing with 24 additions and 0 deletions.
  1. +24 −0 gitlog_to_rss.pl
View
@@ -24,6 +24,7 @@
use Cwd;
my %options;
my $gitlog;
#
# Get options
@@ -62,6 +63,16 @@
$options{'outfile'} = cwd();
}
#
# Do the job
#
$gitlog = ParseGitLog($options{'repo'});
unless ($gitlog) {
print "Parsing `git log` command failed!\n";
exit;
}
exit;
#
@@ -81,3 +92,16 @@ sub ShowHelp {
exit;
};
sub ParseGitLog {
my $repo = shift || return undef;
my $cmd = "git log --pretty=tformat:%H%n%ct%n%cn%n%ce%n%B%m $repo";
my $result;
$result = qx/$cmd/;
if ($? == -1) {
print "Command failed: $!\n";
return undef;
}
return $result;
}

0 comments on commit 7c4c8e4

Please sign in to comment.