Pull request .patch file being faulty and differing from the actual merged commit? #146416
Replies: 1 comment
-
💬 Your Product Feedback Has Been Submitted 🎉 Thank you for taking the time to share your insights with us! Your feedback is invaluable as we build a better GitHub experience for all our users. Here's what you can expect moving forward ⏩
Where to look to see what's shipping 👀
What you can do in the meantime 💻
As a member of the GitHub community, your participation is essential. While we can't promise that every suggestion will be implemented, we want to emphasize that your feedback is instrumental in guiding our decisions and priorities. Thank you once again for your contribution to making GitHub even better! We're grateful for your ongoing support and collaboration in shaping the future of our platform. ⭐ |
Beta Was this translation helpful? Give feedback.
-
Select Topic Area
Bug
Body
I am cherry-picking commits from a repo into a diverging fork for debugging purposes. I am doing this by appending
.patch
to the pull request URL and processing this withgit am -3
.This has worked great so far until I had to cherry-pick this patch: https://patch-diff.githubusercontent.com/raw/CleverRaven/Cataclysm-DDA/pull/72063.patch
Pay special attention to the file
data/json/items/id_cards.json
, the patch contains this:Now check the actual changes in this pull request at https://github.com/CleverRaven/Cataclysm-DDA/pull/72063/files#diff-310c3695ba3e4a5c18a680b21bae7fc5642f5da304d4af8356ab1b70aa8a04fdR319 - there is no addition like above. This appears to have been moved in a prior commit, to
flags.json
, but this patch file never caught up and has duplicated code, causing issues.The actual squashed and merged commit, the patch file is at https://github.com/CleverRaven/Cataclysm-DDA/commit/f651a526a11581c9e4ab3921b2830fef20010266.patch, looks correct, like the changes tab in the PR I linked.
This has been driving me nuts and feels like a bug. Is this a bug or am I doing something wrong? If this is a bug, I know this will probably not be fixed immediately and in this case I have two more questions:
As I said above, the workaround is grabbing the patch file off the actual merged commit. Is there a way, e.g using an API call or similar, to find this commit? Having to manually find that commit every time is going to be tedious and I'd like to automate that.I dug into documentation again and found it out by myself, the thing I was looking for ismerge_commit_sha
: https://docs.github.com/en/rest/pulls/pulls?apiVersion=2022-11-28#get-a-pull-requestBeta Was this translation helpful? Give feedback.
All reactions