Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Create initial script to generate Thanks list

  • Loading branch information...
commit 79749c238bae6b50bfae3d6de24699ebd1942d43 1 parent 40754ad
@choptastic choptastic authored
Showing with 60 additions and 0 deletions.
  1. +4 −0 Makefile
  2. +56 −0 support/list_thanks/list_thanks.pl
View
4 Makefile
@@ -11,6 +11,7 @@ help:
@echo " ./make {rel_mochiweb|package_mochiweb}"
@echo " ./make {rel_webmachine|package_webmachine}"
@echo " ./make {rel_yaws|package_yaws}"
+ @echo " ./make thanks"
@echo
@echo "Windows Users:"
@echo " ./make rel_inets_win"
@@ -32,6 +33,9 @@ compile: get-deps
clean:
./rebar clean
+thanks:
+ perl support/list_thanks/list_thanks.pl
+
# COWBOY
rel_cowboy: compile
View
56 support/list_thanks/list_thanks.pl
@@ -0,0 +1,56 @@
+#!/usr/bin/perl
+
+## Just a manual list of names to ignore from the git history (usually mistakes of some time or another)
+
+local %filter = (
+ "Russell Klophaus" => 1,
+ "rklophaus" => 1,
+ "dkpsystem" => 1,
+ "Sidello Website" => 1,
+ "Bracketpal User" => 1,
+ "root" => 1,
+ "unknown" => 1
+);
+
+
+## This tells perl to automatically flush output
+
+local $pwd = `pwd`;
+chomp($pwd);
+local $git_cmd = "git log --shortstat --date=short | sed '/^commit/d' | sed '/^ /d' | sed '/^\$/d'";
+local %authors = {};
+
+&do_repo("");
+&do_repo("/deps/nitrogen_core");
+&do_repo("/deps/simple_bridge");
+&do_repo("/deps/nprocreg");
+
+foreach $author (sort compare_date (keys(%authors))) {
+ print "$author\n" if not exists($filter{$author});
+}
+
+
+sub compare_date {
+ $authors{$a} cmp $authors{$b}
+}
+
+## It's nasty, but this just relies on the %authors hash
+sub do_repo {
+ my ($repo) = @_;
+ chdir "$pwd/$repo";
+ my @lines = `$git_cmd`;
+ my $author = "";
+ for(@lines) {
+ if(/^Author:\s*(.*?)\s<.*>$/) {
+ $author = $1;
+ }
+ elsif(/^Date:\s*(.*)$/) {
+ my $date = $1;
+ if(not exists($authors{$author}) or $date lt $authors{$author}) {
+ $authors{$author} = $date;
+ }
+ }
+ }
+}
+
+
Please sign in to comment.
Something went wrong with that request. Please try again.