Skip to content

Commit d88d0cd

Browse files
authored
Merge pull request #123 from fennecJ/patch
Generate contributor list as a modular inclusion
2 parents 07a9741 + af09a8a commit d88d0cd

File tree

7 files changed

+147
-1
lines changed

7 files changed

+147
-1
lines changed

.mailmap

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
JianXing Wu <[email protected]> 吳建興 <[email protected]>
2+
3+
4+
Jim Huang <[email protected]> Jim Huang <[email protected]>
5+
Jim Huang <[email protected]> Jim Huang <[email protected]>
6+
7+
8+

contrib.tex

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
2011eric, % <[email protected]>
2+
25077667, % <[email protected]>
3+
Arush Sharma, % <[email protected]>
4+
asas1asas200, % <[email protected]>
5+
Benno Bielmeier, % <[email protected]>
6+
Brad Baker, % <[email protected]>
7+
ccs100203, % <[email protected]>
8+
Chih-Yu Chen, % <[email protected]>
9+
ChinYikMing, % <[email protected]>
10+
Cyril Brulebois, % <[email protected]>
11+
Daniele Paolo Scarpazza, % <>
12+
David Porter, % <>
13+
demonsome, % <[email protected]>
14+
Dimo Velev, % <>
15+
Ekang Monyet, % <[email protected]>
16+
fennecJ, % <[email protected]>
17+
Francois Audeon, % <>
18+
gagachang, % <[email protected]>
19+
Gilad Reti, % <[email protected]>
20+
Horst Schirmeier, % <>
21+
Hsin-Hsiang Peng, % <[email protected]>
22+
Ignacio Martin, % <>
23+
JianXing Wu, % <[email protected]>
24+
linD026, % <[email protected]>
25+
Marconi Jiang, % <[email protected]>
26+
RinHizakura, % <[email protected]>
27+
Roman Lakeev, % <>
28+
Stacy Prowell, % <[email protected]>
29+
Tucker Polomik, % <[email protected]>
30+
VxTeemo, % <[email protected]>
31+
Wei-Lun Tsai, % <[email protected]>
32+
xatier, % <[email protected]>
33+

lkmpg.tex

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,11 @@ \subsection{Authorship}
8282
\subsection{Acknowledgements}
8383
\label{sec:acknowledgements}
8484

85-
The following people have contributed corrections or good suggestions: Ignacio Martin, David Porter, Daniele Paolo Scarpazza, Dimo Velev, Francois Audeon, Horst Schirmeier, and Roman Lakeev.
85+
The following people have contributed corrections or good suggestions:
86+
87+
\begin{flushleft}
88+
\input{contrib}
89+
\end{flushleft}
8690

8791
\subsection{What Is A Kernel Module?}
8892
\label{sec:kernelmod}

scripts/Contributors

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
2+
3+
Arush Sharma,<[email protected]>
4+
asas1asas200,<[email protected]>
5+
Benno Bielmeier,<[email protected]>
6+
Brad Baker,<[email protected]>
7+
ccs100203,<[email protected]>
8+
Chih-Yu Chen,<[email protected]>
9+
ChinYikMing,<[email protected]>
10+
Cyril Brulebois,<[email protected]>
11+
Daniele Paolo Scarpazza,<>
12+
David Porter,<>
13+
demonsome,<[email protected]>
14+
Dimo Velev,<>
15+
Ekang Monyet,<[email protected]>
16+
17+
Francois Audeon,<>
18+
gagachang,<[email protected]>
19+
Gilad Reti,<[email protected]>
20+
Horst Schirmeier,<>
21+
Hsin-Hsiang Peng,<[email protected]>
22+
Ignacio Martin,<>
23+
JianXing Wu,<[email protected]>
24+
25+
Marconi Jiang,<[email protected]>
26+
RinHizakura,<[email protected]>
27+
Roman Lakeev,<>
28+
Stacy Prowell,<[email protected]>
29+
Tucker Polomik,<[email protected]>
30+
31+
Wei-Lun Tsai,<[email protected]>
32+
33+

scripts/Exclude

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Jim Huang, One of main author

scripts/Include

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Daniele Paolo Scarpazza,<>
2+
David Porter,<>
3+
Dimo Velev,<>
4+
Francois Audeon,<>
5+
Horst Schirmeier,<>
6+
Ignacio Martin,<>
7+
Roman Lakeev,<>

scripts/list-contributors.sh

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
#!/usr/bin/env bash
2+
FORMAT="%aN,<%aE>" #Set git output format in "Name,<Email>" //Capital in aN and aE means replace str based on .mailmap
3+
TARGET=(examples lkmpg.tex) #Target files we want to trace
4+
DIR=`git rev-parse --show-toplevel` #Get root dir of the repo
5+
TARGET=("${TARGET[@]/#/$DIR/}") #Concat $DIR BEFORE ALL elements in array TARGET
6+
7+
#The str in each line should be Username,<useremail>
8+
function gen-raw-list()
9+
{
10+
git log --pretty="$FORMAT" ${TARGET[@]} | sort -u
11+
}
12+
13+
function parse-list()
14+
{
15+
> Contributors # Clear contributors' list (Overwrite with null)
16+
while read -r line; do
17+
User=`echo "$line" | awk -F "," '{print $1}'`
18+
if [[ `grep -w "$User" Exclude` ]]; then
19+
echo "[skip] $User"
20+
continue;
21+
fi
22+
echo "[Add] $User"
23+
MainMail=`echo "$line" | awk -F "[<*>]" '{print $2}'`
24+
Emails=(`cat $DIR/.mailmap | grep -w "$User" | awk -F "[<*>]" '{print $4}' | sort -u`)
25+
for Email in ${Emails[@]}; do
26+
if [[ "$Email" != "$MainMail" ]]; then
27+
line="$line,<$Email>";
28+
fi
29+
done
30+
echo "$line" >> Contributors
31+
done <<< $(gen-raw-list)
32+
cat Include >> Contributors
33+
}
34+
35+
function sort-list()
36+
{
37+
if [[ `git diff Contributors` ]]; then
38+
sort -f -o Contributors{,}
39+
git add $DIR/scripts/Contributors
40+
fi
41+
}
42+
43+
#For all lines before endline, print "name, % <email>"
44+
#For endline print "name. % <email>"
45+
function gen-tex-file()
46+
{
47+
cat Contributors | awk -F "," \
48+
' BEGIN{k=0}{name[k]=$1;email[k++]=$2}
49+
END{
50+
for(i=0;i<k;i++){
51+
name[i]=(i<k-1)?name[i]",":name[i]".";
52+
printf("%-30s %% %s\n",name[i],email[i]);
53+
}
54+
}
55+
'
56+
}
57+
58+
parse-list
59+
sort-list
60+
gen-tex-file > $DIR/contrib.tex

0 commit comments

Comments
 (0)