#!/bin/sh

# Modified from https://github.com/nodejs/node/blob/master/tools/update-authors.sh

git log --reverse --format='%aN <%aE>' | perl -we '
BEGIN {
  %seen = (), @authors = ();
}

while (<>) {
  next if $seen{$_};
  $seen{$_} = push @authors, $_;
}

END {
  print "# Authors ordered by first contribution.\n";
  print "\n", @authors, "\n";
  print "# Generated by tools/update-authors.sh\n";
}

' > AUTHORS.md
