repo 'bisect' for debugging Android?
Asked Answered
G

2

9

git bisect works by counting the number of commits between 'good' and 'bad' and checking out the change in the middle. Unfortunately this wouldn't work well for repo because one project (e.g. framework) may have a lot of changes early on and another project (e.g. kernel) may have a bunch of later changes, so 'repo forall -c "git bisect ..."' could have one project checked out in a state a lot older than an other.

My question is whether there is a way to get git-bisect to choose its commit based on the date of the commit, so when done across projects we're most likely to be left in a state that compiles cleanly.

Grivation answered 14/3, 2012 at 22:59 Comment(0)
K
6

git bisect is not designed to be used across multiple repositories simultaneously.

You'd probably be better of writing your own script that implements a basic bisection algorithm across date ranges, and use git rev-list -n1 --before <DATEVALUE> in each repository to obtain a git commit to check out corresponding to whatever date your script is currently bisecting.

Here's an example bisection script that I had written for another purpose. Note that it is not specifically designed for your situation; it's just an example of implementing bisection:

https://gist.github.com/2040290

Kanal answered 14/3, 2012 at 23:8 Comment(2)
Hm that looks like a workable solution. For this particular bug it isn't worth my time, but I think I should work on it on my down time. Thanks :)Grivation
Another thing to consider is that each individual component was probably updated independently from merging with the total distribution (i.e. changes made on the same day may never have been built together). I suspect you'll be better off tracking down the failing component and just concentrating on bisecting that.Pulling
A
6

Someone has coded such a script up: https://github.com/tdm/android-scripts/blob/master/repo-bisect

Archduke answered 3/9, 2014 at 7:46 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.