Sonmetimes, your dependencies have changing behavior resulting in bugs in your program (which may or may not be bugs upstream), and you want to find out why. This leverages deps.edn/clj's excellent local library support to bisect the dependency, even if it's (in my case, martian) a library with (1) multiple internal sub-projects (2) most of which leiningen (so you can't just :local/root and call it a day).
Here's an example run:
martian on HEAD (e5fc36d) via :coffee: v17.0.6
❯ git bisect start
status: waiting for both good and bad commits
We declare the current commit good:
martian on HEAD (e5fc36d) (BISECTING) via :coffee: v17.0.6
❯ git bisect good
status: waiting for bad commit, 1 good commit known
We declare HEAD
bad:
martian on HEAD (e5fc36d) (BISECTING) via :coffee: v17.0.6
❯ git bisect bad master
Bisecting: 13 revisions left to test after this (roughly 4 steps)
[20883947e630725ff1dcb0df514c017dfc4e13e0] Adding London Clojurians video link
Finally we run the below script to find the offending commit automatically:
martian on HEAD (2088394) (BISECTING) via :coffee: v17.0.6
❯ git bisect run -- bb --file /Users/lvh/Projects/steak-knives/bisect_dep.clj
....
51 tests, 217 assertions, 0 failures.
bec567941ef73a8e8b1444019ee54034271a1242 is the first bad commit
commit bec567941ef73a8e8b1444019ee54034271a1242
Author: Oliver Hine <git@oliy.co.uk>
Date: Sat Jul 22 15:00:48 2023 +0100
Terminate when vcr playback finds a response, closes #181
vcr/src/martian/vcr.cljc | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
bisect found first bad commit%