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
[changelog] Skip merge commits in changelog #858
Comments
You can achieve this already by:
JReleaser itself does it for its own changelog https://github.com/jreleaser/jreleaser/blob/main/jreleaser.yml |
@aalmiray thanks for the response! I am failing to find a use case where merge commits are necessary for the change log, so it would be nice if we had a configuration option that would automatically hide that away or simply assume that merge commits are bad and should never be used. For the second case, I have put a small fix here: dde2e22 The fix works, but I've been struggling a bit to create a test that simulates merge commits in the existing WDYT? |
I understand your concern and I agree that most times merge commits could be omitted from the changelog. Then again I'd ask, why are there merge commits in the first case given that one could use rebase or squash to merge PRs? The fact that a merge commit exists may be to keep track of the original info in such way that seeing a merge commit in the log makes sense. However, skipping the merge commit in the changelog also makes sense. This is why JReleaser offers the option to skip them but you must explicitly configure it so. I think keeping this behavior explicit is best, for now. This decision may be revised in the future as more feedback is gathered on changelog formatting and usage. This being said, if the default behavior would be to skip such commits there must be a way to disable it just in case someone requires merge commits in the changelog. Your fix would technically work but it's not configurable. Moreover, does the fix apply solely to merge commits? Or are there any other types of commits for which the condition you put in place would also trigger? |
Yes, some open source projects disable rebase and squash commits and allow merge commits only for this reason mainly.
Although I understand your point, I find it very unlikely that someone would want that, since a merge commit represents nothing but a synchronization point between two branches.
That's a good question. AFAIK commits with more than 1 parent are considered merge commits but I'm not 100% sure if that matches other commit types. |
Is your feature request related to a problem? Please describe.
It's annoying that merge commits are included in the output of
mvn jreleaser:changelog
Describe the solution you'd like
Never include merge commits in the changelog
Describe alternatives you've considered
Filter out Revcommits in
org.jreleaser.sdk.git.ChangelogGenerator
that are merge commitsAdditional context
Original output:
Desired output:
The text was updated successfully, but these errors were encountered: