Skip to content

Commit

Permalink
doc: use perl in update-authors.sh instead of awk
Browse files Browse the repository at this point in the history
As a consequence of the various implementations of AWK across platforms,
the use of AWK in `scripts/update-authors.sh` might result in different
sorting behavior on different platforms (i.e. BSD awk on OS X does not
maintain the desired sort- by-first-contribution). So, let's use Perl
instead.
  • Loading branch information
kenany authored and othiym23 committed Mar 12, 2015
1 parent a91f2c7 commit fcd9247
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions scripts/update-authors.sh
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@
#!/bin/sh

git log --reverse --format='%aN <%aE>' | awk '
git log --reverse --format='%aN <%aE>' | perl -we '
BEGIN {
print "# Authors sorted by whether or not they'\''re me";
%seen = (), @authors = ();
}
{
if (all[$NF] != 1) {
all[$NF] = 1;
ordered[length(all)] = $0;
}
while (<>) {
next if $seen{$_};
$seen{$_} = push @authors, $_;
}
END {
for (i in ordered) {
print ordered[i];
}
print "# Authors sorted by whether or not they'\''re me\n";
print @authors;
}
' > AUTHORS
' > AUTHORS

0 comments on commit fcd9247

Please sign in to comment.