How can I cut down a git bisect run using file paths?

萝らか妹 提交于 2019-11-30 04:46:42

You have several options here:

  1. Ignoring specific commits

    git bisect contains functionality of skipping commits. You can specify commits, tags, ranges you don't want to test with

    git bisect skip 0dae5f ff049ab ...
    

    Just do this before you git bisect run, and it should skip what you specified.

  2. Specifying folders with broken sources

    You can also cut down commits bisect tests by specifying what folders it should look for problems in. This is done at the beginning of bisect process by supllying additional arguments to git bisect start (quote from standard manual):

    git bisect start -- arch/i386 include/asm-i386
    

    Bisect will only consider commits that touch the folders specified.


If you want to automatically gather commits that touch certain files or folders, you may use git log for that. For example, the following command will give you commit names that modify files in certain folders:

git log --pretty=format:%H  tests/ docs/

And you can supply the result to git bisect skip with use of shell capabilities:

git bisect skip `git log --pretty=format:%H  tests/ docs/`
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!