Skip to content

changelog-merge

changelog-merge helps avoid conflicts when contributors update a Keep a Changelog file on different branches. New entries from both branches are kept. Incompatible changes to the same entry produce conflicts that you resolve as usual.

Enable it in your project:

devenv.nix
{
changelog-merge.enable = true;
}

If your project uses an older nixpkgs pin that does not include changelog-merge, update it:

Terminal window
devenv update nixpkgs

Files named CHANGELOG.md now use changelog-merge automatically when you merge, rebase, or cherry-pick inside your devenv environment:

Terminal window
devenv shell
git merge my-branch

This also works when your environment is activated through direnv. Continue editing your changelog directly.

To include changelogs with other names, add their paths or patterns:

devenv.nix
{
changelog-merge.enable = true;
git.attributes = [ "docs/CHANGES.md merge=changelog-merge" ];
}

Each contributor or CI job performing merges needs to use the devenv environment. Merges through the GitHub or GitLab web interface do not use changelog-merge.