There is a project now. During one day of development, a bug was introduced by an engineer. The system could not be accessed concurrently, and the database connection was directly locked. The project uses the Java platform and performs version management on svn. I didn’t want to code review versions one by one, so I thought of the most violent half version search method. Of course, doing it on svn means checking out versions one by one. For such a large project, it is also very time-consuming. At this time, git-bisect It's my only choice.
First, export the svn library as a git library:
$ git svn clone -s http://svn.xxx.com/svn/xxxxx
Then, start git bisect:
$ git bisect start
Mark the current version as an error :
$ git bisect bad
Find the version from the previous day, make a tag (tag20090106), test it to be correct, mark it:
$ git bisect good tag20090106
At this time, git will tell you that an intermediate version has been selected. Start compiling and testing. If it fails, execute:
$ git bisect bad
git will use the half-way method to find an intermediate version, start compiling and testing, if it passes, execute:
$ git bisect good
git will continue Locate the revision until you finally locate a version that introduces errors. Then analyze the cause and find the engineer who caused the trouble to PK. After the PK is completed, come back and call it a day and execute:
$ git bisect reset
Git will return to the current HEAD.