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

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

Open
microbit-carlos opened this issue Apr 17, 2024 · 0 comments
Open
Assignees

Comments

@microbit-carlos
Copy link
Collaborator

microbit-carlos commented Apr 17, 2024

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:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant