Finally, GitHub could provide a more helpful pull request closing message.Questioning an unexpected merge of your PR is always OK. We caught this issue immediately because the merge didn’t make sense. I definitely don’t do this, but I do skim the commit titles, I’ll keep an eye out for merge & reverts after this! Review pull requests commit by commit.If a git mistake isn’t pushed, hard reset to before the mistake instead of reverting.Obviously this would avoid the whole problem, but mistakes happen! Don’t accidentally merge other branches.This is a team preference thing, and we actually usually do, but in this case didn’t. Here’s a couple of ways to avoid this happening, or at least catch the issue: The potential for losing work or not knowing the status of code is definitely in this albeit niche situation. It’s very easy to imagine a situation where the author of the automatically closed PR sees their PR has been “merged”, and assumes their work is now, well, merged. Additionally, the person who unintentionally closed this PR isn’t notified that their merge has had side-effects, so this could result in lost work. Currently, the person who accidentally did the revert and merge isn’t mentioned at all, instead the merger of the branch is “blamed”, and the unusual events aren’t flagged anywhere. The automatically closed PR should absolutely say WHY it has been closed. The issue is hidden if you aren’t specifically looking for a merge and revert. The part I find particularly concerning is how difficult it is to trace this. However, if you’re in a larger team, with other pull requests being merged and created between these two, it definitely isn’t as clear! Additionally, this merge & revert may have happened days/weeks ago, with many commits since. When looking at the commits on a fresh repo, this explanation might have seemed immediately obvious. Otherwise the eventual merge might actually do nothing, leading to the code never being included in the main branch (because it was reverted in branchA). Now it becomes obvious that all of big feature ( branchB)’s commits are merged into small feature ( branchA), but none of the code remains!īecause of this, closing the pull request is a reasonable thing for GitHub to do. This is attributed to whoever merged the small PR! GitHub notices every commit in big feature PR is now merged in (technically), so closes the PR. Every single commit from big feature PR is included, with a revert commit at the end.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |