diff --git a/README.md b/README.md index 3c67614..b3b1138 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,6 @@ # Bewertung-Pruefungsleistungen -Scripte zur Auswertung der von den Studierenden eingereichten git repositories \ No newline at end of file +Scripte zur Auswertung der von den Studierenden eingereichten git repositories + +Dateirechte auf 700 setzen und nach `~/bin` kopieren + diff --git a/ciip-list-commits-per-author b/ciip-list-commits-per-author new file mode 100755 index 0000000..dc6bfc7 --- /dev/null +++ b/ciip-list-commits-per-author @@ -0,0 +1,3 @@ +#!/bin/sh +git shortlog -s --all + diff --git a/ciip-list-files--by-author b/ciip-list-files--by-author new file mode 100755 index 0000000..ded73f7 --- /dev/null +++ b/ciip-list-files--by-author @@ -0,0 +1,2 @@ +git log --pretty="%H" --author="$*" | while read commit_hash; do git show --oneline --name-only $commit_hash | tail -n+2; done | sort | uniq + diff --git a/ciip-rating-for b/ciip-rating-for new file mode 100755 index 0000000..ee29d36 --- /dev/null +++ b/ciip-rating-for @@ -0,0 +1,29 @@ +#!/bin/bash + +if [ $# -eq 0 ]; then + echo "creates a *.tex file for the name and matrikel number given" + echo "and fetches the folder name of the latest checked out project." + echo "usage:" + echo " $0 Student Name from List MATRIKEL_NO" + exit 1 +fi + + +_args=( "$@" ) + +MATRIKEL_NR=${_args[-1]} +unset _args[${#_args[@]}-1] + +PROJECT_PATH=$(ls -1t ../../ProjektArbeiten/ | head -1) + + +NAME="${_args[@]}" +FILE_NAME=${NAME//[ ]/_} +FILE_NAME=bewertung-${FILE_NAME//[,]/}.tex + +cp -v bewertung-student.tex $FILE_NAME + +sed -i -e "s/StudentsName} {}/StudentsName} {$NAME}/" $FILE_NAME +sed -i -e "s/Matrikel}\( \)* {}/Matrikel}\1 {$MATRIKEL_NR}/" $FILE_NAME +sed -i -e "s/in_der_Praxis\//in_der_Praxis\/$PROJECT_PATH/" $FILE_NAME + diff --git a/ciip-run-custom-comand-random-commits-by-author b/ciip-run-custom-comand-random-commits-by-author new file mode 100755 index 0000000..601c733 --- /dev/null +++ b/ciip-run-custom-comand-random-commits-by-author @@ -0,0 +1,36 @@ +#!/bin/bash + +if [ $# -eq 0 ]; then + echo "usage:" + echo " $0 'custom command' User Name as in git log" + + exit 1 +fi + +_args=( "$@" ) +COMMAND=${_args[0]} +unset _args[0] + +AUTHOR="${_args[@]}" +LOG_FILE=${AUTHOR//\//} +LOG_FILE=${LOG_FILE// /}-commits.txt + + +BRANCH=$(git branch|grep -o ' .*') +BRANCH=${BRANCH// /} + +#$COMMAND +echo $AUTHOR + +git log --pretty="%H" --author="$AUTHOR" | shuf -n 5 | while read commit_hash; do git checkout $commit_hash ; $COMMAND ; echo $commit_hash ${PIPESTATUS[0]} >> $LOG_FILE ; done + +git checkout $BRANCH + + +echo $AUTHOR +cat $LOG_FILE | sort -k 2 -k1 -u | sed -e 's/ 0/ OK/' -e 's/ [0-9]\+/ FAIL/' | tee $LOG_FILE + +echo . +echo --------------- +ciip-list-commits-per-author + diff --git a/ciip-run-greadle-random-commits-by-author b/ciip-run-greadle-random-commits-by-author new file mode 100755 index 0000000..75927a5 --- /dev/null +++ b/ciip-run-greadle-random-commits-by-author @@ -0,0 +1,6 @@ +AUTHOR="$*" +GREADLE=/home/thomas/.gradle/wrapper/dists/gradle-6.8.1-bin/292llow5buzp6wg9rco3vjhoc/gradle-6.8.1/bin/gradle +git log --pretty="%H" --author="$AUTHOR" | shuf -n 5 > ${AUTHOR// /_}-commits.txt +cat ${AUTHOR// /_}-commits.txt + +git checkout master diff --git a/ciip-run-maven-random-commits-by-author b/ciip-run-maven-random-commits-by-author new file mode 100755 index 0000000..04cd9e2 --- /dev/null +++ b/ciip-run-maven-random-commits-by-author @@ -0,0 +1,16 @@ +AUTHOR="$*" +LOG_FILE=${AUTHOR//\//} +LOG_FILE=${LOG_FILE// /}-commits.txt + +git log --pretty="%H" --author="$AUTHOR" | shuf -n 5 | while read commit_hash; do git checkout $commit_hash ; mvn test ; echo $commit_hash ${PIPESTATUS[0]} >> $LOG_FILE ; done + +git checkout master + + +echo $AUTHOR +cat $LOG_FILE | sort -k 2 -k1 -u | sed -e 's/ 0/ OK/' -e 's/ [0-9]\+/ FAIL/' | tee $LOG_FILE + +echo . +echo --------------- +ciip-list-commits-per-author +