summaryrefslogtreecommitdiff
path: root/doc/news/code_swarm/code_swarm_log.pl
blob: 25e0a67b0c5da6f32757d6579ff72df3682b80bb (plain)
  1. #!/usr/bin/perl
  2. # Munge a git log into log for code_swarm.
  3. # Deals with oddities of ikiwiki commits, like web commits, and openids.
  4. use IkiWiki;
  5. use IkiWiki::Plugin::openid;
  6. my $sep='-' x 72;
  7. $/=$sep."\n";
  8. my %config=IkiWiki::defaultconfig();
  9. foreach (`git-log --name-status --pretty=format:'%n$sep%nr%h | %an | %ai (%aD) | x lines%n%nsubject: %s%n'`) {
  10. my ($subject)=m/subject: (.*)\n/m;
  11. if ($subject=~m/$config{web_commit_regexp}/) {
  12. my $user = defined $2 ? "$2" : "$3";
  13. my $oiduser = IkiWiki::openiduser($user);
  14. if (defined $oiduser) {
  15. $oiduser=~s/ \[.*\]//; # too much clutter for code_swarm
  16. $user=$oiduser;
  17. }
  18. s/ \| [^|]+ \| / | $user | /;
  19. }
  20. s/subject: (.*)\n\n//m;
  21. print;
  22. }