bisect-create 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. #!/bin/sh
  2. set -e
  3. if test "bisect-create" = "`basename $0`" ; then
  4. echo tools/ffbisect created
  5. git show master:tools/bisect-create > tools/ffbisect
  6. chmod u+x tools/ffbisect
  7. exit 1
  8. fi
  9. if ! git show master:tools/bisect-create | diff - tools/ffbisect > /dev/null ; then
  10. echo updating tools/ffbisect script to HEAD.
  11. git show master:tools/bisect-create > tools/ffbisect
  12. chmod u+x tools/ffbisect
  13. tools/ffbisect $*
  14. exit 0
  15. fi
  16. case "$1" in
  17. need)
  18. case $2 in
  19. ffmpeg|ffplay|ffprobe)
  20. echo $2.c >> tools/bisect.need
  21. ;;
  22. esac
  23. ;;
  24. start|reset)
  25. echo . > tools/bisect.need
  26. git bisect $*
  27. ;;
  28. skip)
  29. git bisect $*
  30. ;;
  31. good|bad)
  32. git bisect $*
  33. until ls `cat tools/bisect.need` > /dev/null 2> /dev/null; do
  34. git bisect skip || break
  35. done
  36. ;;
  37. run)
  38. shift # remove "run" from arguments
  39. git bisect run sh -c "ls \`cat tools/bisect.need\` > /dev/null 2> /dev/null || exit 125; \"\$@\"" sh "$@"
  40. ;;
  41. esac