Skip to content

Duplicate Changelog Entries for Merged Branches #510

Closed
@lovetheguitar

Description

@lovetheguitar

Description

Somehow I end up with duplicate changelog entries after merging a MR.
E.g.

## v0.1.2 (2022-05-02)

### Fix

- **release**: do version bump on $RELEASE_BRANCH (if defined) else on $CI_DEFAULT_BRANCH
- **release**: do version bump on $RELEASE_BRANCH (if defined) else on $CI_DEFAULT_BRANCH
- **release**: try to not escape $CI_DEFAULT_BRANCH default value
- **release**: do not run run bump_version/dry_run in tag pipeline

Steps to reproduce

Use gitlab and add some commits to a new branch.
Open a MR and merge it.
Run commitizen on the main branch and get a changelog with duplicated entries.

Current behavior

Duplicate Changelog Entries:

## v0.1.2 (2022-05-02)

### Fix

- **release**: do version bump on $RELEASE_BRANCH (if defined) else on $CI_DEFAULT_BRANCH
- **release**: do version bump on $RELEASE_BRANCH (if defined) else on $CI_DEFAULT_BRANCH
- **release**: try to not escape $CI_DEFAULT_BRANCH default value
- **release**: do not run run bump_version/dry_run in tag pipeline

Desired behavior

No duplicates from merging a MR:

## v0.1.2 (2022-05-02)

### Fix

- **release**: do version bump on $RELEASE_BRANCH (if defined) else on $CI_DEFAULT_BRANCH
- **release**: try to not escape $CI_DEFAULT_BRANCH default value
- **release**: do not run run bump_version/dry_run in tag pipeline

Screenshots

Problem appears to be that commitizen seems to parse the commit body also?!

Git log shows:

Date:   Mon May 2 15:28:31 2022 +0200

    Merge branch 'fix/improve_release_jobs' into 'master'

    fix(release): do version bump on $RELEASE_BRANCH (if defined) else on $CI_DEFAULT_BRANCH

    Closes #4

    See merge request group/ci_templates!10

Date:   Mon May 2 15:12:10 2022 +0200

    fix(release): do version bump on $RELEASE_BRANCH (if defined) else on $CI_DEFAULT_BRANCH

    else dry run version bump
...

Environment

Commitizen Version: 2.24.0
Python Version: 3.8.10 (tags/v3.8.10:3d8993a, May 3 2021, 11:48:03) [MSC v.1928 64 bit (AMD64)]
Operating System: Windows

Thanks for the nice tool. 😃

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions