René's URL Explorer Experiment


Title: Inconsistent changelog behavior based on rev-range & merge strategy · Issue #660 · commitizen-tools/commitizen · GitHub

Open Graph Title: Inconsistent changelog behavior based on rev-range & merge strategy · Issue #660 · commitizen-tools/commitizen

X Title: Inconsistent changelog behavior based on rev-range & merge strategy · Issue #660 · commitizen-tools/commitizen

Description: Description We are running into inconsistent behavior of the changelog command depending on the rev-range used when we have a branch with different merge commits. The reason is that when generating the changelog, commitizen is using the ...

Open Graph Description: Description We are running into inconsistent behavior of the changelog command depending on the rev-range used when we have a branch with different merge commits. The reason is that when generating...

X Description: Description We are running into inconsistent behavior of the changelog command depending on the rev-range used when we have a branch with different merge commits. The reason is that when generating...

Opengraph URL: https://github.com/commitizen-tools/commitizen/issues/660

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Inconsistent changelog behavior based on rev-range \u0026 merge strategy","articleBody":"### Description\r\n\r\nWe are running into inconsistent behavior of the changelog command depending on the rev-range used when we have a branch with different merge commits.\r\n\r\nThe reason is that when generating the changelog, commitizen is using the author-date-order ([see here](https://github.com/commitizen-tools/commitizen/blob/master/commitizen/commands/changelog.py#L147-L149))\r\n\r\nThis means that in the scenario where you merge using a non-linear merge strategy (which is often the default), then the changelog command become inconsistent. (See examples below)\r\n\r\n### Steps to reproduce\r\n\r\nHere is an example (you can find this example in a test github repo [here](https://github.com/sacha-c/commitizen_changelog_bug_example):\r\n\r\n1. Create a main branch with an initial commit with commitizen setup \u0026 a `cz bump` commit v0.1.0\r\n2. Create mr 1 off of main \u0026 make a commit\r\n3. Create mr2 off of main \u0026 make a commit\r\n4. Merge mr1 into main with `git merge mr1`\r\n5. Run `cz bump` (tags v0.2.0)\r\n6. Merge mr2 into main with `git merge mr2`\r\n7. Run `cz bump` (tags v0.3.0)\r\n\r\nWe end up with the following git tree:\r\n```bash\r\n(venv) ***@*** commitizen_changelog_bug_example % git log --graph --oneline --all\r\n* a48e0e5 (HEAD -\u003e main, tag: v0.3.0, origin/main) bump: version 0.2.0 → 0.3.0\r\n*   d247ed7 Merge branch 'mr2'\r\n|\\  \r\n| * 36b659e (origin/mr2, mr2) feat: mr2\r\n* | 7b97d2c (tag: v0.2.0) bump: version 0.1.0 → 0.2.0\r\n* | 82f3844 (origin/mr1, mr1) feat: mr1\r\n|/  \r\n* 1162498 (tag: v0.1.0) bump: version 0.0.1 → 0.1.0\r\n* e76ef76 feat: initial commit\r\n```\r\n\r\nThe expectation now is for `cz changelog v0.3.0` \u0026 `cz changelog v0.2.0..v0.3.0` to show the same content for `v0.3.0`, but it is not the case. Because commitizen orders commits by author_date, when using a rev-range it is ordering commits by date, which makes the commit from `mr2` erroneously appear in v0.2.0. However when using a single `rev` it appears as expected.\r\nHere is the output of the different commands\r\n\r\n```bash\r\n(venv) ***@*** commitizen_changelog_bug_example % cz changelog v0.3.0 --dry-run\r\n## v0.3.0 (2023-01-26)\r\n\r\n### Feat\r\n\r\n- mr2\r\n\r\n(venv) ***@*** commitizen_changelog_bug_example % cz changelog v0.2.0 --dry-run\r\n## v0.2.0 (2023-01-26)\r\n\r\n### Feat\r\n\r\n- mr1\r\n\r\n(venv) ***@*** commitizen_changelog_bug_example % cz changelog v0.2.0..v0.3.0 --dry-run\r\n## v0.3.0 (2023-01-26)\r\n\r\n## v0.2.0 (2023-01-26)\r\n\r\n### Feat\r\n\r\n- mr2\r\n- mr1\r\n```\r\n\r\n### Current behavior\r\n\r\nRunning `cz changelog v0.3.0` \u0026 `cz changelog v0.2.0..v0.3.0` gives a different output under the *v0.3.0* entry\r\n\r\n### Desired behavior\r\n\r\nRunning `cz changelog v0.3.0` \u0026 `cz changelog v0.2.0..v0.3.0` gives the same output under the *v0.3.0* entry\r\n\r\n### Screenshots\r\n\r\n_No response_\r\n\r\n### Environment\r\n\r\nCommitizen Version: 2.40.0\r\nPython Version: 3.10.9 (main, Dec 27 2022, 11:11:24) [Clang 14.0.0 (clang-1400.0.29.202)]\r\nOperating System: Darwin\r\n\r\n### Proposed solutions/ideas\r\nI *think* the solution would be to change\r\n```diff\r\ncommits = git.get_commits(\r\n-    start=start_rev, end=end_rev, args=\"--author-date-order\"\r\n+    start=start_rev, end=end_rev, args=\"--topo-order\"\r\n)\r\n```\r\n\r\nBut I suppose this may be breaking to existing changelogs, so I wonder what is your take on this?","author":{"url":"https://github.com/sacha-c","@type":"Person","name":"sacha-c"},"datePublished":"2023-01-26T09:52:42.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":7},"url":"https://github.com/660/commitizen/issues/660"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:dba9572d-49a2-83fd-d8ae-a3907e777a7b
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id8E14:307653:9545786:C185BAC:69772222
html-safe-nonce7f107933c2391fc00f880deca8e74c79663c3da285e3e1496b8e7afe9d96431d
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4RTE0OjMwNzY1Mzo5NTQ1Nzg2OkMxODVCQUM6Njk3NzIyMjIiLCJ2aXNpdG9yX2lkIjoiODEzNjM3MjcyMDAyODI5NTcxNCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmacdaf7ae3f3e51e98b923cb715c8327f4f14a5f5920450cf637f08f36f6dc82b75
hovercard-subject-tagissue:1557881447
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/commitizen-tools/commitizen/660/issue_layout
twitter:imagehttps://opengraph.githubassets.com/6d484d22aebc1769abaffa907f71304877ed9f9a6f5b9e4b383ec253dd0ecef2/commitizen-tools/commitizen/issues/660
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/6d484d22aebc1769abaffa907f71304877ed9f9a6f5b9e4b383ec253dd0ecef2/commitizen-tools/commitizen/issues/660
og:image:altDescription We are running into inconsistent behavior of the changelog command depending on the rev-range used when we have a branch with different merge commits. The reason is that when generating...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamesacha-c
hostnamegithub.com
expected-hostnamegithub.com
None01d198479908d09a841b2febe8eb105a81af2af7d81830960fe0971e1f4adc09
turbo-cache-controlno-preview
go-importgithub.com/commitizen-tools/commitizen git https://github.com/commitizen-tools/commitizen.git
octolytics-dimension-user_id62252524
octolytics-dimension-user_logincommitizen-tools
octolytics-dimension-repository_id106127589
octolytics-dimension-repository_nwocommitizen-tools/commitizen
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id106127589
octolytics-dimension-repository_network_root_nwocommitizen-tools/commitizen
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
releasef752335dbbea672610081196a1998e39aec5e14b
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/commitizen-tools/commitizen/issues/660#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fcommitizen-tools%2Fcommitizen%2Fissues%2F660
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub SparkBuild and deploy intelligent appshttps://github.com/features/spark
GitHub ModelsManage and compare promptshttps://github.com/features/models
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fcommitizen-tools%2Fcommitizen%2Fissues%2F660
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=commitizen-tools%2Fcommitizen
Reloadhttps://github.com/commitizen-tools/commitizen/issues/660
Reloadhttps://github.com/commitizen-tools/commitizen/issues/660
Reloadhttps://github.com/commitizen-tools/commitizen/issues/660
commitizen-tools https://github.com/commitizen-tools
commitizenhttps://github.com/commitizen-tools/commitizen
Please reload this pagehttps://github.com/commitizen-tools/commitizen/issues/660
Notifications https://github.com/login?return_to=%2Fcommitizen-tools%2Fcommitizen
Fork 314 https://github.com/login?return_to=%2Fcommitizen-tools%2Fcommitizen
Star 3.3k https://github.com/login?return_to=%2Fcommitizen-tools%2Fcommitizen
Code https://github.com/commitizen-tools/commitizen
Issues 125 https://github.com/commitizen-tools/commitizen/issues
Pull requests 27 https://github.com/commitizen-tools/commitizen/pulls
Discussions https://github.com/commitizen-tools/commitizen/discussions
Actions https://github.com/commitizen-tools/commitizen/actions
Projects 0 https://github.com/commitizen-tools/commitizen/projects
Security 0 https://github.com/commitizen-tools/commitizen/security
Insights https://github.com/commitizen-tools/commitizen/pulse
Code https://github.com/commitizen-tools/commitizen
Issues https://github.com/commitizen-tools/commitizen/issues
Pull requests https://github.com/commitizen-tools/commitizen/pulls
Discussions https://github.com/commitizen-tools/commitizen/discussions
Actions https://github.com/commitizen-tools/commitizen/actions
Projects https://github.com/commitizen-tools/commitizen/projects
Security https://github.com/commitizen-tools/commitizen/security
Insights https://github.com/commitizen-tools/commitizen/pulse
New issuehttps://github.com/login?return_to=https://github.com/commitizen-tools/commitizen/issues/660
New issuehttps://github.com/login?return_to=https://github.com/commitizen-tools/commitizen/issues/660
Inconsistent changelog behavior based on rev-range & merge strategyhttps://github.com/commitizen-tools/commitizen/issues/660#top
type: bughttps://github.com/commitizen-tools/commitizen/issues?q=state%3Aopen%20label%3A%22type%3A%20bug%22
https://github.com/sacha-c
https://github.com/sacha-c
sacha-chttps://github.com/sacha-c
on Jan 26, 2023https://github.com/commitizen-tools/commitizen/issues/660#issue-1557881447
see herehttps://github.com/commitizen-tools/commitizen/blob/master/commitizen/commands/changelog.py#L147-L149
herehttps://github.com/sacha-c/commitizen_changelog_bug_example
type: bughttps://github.com/commitizen-tools/commitizen/issues?q=state%3Aopen%20label%3A%22type%3A%20bug%22
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.