Scripte zur Auswertung der von den Studierenden eingereichten git repositories
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

36 lines
714 B

#!/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