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

  1. #!/bin/bash
  2. if [ $# -eq 0 ]; then
  3. echo "usage:"
  4. echo " $0 'custom command' User Name as in git log"
  5. exit 1
  6. fi
  7. _args=( "$@" )
  8. COMMAND=${_args[0]}
  9. unset _args[0]
  10. AUTHOR="${_args[@]}"
  11. LOG_FILE=${AUTHOR//\//}
  12. LOG_FILE=${LOG_FILE// /}-commits.txt
  13. BRANCH=$(git branch|grep -o ' .*')
  14. BRANCH=${BRANCH// /}
  15. #$COMMAND
  16. echo $AUTHOR
  17. 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
  18. git checkout $BRANCH
  19. echo $AUTHOR
  20. cat $LOG_FILE | sort -k 2 -k1 -u | sed -e 's/ 0/ OK/' -e 's/ [0-9]\+/ FAIL/' | tee $LOG_FILE
  21. echo .
  22. echo ---------------
  23. ciip-list-commits-per-author