Skip to content

Commit 80dd85b

Browse files
committed
update mailmap and add script to add copyright
1 parent 1080fc4 commit 80dd85b

File tree

2 files changed

+159
-35
lines changed

2 files changed

+159
-35
lines changed

.mailmap

+47-35
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,47 @@
1-
Andrew Myers <atmyers@lbl.gov> Andrew Myers <atmyers2@gmail.com>
2-
Andrew Myers <atmyers@lbl.gov> atmyers <atmyers2@gmail.com>
3-
Aurore Blelly <ablelly@lbl.gov> ablelly <aurore.blelly@ensta-paristech.fr>
4-
Aurore Blelly <ablelly@lbl.gov> ablelly <48810880+ablelly@users.noreply.github.com>
5-
Axel Huebl <axelhuebl@lbl.gov> Axel Huebl <axel.huebl@plasma.ninja>
6-
David Grote <dpgrote@lbl.gov> grote <dpgrote@lbl.gov>
7-
David Grote <dpgrote@lbl.gov> Dave <grote1@llnl.gov>
8-
David Grote <dpgrote@lbl.gov> Dave Grote <grote1@llnl.gov>
9-
David Grote <dpgrote@lbl.gov> Grote <grote1@n9459722.llnl.gov>
10-
Edoardo Zoni <ezoni@lbl.gov> Edoardo Zoni <edoardo.zoni@ipp.mpg.de>
11-
Ligia Diana Amorim <ldianaamorim@lbl.gov> L. Diana Amorim <LDianaAmorim@lbl.gov>
12-
Ligia Diana Amorim <ldianaamorim@lbl.gov> Diana Amorim <diana@henrivincenti.dhcp.lbl.gov>
13-
Ligia Diana Amorim <ldianaamorim@lbl.gov> Ligia Diana Amorim <ligiada@cori01.nersc.gov>
14-
Ligia Diana Amorim <ldianaamorim@lbl.gov> Ligia Diana Amorim <ligiada@cori11.nersc.gov>
15-
Luca Fedeli <luca.fedeli@cea.fr> Luca Fedeli <luca.fedeli.88@gmail.com>
16-
Luca Fedeli <luca.fedeli@cea.fr> lucafedeli88 <luca.fedeli@cea.fr>
17-
Luca Fedeli <luca.fedeli@cea.fr> Luca Fedeli <luca@DEB.station>
18-
Luca Fedeli <luca.fedeli@cea.fr> Luca Fedeli <luca.fedeli@for.unipi.it>
19-
Luca Fedeli <luca.fedeli@cea.fr> Luca <luca@localhost.localdomain>
20-
Mathieu Lobet <mathieu.lobet@cea.fr> Mathieu Lobet <mathieu.lobet@gmail.com>
21-
Mathieu Lobet <mathieu.lobet@cea.fr> mathieu_lobet <mathieu.lobet@gmail.com>
22-
Maxence Thevenet <mthevenet@lbl.gov> MaxThevenet <mthevenet@lbl.gov>
23-
Maxence Thevenet <mthevenet@lbl.gov> Maxence Thévenet <mthevenet@lbl.gov>
24-
Maxence Thevenet <mthevenet@lbl.gov> mthevenet <mthevenet@lbl.gov>
25-
Remi Lehe <rlehe@lbl.gov> Remi Lehe <remi.lehe@normalesup.org>
26-
Revathi Jambunathan <rjambunathan@lbl.gov> RevathiJambunathan <revanathan@gmail.com>
27-
Revathi Jambunathan <rjambunathan@lbl.gov> RevathiJambunathan <rjnathan@cori12.nersc.gov>
28-
Revathi Jambunathan <rjambunathan@lbl.gov> Revathi Jambunathan <revanathan@login2.summit.olcf.ornl.gov>
29-
Revathi Jambunathan <rjambunathan@lbl.gov> Revathi Jambunathan <revanathan@login3.summit.olcf.ornl.gov>
30-
Revathi Jambunathan <rjambunathan@lbl.gov> Revathi Jambunathan <revanathan@login4.summit.olcf.ornl.gov>
31-
Revathi Jambunathan <rjambunathan@lbl.gov> Revathi Jambunathan <revanathan@login5.summit.olcf.ornl.gov>
32-
Weiqun Zhang <weiqunzhang@lbl.gov> Weiqun Zhang <WeiqunZhang@lbl.gov>
33-
Weiqun Zhang <weiqunzhang@lbl.gov> WeiqunZhang <WeiqunZhang@lbl.gov
34-
Yinjian Zhao <yinjianzhao@lbl.gov> Yin-YinjianZhao <yinjianzhao@lbl.gov>
35-
Yinjian Zhao <yinjianzhao@lbl.gov> Yin-YinjianZhao <56095356+Yin-YinjianZhao@users.noreply.github.com>
1+
Andrew Myers <atmyers@lbl.gov> Andrew Myers <atmyers2@gmail.com>
2+
Andrew Myers <atmyers@lbl.gov> atmyers <atmyers2@gmail.com>
3+
Aurore Blelly <ablelly@lbl.gov> ablelly <aurore.blelly@ensta-paristech.fr>
4+
Aurore Blelly <ablelly@lbl.gov> ablelly <48810880+ablelly@users.noreply.github.com>
5+
Axel Huebl <axelhuebl@lbl.gov> Axel Huebl <axel.huebl@plasma.ninja>
6+
David Bizzozero <dbizzozero@lbl.gov> dbizzozero <dbizzozero@users.noreply.github.com>
7+
David Grote <dpgrote@lbl.gov> grote <dpgrote@lbl.gov>
8+
David Grote <dpgrote@lbl.gov> Dave <grote1@llnl.gov>
9+
David Grote <dpgrote@lbl.gov> Dave Grote <grote1@llnl.gov>
10+
David Grote <dpgrote@lbl.gov> Grote <grote1@n9459722.llnl.gov>
11+
Edoardo Zoni <ezoni@lbl.gov> Edoardo Zoni <edoardo.zoni@ipp.mpg.de>
12+
Edoardo Zoni <ezoni@lbl.gov> Edoardo Zoni <59625522+EZoni@users.noreply.github.com>
13+
Glenn Richardson <gtrichardson@berkeley.edu> gtrichardson <gtrichardson@berkeley.edu>
14+
Jaehong Park <jaehongpark@lbl.gov> jaehongp <jaehong@jaehongs-mbp-10.attlocal.net>
15+
Jean-Luc Vay <jlvay@lbl.gov> Jean-Luc Vay <jlvay@Jean-Lucs-MacBook-Pro.local>
16+
Jean-Luc Vay <jlvay@lbl.gov> Jean-Luc Vay <jlvay@Jean-Lucs-MBP.dhcp.lbnl.us>
17+
Jean-Luc Vay <jlvay@lbl.gov> Jean-Luc Vay <jlvay@jlvay2.lbl.gov>
18+
Junmin Gu <jgu@lbl.gov> guj <guj@users.noreply.github.com>
19+
Ligia Diana Amorim <ldianaamorim@lbl.gov> L. Diana Amorim <LDianaAmorim@lbl.gov>
20+
Ligia Diana Amorim <ldianaamorim@lbl.gov> Diana Amorim <diana@henrivincenti.dhcp.lbl.gov>
21+
Ligia Diana Amorim <ldianaamorim@lbl.gov> Ligia Diana Amorim <ligiada@cori01.nersc.gov>
22+
Ligia Diana Amorim <ldianaamorim@lbl.gov> Ligia Diana Amorim <ligiada@cori11.nersc.gov>
23+
Lixin Ge <lge@slac.stanford.edu> lixin <lge@slac.stanford.edu>
24+
Luca Fedeli <luca.fedeli@cea.fr> Luca Fedeli <luca.fedeli.88@gmail.com>
25+
Luca Fedeli <luca.fedeli@cea.fr> lucafedeli88 <luca.fedeli@cea.fr>
26+
Luca Fedeli <luca.fedeli@cea.fr> Luca Fedeli <luca@DEB.station>
27+
Luca Fedeli <luca.fedeli@cea.fr> Luca Fedeli <luca.fedeli@for.unipi.it>
28+
Luca Fedeli <luca.fedeli@cea.fr> Luca <luca@localhost.localdomain>
29+
Kevin Gott <kngott@lbl.gov> kngott <30483578+kngott@users.noreply.github.com>
30+
Mathieu Lobet <mathieu.lobet@cea.fr> Mathieu Lobet <mathieu.lobet@gmail.com>
31+
Mathieu Lobet <mathieu.lobet@cea.fr> mathieu_lobet <mathieu.lobet@gmail.com>
32+
Maxence Thevenet <mthevenet@lbl.gov> MaxThevenet <mthevenet@lbl.gov>
33+
Maxence Thevenet <mthevenet@lbl.gov> Maxence Thévenet <mthevenet@lbl.gov>
34+
Maxence Thevenet <mthevenet@lbl.gov> mthevenet <mthevenet@lbl.gov>
35+
Remi Lehe <rlehe@lbl.gov> Remi Lehe <remi.lehe@normalesup.org>
36+
Revathi Jambunathan <rjambunathan@lbl.gov> RevathiJambunathan <revanathan@gmail.com>
37+
Revathi Jambunathan <rjambunathan@lbl.gov> RevathiJambunathan <rjnathan@cori12.nersc.gov>
38+
Revathi Jambunathan <rjambunathan@lbl.gov> Revathi Jambunathan <revanathan@login2.summit.olcf.ornl.gov>
39+
Revathi Jambunathan <rjambunathan@lbl.gov> Revathi Jambunathan <revanathan@login3.summit.olcf.ornl.gov>
40+
Revathi Jambunathan <rjambunathan@lbl.gov> Revathi Jambunathan <revanathan@login4.summit.olcf.ornl.gov>
41+
Revathi Jambunathan <rjambunathan@lbl.gov> Revathi Jambunathan <revanathan@login5.summit.olcf.ornl.gov>
42+
Revathi Jambunathan <rjambunathan@lbl.gov> Revathi Jambunathan <41089244+RevathiJambunathan@users.noreply.github.com>
43+
Revathi Jambunathan <rjambunathan@lbl.gov> Revathi Jambunathan <rjnathan@cori12.nersc.gov>
44+
Weiqun Zhang <weiqunzhang@lbl.gov> Weiqun Zhang <WeiqunZhang@lbl.gov>
45+
Weiqun Zhang <weiqunzhang@lbl.gov> WeiqunZhang <WeiqunZhang@lbl.gov
46+
Yinjian Zhao <yinjianzhao@lbl.gov> Yin-YinjianZhao <yinjianzhao@lbl.gov>
47+
Yinjian Zhao <yinjianzhao@lbl.gov> Yin-YinjianZhao <56095356+Yin-YinjianZhao@users.noreply.github.com>

Tools/update_copyright.sh

+112
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
#!/usr/bin/env bash
2+
3+
# This file loops over all WarpX source files, uses git to get the list of
4+
# contributors, and writes a copyright header at the beginning of each file
5+
# with the list of contributors.
6+
#
7+
# To use it, execute from the WarpX directory.
8+
# Warning: it'll delete and create file tmp.txt
9+
# It uses the gnu-sed (sed on Linux, gsed on MacOS)
10+
11+
rm -r tmp.txt
12+
set -e
13+
14+
# Loop over all source files
15+
pattern="\.c$|\.cpp$|\.F90$|\.h$|\.H$|\.py$|"\
16+
"\.sh$|\.tex$|\.txt$|\.yml$|"\
17+
"CMakeLists\.txt|inputs"
18+
for i in $(find . \
19+
-not -path "./.git/*" \
20+
-not -path "./.idea/*" \
21+
-not -path "./Docs/source/api/*" \
22+
-not -path "./Docs/build/*" \
23+
-not -path "./Docs/doxyxml/*" \
24+
-not -path "*wp_parse*" \
25+
-not -path "*LEGAL.txt" \
26+
-not -path "*LICENSE.txt" \
27+
-not -path "./tmp_build_dir/*" \
28+
-not -path "*/inputs*" \
29+
-not -path "*/PICMI_inputs*" \
30+
-not -path "./Tools/performance_tests/performance_log.txt" \
31+
-type f | \
32+
grep -P "${pattern}")
33+
do
34+
echo " --- " $i
35+
# If Copyright information is present, remove it.
36+
# WARNING: This only works for C++ files.
37+
gsed -i '/^\/\* Copyright/,/\*\//{/^#/!{/^\$/!d}}' $i ; sleep 0.01
38+
# Get year of first modification of the file
39+
year_line=`git log --format=%aD $i | tail -1`
40+
year_first=($year_line)
41+
year_first=${year_first[3]}
42+
# Get year of last modification of the file
43+
year_line=`git log --format=%aD $i | head -1`
44+
year_last=($year_line)
45+
year_last=${year_last[3]}
46+
# Format year string, something like "2020" or "2016-2020"
47+
if [ $year_first == $year_last ]; then year_string=$year_first; else year_string=$year_first-$year_last; fi
48+
cp $i tmp.txt
49+
# If bash or python or txt or yml file, comment character is #
50+
if [ "${i: -2}" == "sh" ] || [ "${i: -2}" == "py" ] || [ "${i: -3}" == "txt" ] || [ "${i: -3}" == "yml" ]; then
51+
echo "sh or py or txt"
52+
pattern1="#"
53+
pattern2="#"
54+
pattern3="
55+
"
56+
# If C or C++ file, comment characters are /*, * and */
57+
elif [ "${i: -1}" == "H" ] || [ "${i: -3}" == "cpp" ] || [ "${i: -1}" == "c" ] || [ "${i: -1}" == "h" ]; then
58+
echo "cpp"
59+
pattern1="/*"
60+
pattern2=" *"
61+
pattern3="
62+
*/"
63+
# If Fortran file, comment character is !
64+
elif [ "${i: -3}" == "F90" ]; then
65+
echo "Fortran"
66+
pattern1="!"
67+
pattern2="!"
68+
pattern3="
69+
"
70+
# If Latex, comment character is %
71+
elif [ "${i: -3}" == "tex" ]; then
72+
echo "tex"
73+
pattern1="%"
74+
pattern2="%"
75+
pattern3="
76+
"
77+
else
78+
echo "error: unknown file type"
79+
exit
80+
fi
81+
# Get formatted authors list
82+
# sorted, unique, delete authors "Tools" (used by ax3l), and remove newlines
83+
authors_list=`git log --follow --pretty=format:'%aN' $i | sort | uniq | grep -v Tools | gsed 's/$/, /g'`
84+
# Put 2 authors per line, to avoid very long lines.
85+
authors_list=`echo $authors_list | gsed 's/\([^,]*,[^,]*,[^,]*\),/\1,\n'"$pattern2"'/g' | gsed s/,$//g`
86+
# Copy current file + Copyright to tmp.txt
87+
# rm -rf tmp.txt
88+
cp $i tmp.txt
89+
first_line=`head -n1 $i`
90+
# If a shebang is present, keep it as first line
91+
if [ "${first_line:0:2}" == "#!" ]; then
92+
echo "keeping shebang"
93+
echo "$first_line" > tmp.txt
94+
echo "" >> tmp.txt
95+
else
96+
truncate -s 0 tmp.txt
97+
fi
98+
# Write copyright
99+
echo "$pattern1 Copyright $year_string $authors_list
100+
$pattern2
101+
$pattern2 This file is part of WarpX.
102+
$pattern2
103+
$pattern2 License: BSD-3-Clause-LBNL$pattern3" >> tmp.txt
104+
# If no shebang, put first line after Copyright
105+
if [ "${first_line:0:2}" != "#!" ]; then
106+
echo "$first_line" >> tmp.txt
107+
fi
108+
# Then copy the content of the file
109+
tail -n +2 $i >> tmp.txt
110+
# Then overwrite current file with tmp.txt
111+
mv tmp.txt $i
112+
done

0 commit comments

Comments
 (0)