semantic-release: Semantic-release does not handle squash-merges.

Current behavior

[Semantic release]: Analyzing commit: Squashed commit of the following:

commit 74e6b0087331e5947fd8ba388e75d4d1900dfd44
Author: Jason Walton <dev@lucid.thedreaming.org>
Date:   Thu May 17 11:21:50 2018 -0400

    fix: More fixes

commit b894885ae467975226e81080a35625d247796960
Author: Jason Walton <dev@lucid.thedreaming.org>
Date:   Thu May 17 11:13:25 2018 -0400

    fix: Fix
[Semantic release]: The commit should not trigger a release

Expected behavior

If a commit starts with “Squashed commit of the following:”, semantic-release should parse out all the individual commit messages and analyze them individually. The above contains two “fix” commits, so it should trigger a patch release.

Environment

  • semantic-release version: 15.4.0
  • CI environment: Travis
  • Plugins used: None
  • semantic-release configuration: Default
  • CI logs: n/a

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 2
  • Comments: 21 (6 by maintainers)

Most upvoted comments

https://semantic-release.gitbook.io/semantic-release/support/troubleshooting#squashed-commits-are-ignored-by-semantic-release

This is a poor stance to take. Not everyone fits into your idea of a perfect workflow.

While I use atomic commits in my personal work, professionally it is required that we squash our commits. I want to use semantic release professionally but I can’t because we don’t fit your cookie cutter workflow.

Show a bit of empathy and please reconsider your stance. There is more than one way to merge

Please, revive this thread and think about parsing also the squashed merges 😦

https://semantic-release.gitbook.io/semantic-release/support/troubleshooting#squashed-commits-are-ignored-by-semantic-release

This is a poor stance to take. Not everyone fits into your idea of a perfect workflow.

While I use atomic commits in my personal work, professionally it is required that we squash our commits. I want to use semantic release professionally but I can’t because we don’t fit your cookie cutter workflow.

Show a bit of empathy and please reconsider your stance. There is more than one way to merge

100% agree

☝🏼 Exactly. I ran into this today. The squashed commits are omitted by default and couldn’t find any matching option to enable that. Also, https://github.com/semantic-release/commit-analyzer/pull/66 was closed.

Hi guys. I’ve implemented a tiny wrapper for commit-analyzer and release-notes-generator which works with squashed MRs. You can check it out: semantic-release-unsquash I’ve tested it on my project and it works like a charm

Was this ever implemented? I just did a sqash merge and got no release

We’ve been attempting to migration from the semantic-release-gitlab plugin and have all manor of problems. This being one of them.

I’m not entirely sure how semantic-release-gitlab managed to make squashed commits work but it did trigger the appropriate releases as if the merge had not been squashed.

Would support be reconsidered? or has anyone come up with a plugin that offers similar behaviour?

We now have many developers that are used to being able to squash merge through gitlab and it’s second nature.

The troubleshooting guide says

A commit should contain exactly one self-contained functional change and a functional change should be contained in exactly one commit.

Although I like this as a general principle, it just isn’t always realistic; sometimes you need to do a big refactor that fixes several issues at once and you want multiple bullet points in the changelog for it.

@romap0 great work on https://github.com/romap0/semantic-release-unsquash! Let me know if you ever need help maintaining it!

Thank you, @romap0. Your semantic-release-unsquash plugin is solving this perfectly for me.

No, you’re right, what I just asked makes no sense. I’ve been spending too much time in sourcetree, where it splits out the “merged” branch into a different line that joins in at the merge commit. 😛

On Thu, May 17, 2018, 18:42 Gregor Martynus notifications@github.com wrote:

How does a regular merge work?

I’m not sure what you mean? semantic-release only runs on your main branch’s CI builds. It doesn’t matter if new commits are coming from a PR or have been pushed to the main branch directly. It just goes through all new commits and calculates version & changelogs based on that

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/semantic-release/semantic-release/issues/792#issuecomment-390036423, or mute the thread https://github.com/notifications/unsubscribe-auth/ABsF-1z6dpz17Q3F7Yrcnk7I7SPex7LIks5tzfzIgaJpZM4UDSs_ .