Is there a script that provides the equivalent to git-bisect for Perforce (p4)? [closed]
Asked Answered
O

1

8

The git-bisect provides hooks to perform a binary search on revisions and figure out which change broke the design. Is there an equivalent script for Perforce? I did SO and Google searches with no luck.

Update Mar 1 2010: As Douglas Leeder correctly pointed out, this is easy with a linear history. However we do have multiple branches with merges going on between branches, so it isn't as trivial as it would be with linear history. Additionally building and testing the code takes some time (hours) so the automatic test would be nice to have it go without my coming back and for running overnight/on the weekened.

Onomastic answered 8/2, 2010 at 18:17 Comment(3)
It's not a script, but you can try importing the p4 history into a local git repo and use git bisect there. See git-scm.com/docs/git-p4. Be warned that on large p4 projects it takes a LONG time to import all history.Dysgraphia
found this: github.com/Ravenbrook/mps/blob/master/tool/p4-bisectVarner
This might do the trick : github.com/hwangcc23/p4bisectSidero
R
-4

I don't think any explicit tool exists, I guess because syncing to a point in history in a centralized source control system is much easier, so no-one has felt the need for a tool.

Just sync back in history till you reach a point where the regression (that you are trying to trace) no longer happens, then sync to history between that point and HEAD, until you find the problem revision.

Renown answered 8/2, 2010 at 22:16 Comment(3)
Perforce history also tends to be more linear.Boser
git bisect is all about doing a binary search between commits, and automatic detection of the defect by writing unit tests. Doing this by hand is pretty much pointless, as on big systems, there may be several hours between builds, and who wants to perform binary search by hand anyway ?Truelove
Even if the history is linear, something similar to git bisect is helpful because you don't have to manually bisect the changelists and check out files.Dysgraphia

© 2022 - 2024 — McMap. All rights reserved.