Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include wlroots checkout helper for bisecting #8347

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if using the time is always the right thing here, have you encountered any issue with that so far?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if using the time is always the right thing here

In this context, TIME is the commit time specifically, which is the time when the commit was merged into the master branch.

The time shown by git log is the author time. Using that one does not work; it yields bogus results since some commits are authored months before being merged.

have you encountered any issue with that so far?

When wlroots version N is released, the version is immediately bumped to N+1. From that point on, meson will complain that it has wlroots N+1 but expects version N.

In my experience bisecting sway, very few commits have this issue. Usually I skip these. If you need to dive into that range, you'll can just check out the wlroots tag.

if commit.commit_time < sway_time:
break

wlroots.checkout_tree(commit)
```