This commit is contained in:
Hugo 2024-09-20 00:26:49 -04:00 committed by GitHub
commit 88d2a04059
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -243,3 +243,29 @@ error_session:
return NULL;
}
```
## Bisecting
When bisecting, it is often necessary to build older commits with their
contemporary version of wlroots:
```python
#!/usr/bin/env python3
#
# Check out the wlroots commit that was the current master at the time that the current
# sway HEAD was committed. Requires pygit2. E.g.: apk add py3-pygit2
import pygit2
sway = pygit2.Repository(".")
head = sway.revparse_single("HEAD")
sway_time = head.commit_time
wlroots = pygit2.Repository("subprojects/wlroots")
master = wlroots.revparse_single("master")
for commit in wlroots.walk(master.id, pygit2.enums.SortMode.TIME):
if commit.commit_time < sway_time:
break
wlroots.checkout_tree(commit)
```