Skip to content
Snippets Groups Projects
Commit 2e14a87d authored by Karl Wette's avatar Karl Wette
Browse files

update_authors: only add names to AUTHORS file

- New names are added during an MR, but are not then
  removed if MR commits are squashed when merging
- .historical_authors files are no longer needed, as
  ./update_authors just adds to names in AUTHORS
- ./update_authors: add more verbose error messages
- Makefile.am: remove duplicate cd $(top_srcdir)
parent 593f2f93
No related branches found
No related tags found
1 merge request!2138update_authors: only add names to AUTHORS file
......@@ -64,7 +64,6 @@ lalapps/src/string/ @daichi.tsuna @florent-robinet @kipp.cannon
.gitlab-*.Dockerfile @adam-mercer @duncanmmacleod @karl-wette
.gitlab-ci.yml @adam-mercer @duncanmmacleod @karl-wette
.gitlab/ @adam-mercer @duncanmmacleod @karl-wette
.historical_authors @adam-mercer @duncanmmacleod @karl-wette
.mailmap @adam-mercer @duncanmmacleod @karl-wette
00boot @adam-mercer @duncanmmacleod @karl-wette
AUTHORS @adam-mercer @duncanmmacleod @karl-wette
......
......@@ -70,7 +70,7 @@ update-authors:
$(AM_V_at)cd $(top_srcdir); \
echo "Updating .mailmap entries"; \
./common/maintainer-scripts/update_mailmap || exit 1; \
cd $(top_srcdir); for subdir in @subdirs@; do \
for subdir in @subdirs@; do \
echo "Updating authors of $${subdir}"; \
./common/maintainer-scripts/update_authors $${subdir} || exit 1; \
done; \
......
......@@ -2,36 +2,31 @@
# Author: Karl Wette, 2022
use strict;
use File::Copy;
my $subdir = shift @ARGV;
my %authors;
open IN, "$subdir/.historical_authors" or die $!;
open IN, "$subdir/AUTHORS" or die "$0: could not open $subdir/AUTHORS: $!";
binmode IN, ":encoding(UTF-8)";
while (<IN>) {
chomp;
next if /^\s*#/;
$authors{$_} = "historical";
$authors{$_} = 1;
}
open IN, "git log --full-history --no-merges HEAD -- $subdir/ | git shortlog --summary |" or die $!;
open IN, "git log --full-history --no-merges HEAD -- $subdir/ | git shortlog --summary |" or die "$0: git log failed: $!";
binmode IN, ":encoding(UTF-8)";
while (<IN>) {
chomp;
my ($n, $author) = m/^\s*(\d+)\s+(.+)$/ or die;
$authors{$author} = "git history";
my ($n, $author) = m/^\s*(\d+)\s+(.+)$/ or die "$0: could not match line from git log: $_";
$authors{$author} = 1;
}
if (defined($ENV{"UPDATE_AUTHORS_WITH_GIT_BLAME"})) {
my @files;
open IN, "git ls-files -- $subdir/ |" or die $!;
open IN, "git ls-files -- $subdir/ |" or die "$0: git ls-files failed: $!";
binmode IN, ":encoding(UTF-8)";
while (<IN>) {
chomp;
......@@ -40,31 +35,20 @@ if (defined($ENV{"UPDATE_AUTHORS_WITH_GIT_BLAME"})) {
my $nfiles = @files;
for (my $i = 0; $i < @files; ++$i) {
print STDERR "$0: updating authors of $subdir: file $i of $nfiles: $files[$i]\n";
open IN2, "git blame --line-porcelain -- $files[$i] |" or die $!;
open IN2, "git blame --line-porcelain -- $files[$i] |" or die "$0: git blame failed: $!";
binmode IN2, ":encoding(UTF-8)";
while (<IN2>) {
chomp;
next unless s/^author //;
next if defined($authors{$_});
$authors{$_} = "git blame";
$authors{$_} = 1;
}
}
open OUT, ">$subdir/.historical_authors" or die $!;
binmode OUT, ":encoding(UTF-8)";
print OUT <<EOF;
# This file contains historical authors collected from the pre-Git version
# history, copyright notices, documentation, git blame, and other sources.
# It should not be modified except by the 'update_authors' script.
EOF
foreach my $author (sort { $a cmp $b } keys(%authors)) {
print OUT "$author\n" if $authors{$author} ne "git history";
}
}
open OUT, ">$subdir/AUTHORS" or die $!;
open OUT, ">$subdir/AUTHORS.tmp" or die "$0: could not open $subdir/AUTHORS.tmp: $!";
binmode OUT, ":encoding(UTF-8)";
foreach my $author (sort { $a cmp $b } keys(%authors)) {
print OUT "$author\n";
}
move("$subdir/AUTHORS.tmp", "$subdir/AUTHORS") or die "$0: could not move $subdir/AUTHORS.tmp to $subdir/AUTHORS: $!";
# This file contains historical authors collected from the pre-Git version
# history, copyright notices, documentation, git blame, and other sources.
# It should not be modified except by the 'update_authors' script.
D. Ausmus
E. Chassande-Mottin
E. E. Flanagan
E. J. Daw
J. D. Romano
J. Edlund
J. S. Read
Jeffrey Noel
L. S. Finn
M. C. Diaz
M. Casquette
M. Rakhmanov
Makoto Matsumoto
P. B. Cameron
R. Balasubramanian
R. Trejo
Réjean Dupuis
S. D. Mohanty
S. Drasco
S. J. Dwyer
S. Klimenko
S. Sorensen
Takuji Nishimura
Y. Itoh
# This file contains historical authors collected from the pre-Git version
# history, copyright notices, documentation, git blame, and other sources.
# It should not be modified except by the 'update_authors' script.
Curt Cutler
Deepak Khurana
E. Myles Standish
Farhan Feroz
Jeffrey Noel
Jose Fonseca
Junyi Zhang
Oliver Bock
Rana Adhikari
Shane Larson
# This file contains historical authors collected from the pre-Git version
# history, copyright notices, documentation, git blame, and other sources.
# It should not be modified except by the 'update_authors' script.
Andrew Mergl
Bernd Machenschalk
E. E. Flanagan
Mark Stephen Williamsen
Patrick Brady
Saikat Ray-Majumder
Xavier Siemens
# This file contains historical authors collected from the pre-Git version
# history, copyright notices, documentation, git blame, and other sources.
# It should not be modified except by the 'update_authors' script.
Duncan Brown
Stephen Fairhurst
Xavier Siemens
# This file contains historical authors collected from the pre-Git version
# history, copyright notices, documentation, git blame, and other sources.
# It should not be modified except by the 'update_authors' script.
Chiara Mingarelli
Ilya Mandel
Marc van der Sluys
Ryan Lynch
# This file contains historical authors collected from the pre-Git version
# history, copyright notices, documentation, git blame, and other sources.
# It should not be modified except by the 'update_authors' script.
Anand S. Sengupta
Andres C. Rodriguez
B. S. Sathyaprakash
Badri Krishnan
Bala R. Iyer
Benjamin Owen
Bernd Machenschalk
Chris Van Den Broeck
Darren Woods
David Chin
David Churches
David McKechan
Devanka Pathak
Eirini Messaritaki
Gareth Jones
George Birthisel
Jessica Clayton
John T. Whelan
Lucia Santamaria
M. C. Diaz
Patrick Brady
Philip Charlton
Sean Seader
Stanislav Babak
Stephen Fairhurst
Steven Caudill
Teviet Creighton
Thomas Cokelaer
Warren Anderson
# This file contains historical authors collected from the pre-Git version
# history, copyright notices, documentation, git blame, and other sources.
# It should not be modified except by the 'update_authors' script.
Alexander Dietz
Anand S. Sengupta
Andres C. Rodriguez
Badri Krishnan
Bernd Machenschalk
Chad Hanna
Craig Robinson
David McKechan
Diego Fazi
Drew Keppel
Duncan Brown
Eirini Messaritaki
Gareth Jones
George Birthisel
John T. Whelan
Lisa M. Goggin
Patrick Brady
Peter Shawhan
Saikat Ray-Majumder
Salvatore Vitale
Sean Seader
Stephen Fairhurst
Stephen Privitera
Thomas Cokelaer
Xavier Siemens
# This file contains historical authors collected from the pre-Git version
# history, copyright notices, documentation, git blame, and other sources.
# It should not be modified except by the 'update_authors' script.
Ansel Neunzert
Badri Krishnan
Benjamin Owen
Benjamin Steltner
Berit Behnke
Bruce Allen
Christoph Dreissigacker
Curt Cutler
D. I. Jones
David Chin
David M. Whitbeck
Duncan Brown
Erin Macdonald
Fekete Akos
Gregory Mendell
Holger Pletsch
Iraj Gholami
Jared Wofford
Letizia Sammut
Llucia Sancho de la Jordana
Maria Alessandra Papa
Miquel Oliver
Oliver Bock
Paola Leaci
Paul Kienzle
Peter Shawhan
Pinkesh Patel
Santiago Caride
Shane Larson
Stefanos Giampanis
Stephen Fairhurst
Steve Berukoff
Teviet Creighton
Thomas Essinger-Hileman
Vivien Raymond
Xavier Siemens
Y. Itoh
# This file contains historical authors collected from the pre-Git version
# history, copyright notices, documentation, git blame, and other sources.
# It should not be modified except by the 'update_authors' script.
B. S. Sathyaprakash
David Chin
David Churches
David McKechan
Enrico Barausse
J. S. Read
Lucia Santamaria
László Veréb
Stephen Fairhurst
Teviet Creighton
Thomas Cokelaer
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment