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

fix: avoid edge cases when identifying merge commits. #132

Merged
merged 2 commits into from
Oct 31, 2021

Conversation

neverendingqs
Copy link
Contributor

@neverendingqs neverendingqs commented Oct 29, 2021

There are ways to have a commit start with "Merge branch" even if it's not a merge commit:

  • git commit -m "Merge branch ..."
  • git cherry-pick -m 1 <hash>, where <hash> is a merge commit that starts with "Merge branch"
    • Functionally looks the same as the previous case
  • git merge <hash> -m "Does not start with Merge branch"

By definition, merge commits are commits with more than one parent commit, so this should be a more robust way of identifying merge commits.

Quality notes:

@neverendingqs neverendingqs marked this pull request as ready for review October 29, 2021 20:33
@wyardley
Copy link
Contributor

Agree that the earlier logic is probably a bit simplistic. I had an action at a previous job configured to do essentially this; I forget the logic I used, but this seems sensible.

Copy link
Owner

@amannn amannn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot for looking into this and your tests! This looks reasonable.

Can you however revert the changes to dist/index.js? This file is automatically built on master.

@amannn amannn merged commit f913d37 into amannn:master Oct 31, 2021
@github-actions
Copy link

🎉 This PR is included in version 3.4.6 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

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

Successfully merging this pull request may close these issues.

3 participants