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 834B

123456789101112131415161718192021222324252627282930313233343536
  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 in $UNTIL that are missing from $SINCE"
  20. echo $message
  21. echo ""
  22. $command
  23. echo "##teamcity[testFailed name='$testname' message='$message']"
  24. fi
  25. echo "##teamcity[testFinished name='$testname']"
  26. # Give non-ok exit status
  27. if [ "$change_count" != "0" ]
  28. then
  29. exit 1
  30. fi