Closed kilobyte closed 5 years ago
Here's an idea: let's check if the HEAD commit is a merge. If it is, we can compare its parents (there will be two unless someone plays with octopus — which is not used within our workflow). Otherwise, we're building an unmerged branch, and in this case we can compare with the last merge.
In other words:
git log --pretty='%P' -1
git log --merges --pretty='%H -1
As you can see from the messages triggered by a private branch, this works for me.
utils/check_sdk_version.py
checks the difference between HEAD and master. This worked so far only because this script is a couple of months old, and hasn't yet been on a branch that receives pull requests not targetted at master. But, once we release 1.7...Thus, it needs to somehow guess what branch we're on. And, a commit that changes
master → stable-1.7
won't work well as it'd need to be undone on master, and merging/cherry-picking isn't reliable when such changes go back and forth. Then, someone may want to send a pull request towards a topic branch...