Zulip Chat Archive
Stream: general
Topic: Merge conflict notifications?
Nir Paz (Sep 25 2024 at 12:15):
What do people here do to know about new merge conflicts in their PR's asap? I looked it up and it seems there isn't a setting on github to be notified about it, and since I don't check my branches every day I end up having trivial conflicts blocking a PR for days.
Daniel Weber (Sep 25 2024 at 12:24):
I just look at the list of my PRs every few days to see if there are merge conflicts
Yaël Dillies (Sep 25 2024 at 12:24):
I check my PRs
Arthur Paulino (Sep 25 2024 at 12:26):
If GitHub can't notify you, you can write a script that does it for you on a daily basis:
- Update your
main
branch - For each of your personal branch
b
:
* Create a copyb-copy
* Try to rebaseb-copy
untomain
- Delete all copied branches
If there's a conflict, the corresponding rebase won't succeed automatically
Floris van Doorn (Sep 25 2024 at 13:07):
I usually check my branches (though labels are not as easily visible as in the PR list)
Julian Berman (Sep 25 2024 at 13:07):
Here's how to do it with the GitHub GraphQL API / GH CLI if you want to just run it occasionally:
$ gh api graphql --paginate -F owner=leanprover-community -F name=mathlib4 -f query='
query($endCursor: String, $name: String!, $owner: String!) {
repository(owner: $owner, name: $name) {
pullRequests(first: 100, states: OPEN, after: $endCursor) {
edges {
node {
title
number
url
author { login }
mergeable
state
}
}
}
}
}' | jq -r '.data.repository.pullRequests.edges[] | select(.node.mergeable != "MERGEABLE") | select(.node.author.login == "grunweg") | [.node.author.login, .node.title, .node.url]'
[
"grunweg",
"feat: define measure zero subsets of a manifold",
"https://github.com/leanprover-community/mathlib4/pull/7076"
]
Replace grunweg
with Ynirpaz
obviously.
Nir Paz (Sep 25 2024 at 17:19):
Thanks! I'll make a python script that runs this and emails me when there's a new conflict
Last updated: May 02 2025 at 03:31 UTC