gbp-dch
Generate the Debian changelog from git commit messages
- Provided by: git-buildpackage (Version: 0.9.19)
- Report a bug
Generate the Debian changelog from git commit messages
gbp dch
[--version] [--help] [--verbose]
[--color=[auto|on|off]] [--color-scheme= COLOR_SCHEME]
[--debian-branch= branch_name] [--debian-tag=
tag-format] [--upstream-branch= branch_name]
[--upstream-tag= tag-format] [--ignore-branch]
[-s commitish | --since= commitish] [[-S
| --snapshot] | [-R | --release]] [-N
version | --new-version= version] [--bpo |
--nmu | --qa | --security | --team]
[--distribution= name] [--force-distribution]
[-U level | --urgency= level]
[--[no-]full] [--[no-]meta]
[--meta-closes=bug-close-tags]
[--meta-closes-bugnum=bug-number-format] [--snapshot-number=
expression] [--id-length= number] [--git-log=
git-log-options] [--[no-]git-author]
[--[no-]multimaint] [--[no-]multimaint-merge]
[--spawn-editor=[always|never|snapshot|release]]
[--commit-msg= msg-format] [-c | --commit]
[--customizations= customization-file] [--postedit=
COMMAND] [--dch-opt= dch-options]... [--verbose]
path1 path2
gbp dch reads git commit messages and generates the Debian changelog from it. It starts at a given commit specified by the --since option up to the current HEAD. For each commit found it adds the commit message to the changelog. If --since is not given the commit to start from is determined by the following rules (first one matches):
This is called automatic mode.
If the distribution of the topmost section in debian/changelog is UNRELEASED, the changelog entries will be inserted into this section. Otherwise a new section will be created.
If one ore more paths are given as arguments gbp dch will only include changes in debian/changelog that affect these paths. E.g. using debian/ is a good choice if upstream uses Git and you don't want the upstream history to end up in debian/changelog.
To restrict the selected changes even further you can use use the --git-log option which is passed on verbatim to git log. E.g. by using --git-log="--author=Foo Bar".
The above relies on the --debian-branch option pointing to the current branch and --upstream-branch pointing to the corresponding upstream branch in order to find the right merge points of these branches. Furthermore gbp dch must be able to identify git tags from upstream and Debian version numbers. If you're not using the defaults check the --upstream-tag and --debian-tag options and make sure they match the tags created by e.g. gbp import-orig (when using tarballs) or upstream's tagging pattern (when using upstream's git directly).
If not changelog exists yet it is created and the version number is derived from the last upstream tag if found.
Example: --meta-closes-bugnum="(?:bug)?\s*ex-\d+" would match all of the following:
Possible Txt Match? Result
------------ ------ ------
bug EX-12345 Y EX-12345
ex-01273 Y ex-01273
bug ex-1ab Y ex-1
EX--12345 N
The snapshot banner is also used by gbp dch to determine which entries are already in the changelog. This prevents duplicated entries in debian/changelog when you did not commit the changelog yet.
Snapshot mode can be used for quick test and install cycles without having to worry about version numbers or changelog entries.
When using --snapshot or -S, gbp dch uses a pseudo header in the Debian changelog to remember the last git commit it added a changelog entry for. It also sets a version number ending in ~<snaspshotnumber>.gbp<commitid>. It automatically increments the snapshot number on subsequent invocations of gbp dch -S so that later snapshots automatically have a higher version number. To leave snapshot mode, invoke gbp dch with the --release option. This removes the pseudo header and unmangles the version number so the released version has a higher version number than the snapshots.
Additional to the above options, the formatting of the commit message in debian/changelog can be modified by special tags (called Meta Tags) given in the git commit message. Meta Tag processing can be activated via the --meta option. The tags must start at the first column of a commit message but can appear on any line. They are of the form Tagname: value. Valid Meta Tags are:
In addition to Gbp-Dch, the deprecated Git-Dch is still supported.
The following git commit message:
Document meta tags
so one doesn't have to consult the manual
Gbp-Dch: Short
Closes: #636088
Thanks: Raphaël Hertzog for the suggestion
Results in this debian/changelog entry:
* Document meta tags.
Thanks to Raphaël Hertzog for the suggestion (Closes: #636088)
Several gbp.conf files are parsed to set defaults for the above command-line arguments. See the gbp.conf(5) manpage for details.
gbp-buildpackage(1), gbp-import-dsc(1),
gbp-import-dscs(1), gbp-import-orig(1), gbp.conf(5),
debuild(1), git(1), pristine-tar(1),
The Git-Buildpackage Manual
⟨file:///usr/share/doc/git-buildpackage/manual-html/index.html⟩
Cl2vcs ⟨https://honk.sigxcpu.org/cl2vcs⟩ ,
Guido Günther <agx@sigxcpu.org>