From e39556356bdefceadd33c072034a84a93276b453 Mon Sep 17 00:00:00 2001 From: Felix Lee Date: Sat, 9 Sep 2023 16:18:09 +0800 Subject: [PATCH] add script directory files to project --- scripts/Contributors | 49 +++++++++++++++++++++++++++++ scripts/Exclude | 1 + scripts/Include | 8 +++++ scripts/list-contributors.sh | 60 ++++++++++++++++++++++++++++++++++++ 4 files changed, 118 insertions(+) create mode 100644 scripts/Contributors create mode 100644 scripts/Exclude create mode 100644 scripts/Include create mode 100755 scripts/list-contributors.sh diff --git a/scripts/Contributors b/scripts/Contributors new file mode 100644 index 0000000..fac0f85 --- /dev/null +++ b/scripts/Contributors @@ -0,0 +1,49 @@ +Andy Shevchenko, +Arush Sharma,<46960231+arushsharma24@users.noreply.github.com> +Benno Bielmeier,<32938211+bbenno@users.noreply.github.com> +Bob Lee, +Brad Baker, +Che-Chia Chang, +Chih-En Lin,,<0086d026@email.ntou.edu.tw>,<66012716+linD026@users.noreply.github.com> +Chih-Hsuan Yang, +Chih-Yu Chen,<34228283+chihyu1206@users.noreply.github.com> +Ching-Hua (Vivian) Lin, +Chin Yik Ming, +Cyril Brulebois, +Daniele Paolo Scarpazza,<> +David Porter,<> +demonsome, +Dimo Velev,<> +Ekang Monyet, +Ethan Chan, +fennecJ,,<58484289+fennecJ@users.noreply.github.com> +Francois Audeon,<> +Gilad Reti, +Horst Schirmeier,<> +Hsin-Hsiang Peng, +Ignacio Martin,<> +Iûnn Kiàn-îng, +Jian-Xing Wu, +Johan Calle,<43998967+jcallemc@users.noreply.github.com> +keytouch, +Kohei Otsuka,<13173186+rjhcnf@users.noreply.github.com> +manbing, +Marconi Jiang, +mengxinayan,<31788564+mengxinayan@users.noreply.github.com> +Peter Lin,,, +Roman Lakeev,<> +Sam Erickson, +Shao-Tse Hung, +Stacy Prowell, +Steven Lung,<1030steven@gmail.com> +Tristan Lelong, +Tse-Wei Lin,<20110901eric@outlook.com> +Tucker Polomik, +Tyler Fanelli, +VxTeemo, +Wei-Lun Tsai, +Xatierlike Lee, +Yin-Chiuan Chen, +Yi-Wei Lin, +Ylowy,<69316865+YLowy@users.noreply.github.com> +Yu-Hsiang Tseng, diff --git a/scripts/Exclude b/scripts/Exclude new file mode 100644 index 0000000..8514591 --- /dev/null +++ b/scripts/Exclude @@ -0,0 +1 @@ +Jim Huang, One of main author diff --git a/scripts/Include b/scripts/Include new file mode 100644 index 0000000..b54c0ce --- /dev/null +++ b/scripts/Include @@ -0,0 +1,8 @@ +Daniele Paolo Scarpazza,<> +David Porter,<> +Dimo Velev,<> +Francois Audeon,<> +Horst Schirmeier,<> +Ignacio Martin,<> +Roman Lakeev,<> +Tristan Lelong, diff --git a/scripts/list-contributors.sh b/scripts/list-contributors.sh new file mode 100755 index 0000000..6bbe963 --- /dev/null +++ b/scripts/list-contributors.sh @@ -0,0 +1,60 @@ +#!/usr/bin/env bash +FORMAT="%aN,<%aE>" #Set git output format in "Name," //Capital in aN and aE means replace str based on .mailmap +TARGET=(examples lkmpg.tex) #Target files we want to trace +DIR=`git rev-parse --show-toplevel` #Get root dir of the repo +TARGET=("${TARGET[@]/#/$DIR/}") #Concat $DIR BEFORE ALL elements in array TARGET + +#The str in each line should be Username, +function gen-raw-list() +{ + git log --pretty="$FORMAT" ${TARGET[@]} | sort -u +} + +function parse-list() +{ + > Contributors # Clear contributors' list (Overwrite with null) + while read -r line; do + User=`echo "$line" | awk -F "," '{print $1}'` + if [[ `grep -w "$User" Exclude` ]]; then + echo "[skip] $User" + continue; + fi + echo "[Add] $User" + MainMail=`echo "$line" | awk -F "[<*>]" '{print $2}'` + Emails=(`cat $DIR/.mailmap | grep -w "$User" | awk -F "[<*>]" '{print $4}' | sort -u`) + for Email in ${Emails[@]}; do + if [[ "$Email" != "$MainMail" ]]; then + line="$line,<$Email>"; + fi + done + echo "$line" >> Contributors + done <<< $(gen-raw-list) + cat Include >> Contributors +} + +function sort-list() +{ + if [[ `git diff Contributors` ]]; then + sort -f -o Contributors{,} + git add $DIR/scripts/Contributors + fi +} + +#For all lines before endline, print "name, % " +#For endline print "name. % " +function gen-tex-file() +{ + cat Contributors | awk -F "," \ + ' BEGIN{k=0}{name[k]=$1;email[k++]=$2} + END{ + for(i=0;i $DIR/contrib.tex \ No newline at end of file -- 2.39.5