]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/blob - doc/news/code_swarm/code_swarm_log.pl
Don't send relative redirect URLs when behind a reverse proxy
[git.ikiwiki.info.git] / doc / news / code_swarm / code_swarm_log.pl
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;
7 my $sep='-' x 72;
8 $/=$sep."\n";
10 my %config=IkiWiki::defaultconfig();
12 foreach (`git-log --name-status --pretty=format:'%n$sep%nr%h | %an | %ai (%aD) | x lines%n%nsubject: %s%n'`) {
13         my ($subject)=m/subject: (.*)\n/m;
14         if ($subject=~m/$config{web_commit_regexp}/) {
15                 my $user = defined $2 ? "$2" : "$3";
16                 my $oiduser = IkiWiki::openiduser($user);
17                 if (defined $oiduser) {
18                         $oiduser=~s/ \[.*\]//; # too much clutter for code_swarm
19                         $user=$oiduser;
20                 }
21                 s/ \| [^|]+ \| / | $user | /;
22         }
23         s/subject: (.*)\n\n//m;
24         print;
25 }