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.

merge-check.sh 859B

12345678910111213141516171819202122232425262728293031
  1. #!/bin/bash
  2. SINCE=$1
  3. UNTIL=$2
  4. if [ "$SINCE" = "" ] || [ "$UNTIL" = "" ]
  5. then
  6. echo "Usage: $0 <since> <until>"
  7. exit 3
  8. fi
  9. testname="merge check for `pwd|sed "s/.*\///"`"
  10. echo "##teamcity[testStarted name='$testname' captureStandardOutput='true']"
  11. command="git --no-pager log --no-color $SINCE..$UNTIL"
  12. # TODO Why do I get whitespace in the beginning of the wc output?
  13. change_count=`$command --oneline|wc -l|tr -d ' '`
  14. if [ "$change_count" = "0" ]
  15. then
  16. echo "No unmerged commits"
  17. else
  18. command="$command --format=short"
  19. message="There are $change_count commits that have not been merged from $UNTIL to $SINCE"
  20. echo $message
  21. echo ""
  22. $command
  23. details=`$command|perl -p -e 's/\n/|n/' | sed "s/['\|\[\]]/|\&/g"`
  24. echo "##teamcity[testFailed name='$testname' message='$message' details='|n$details']"
  25. fi
  26. echo "##teamcity[testFinished name='$testname']"