dpkg-mergechangelogs(1)

πŸ’… dpkg-mergechangelogs β€” the debian/changelog 3-way merge queen

okay so real talk, this is a dpkg suite page for dpkg-mergechangelogs, and it's the tool you call when you need a 3-way merge of debian/changelog files. bestie, it's literally the group-chat mediator for your changelog drama 🫢


✨ SYNOPSIS ✨

dpkg-mergechangelogs [option...] old new-a new-b [out]

🌸 DESCRIPTION 🌸

So here's the vibe: this program takes the 3 provided versions of the Debian changelog and generates a merged changelog file. The resulting changelog gets stored in the file out, or it's output to the standard output if that parameter isn't given. no drama, no cap ✨

Every entry is identified by its version number and they're assumed to be not conflicting. They get merged in the right order β€” and "right order" here means by decreasing version number, bestie, that's the whole point πŸ‘‘

When --merge-prereleases is used, the part of the version number after the last tilde is dropped, so 1.0-1~exp1 and 1.0-1~exp5 are considered to be the same entry. it's giving "same girl, different era" πŸŽ€

When the same version is available in both new-a and new-b, a standard line-based 3-way merge is attempted β€” provided that the module Algorithm::Merge is available (it's part of the package libalgorithm-merge-perl). otherwise you get a global conflict on the content of the entry. πŸ’€ yeah, that's the price of admission.

This program was introduced in dpkg 1.15.7. throwback era fr fr πŸ¦‹


πŸ’… OPTIONS πŸ’…

  • --merge-unreleased β€” ignore the version number when the entries are marked as UNRELEASED.

This is useful when you have diverging development for versions that have not yet been released. For instance 2.1-1 is released, then development happens for the new 2.2-1 and then for 2.3-1, where it makes sense to just end with a coalesced entry for 2.3-1 including all the development done in 2.2-1. highkey the tidy-up we all deserve 🧚

Supported since dpkg 1.21.0.

  • -m, --merge-prereleases β€” drop the part after the last tilde in the version number when doing version comparison to identify if two entries are supposed to be the same or not.

This is useful when you keep using the same changelog entry but you increase its version number regularly. For instance, you might have 2.3-1~exp1, 2.3-1~exp2, ... until the official release 2.3-1 and they are all the same changelog entry that has evolved over time. character development arc, honestly 🌈

  • --help β€” show the usage message and exit. the classic "bestie explain" button πŸ™ˆ
  • --version β€” show the version and exit.

🌿 ENVIRONMENT 🌿

  • DPKG_COLORS β€” sets the color mode. The currently accepted values are: auto (default), always and never.

Supported since dpkg 1.18.5.

  • DPKG_NLS β€” if set, it will be used to decide whether to activate Native Language Support, also known as internationalization (or i18n) support. The accepted values are: 0 and 1 (default).

Supported since dpkg 1.19.0.


😭 LIMITATIONS 😭

Anything that is not parsed by Dpkg::Changelog is lost during the merge. This might include stuff like comments which were not supposed to be there, etc. not me losing your little stray notes in the merge πŸ’€ that's just how it is.


πŸ”₯ INTEGRATION WITH GIT πŸ”₯

If you want to use this program to merge Debian changelog files in a git repository, you have first to register a new merge driver in .git/config or ~/.gitconfig:

[merge "dpkg-mergechangelogs"]
   name = debian/changelog merge driver
   driver = dpkg-mergechangelogs -m %O %A %B %A

Then you have to setup the merge attribute for the debian/changelog file either in .gitattributes in the repository itself, or in .git/info/attributes:

debian/changelog merge=dpkg-mergechangelogs

and boom, git and your changelog are in a healthy committed relationship πŸ’–πŸ‘‘


mwah, that's the whole page πŸŽ€ this came to you from the dpkg suite, version 1.23.11-dirty, dated 2026-09-09 β€” go merge something iconic, bestie βœ¨πŸ¦‹πŸ’œ

πŸ“¦ where this page comes from