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 asUNRELEASED.
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),alwaysandnever.
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:0and1(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
- arch rolling: dpkg 1.23.11-1 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms