lancaster-university / codal-microbit-v2

CODAL target for the micro:bit v2.x series of devices
MIT License
41 stars 50 forks source link

Bloatly CI: Issue getting the parent commit on a merge commit #426

Open microbit-carlos opened 2 months ago

microbit-carlos commented 2 months ago

A similar CI script has been added to the microbit-dal project and the merge commit failed due to the git command used to get the parent commit returning two parents instead of one: https://github.com/lancaster-university/microbit-dal/actions/runs/8708366961/job/23885570183

error: pathspec 'd1460bdec7a97f7332e16660b731e8e7de136463' did not match any file(s) known to git

The git command used to get the parent commit is: git log --pretty=%P -n 1 HEAD^0 Which for that merge commit would return:

602153e9199c28c08fd2561ce7b43bf64e9e7394 d1460bdec7a97f7332e16660b731e8e7de136463

As shown in the Markdown created to summarise the result: https://github.com/lancaster-university/microbit-dal/actions/runs/8708366961

# Bloaty comparison with parent commit
Parent commit: [602153e9199c28c08fd2561ce7b43bf64e9e7394 d1460bdec7a97f7332e16660b731e8e7de136463](https://github.com/lancaster-university/microbit-dal/commit/602153e9199c28c08fd2561ce7b43bf64e9e7394 d1460bdec7a97f7332e16660b731e8e7de136463)

So we need a way to pick a single parent commit. In this case we should grab the commit hash from the main branch, not the one from the feature branch.

The patch with the fix should be applied here and in the microbit-dal repository: