本文介绍了回购"bisect"用于调试Android吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

git bisect通过计算好"和坏"之间的提交次数并检查中间的更改来工作.不幸的是,这对于repo来说效果不佳,因为一个项目(例如,框架)可能在早期有很多更改,而另一个项目(例如,内核)可能在以后进行了很多更改,因此'repo forall -c"git bisect .. ."可以使一个项目的签出状态比另一个项目早得多.

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.

我的问题是,是否有一种方法可以使git-bisect根据提交的 date 选择其提交,因此在跨项目完成时,我们最有可能将其保留在可以干净地编译的状态.

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.

推荐答案

git bisect不能同时在多个存储库中使用.

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

最好编写自己的脚本来实现跨日期范围的基本二等分算法,并在每个存储库中使用git rev-list -n1 --before <DATEVALUE>以获得git commit来签出与脚本当前被二等分的日期相对应的代码.

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

这篇关于回购"bisect"用于调试Android吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-29 19:35