選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

merge-check.sh 482B

123456789101112131415161718192021222324
  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. command="git --no-pager log --no-color $SINCE..$UNTIL"
  10. # TODO Why do I get whitespace in the beginning of the wc output?
  11. change_count=`$command --oneline|wc -l|tr -d ' '`
  12. if [ "$change_count" = "0" ]
  13. then
  14. echo "No unmerged commits"
  15. exit 0
  16. fi
  17. echo "There are $change_count commits that have not been merged from $UNTIL to $SINCE: "
  18. echo ""
  19. $command
  20. exit 1