# How to properly bisect Julia's git history in search of bugs?

**URL:** <https://discourse.julialang.org/t/how-to-properly-bisect-julias-git-history-in-search-of-bugs/75193>\
**Category:** Internals & Design\
**Tags:** git, bisect\
**Created:** [January 25, 2022, 6:11pm UTC](https://discourse.julialang.org/t/how-to-properly-bisect-julias-git-history-in-search-of-bugs/75193 "2022-01-25T18:11:19Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Krastanov](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/krastanov/32/6817_2.png) [@Krastanov](https://discourse.julialang.org/u/Krastanov)\
**Post date:** [January 25, 2022, 6:11pm UTC](https://discourse.julialang.org/t/how-to-properly-bisect-julias-git-history-in-search-of-bugs/75193/1 "2022-01-25T18:11:19Z")

</div>

I noticed that current nightly is slower to import packages than 1.7.1. Julia is easy enough to compile from scratch, so I tried to use git bisect to find when that happened. Naively I tried bisecting between `v1.7.1` and `master` but the bisecting commit was at a location where Julia was broken (Julia compiled, but package precompiles/imports did not work).

Are there any rules of thumb of how to use `bisect` with julia? I did use the `--first-parent` flag in the hope of checking only merge commits, not descending into some arbitrary commit midway through a pull request. I think a mistake I made is to use `v1.7.1` as it is branched out away from the main git history, so bisect had to look at the common root. But I do not know the julia branching conventions to know where to start the bisect.

---

<div class="post-metadata">

**Author:** ![Oscar\_Smith](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/oscar_smith/32/25343_2.png) [@Oscar\_Smith](https://discourse.julialang.org/u/Oscar_Smith)\
**Post date:** [January 25, 2022, 6:33pm UTC](https://discourse.julialang.org/t/how-to-properly-bisect-julias-git-history-in-search-of-bugs/75193/2 "2022-01-25T18:33:39Z")

</div>

I’m not sure if this is the solution to your problem, but one thing I’ve found helps is running `make cleanall` before `make`. Especially when jumping over large numbers of commits, this helps a lot.

Also, you can bisect with `HEAD~400` for arbitrary values of `400` to make sure you are looking at a linear set of commits.

---

<div class="post-metadata">

**Author:** ![Krastanov](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/krastanov/32/6817_2.png) [@Krastanov](https://discourse.julialang.org/u/Krastanov)\
**Post date:** [January 25, 2022, 9:27pm UTC](https://discourse.julialang.org/t/how-to-properly-bisect-julias-git-history-in-search-of-bugs/75193/3 "2022-01-25T21:27:40Z")

</div>

Yes, it turns out the issue has nothing to do with a broken mid-PR julia, rather it was just a dirty `make`. `make cleanall` is enough for me to successfully use `git bisect` now.

---

<div class="post-metadata">

**Author:** ![Krastanov](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/krastanov/32/6817_2.png) [@Krastanov](https://discourse.julialang.org/u/Krastanov)\
**Post date:** [January 26, 2022, 4:06am UTC](https://discourse.julialang.org/t/how-to-properly-bisect-julias-git-history-in-search-of-bugs/75193/4 "2022-01-26T04:06:57Z")

</div>

For those interested, it seems the slowdown is not due to any one particular thing. `@time using Makie` varied significantly between 1.7.1 and now, with multiple jumps in both directions.
