Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

An example of using phpunit in git-bisect, includes a wrapper.

branch: develop

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 app
Octocat-spinner-32 tests
Octocat-spinner-32 vendor
Octocat-spinner-32 web
Octocat-spinner-32 .gitignore
Octocat-spinner-32 .gitmodules
Octocat-spinner-32 README.textile
Octocat-spinner-32 bisect-phpunit.sh
Octocat-spinner-32 phpunit.xml.dist
README.textile

What is git-bisect?

git-bisect is a command tool to help finding commits that change a good state.

How to use git-bisect?

This example uses git bisect in conjunction with phpunit to check when the testsuite breaks.

Define the “good” state

To define the “good” state, we choose phpunit. This is the testsuite run. If it fails, the commits state is “bad”.

Set up

The following commands will start the actual work with git-bisect.

  • git bisect start
  • git bisect bad

This will start the bisect search and mark the current version as “bad”.

Knowing the good version

  • git bisect good SHA1

This will mark the last known “good” state on the commit hash SHA1.

Automate it!

  • git bisect run ./bisect-phpunit.sh

This will issue bisect to use the phpunit command line to check for a good state for each commit.
The script will wrap the exit codes of phpunit to the correct ones to operate with git-bisect.

Try-it Out

Using this project you can use these commands to actually test it.

  • git bisect start
  • git bisect bad #ABadCommitSha (HEAD is bad, so we can leave it out)
  • git bisect good 0fef4d40fec8ba1d1de73d8f13739e6c890e2223
  • git bisect run ./bisect-phpunit.sh

The result will be this commit:b27af3d6ff6da22e02850d6e61d966db438847d7.

Something went wrong with that request. Please try again.