gbp-dch.sgml 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601
  1. <refentry id="man.gbp.dch">
  2. <refentryinfo>
  3. <address>
  4. &dhemail;
  5. </address>
  6. <author>
  7. &dhfirstname;
  8. &dhsurname;
  9. </author>
  10. </refentryinfo>
  11. <refmeta>
  12. <refentrytitle>gbp-dch</refentrytitle>
  13. &dhsection;
  14. </refmeta>
  15. <refnamediv>
  16. <refname>gbp-dch</refname>
  17. <refpurpose>Generate the &debian; changelog from git commit messages</refpurpose>
  18. </refnamediv>
  19. <refsynopsisdiv>
  20. <cmdsynopsis>
  21. &gbp-dch;
  22. &man.common.options.synopsis;
  23. <arg><option>--debian-branch=</option><replaceable>branch_name</replaceable></arg>
  24. <arg><option>--debian-tag=</option><replaceable>tag-format</replaceable></arg>
  25. <arg><option>--upstream-branch=</option><replaceable>branch_name</replaceable></arg>
  26. <arg><option>--upstream-tag=</option><replaceable>tag-format</replaceable></arg>
  27. <arg><option>--ignore-branch</option></arg>
  28. <group>
  29. <group>
  30. <arg><option>-S</option></arg>
  31. <arg><option>--snapshot</option></arg>
  32. </group>
  33. <group>
  34. <arg><option>-R</option></arg>
  35. <arg><option>--release</option></arg>
  36. </group>
  37. </group>
  38. <group>
  39. <group>
  40. <arg><option>-a</option></arg>
  41. <arg><option>--auto</option></arg>
  42. </group>
  43. <group>
  44. <arg><option>-s</option> <replaceable>commitish</replaceable></arg>
  45. <arg><option>--since=</option><replaceable>commitish</replaceable></arg>
  46. </group>
  47. </group>
  48. <group>
  49. <arg><option>-N</option> <replaceable>version</replaceable></arg>
  50. <arg><option>--new-version=</option><replaceable>version</replaceable></arg>
  51. </group>
  52. <group>
  53. <arg><option>--bpo</option></arg>
  54. <arg><option>--nmu</option></arg>
  55. <arg><option>--qa</option></arg>
  56. <arg><option>--security</option></arg>
  57. <arg><option>--team</option></arg>
  58. </group>
  59. <arg><option>--distribution=</option><replaceable>name</replaceable></arg>
  60. <arg><option>--force-distribution</option></arg>
  61. <group>
  62. <arg><option>-U</option> <replaceable>level</replaceable></arg>
  63. <arg><option>--urgency=</option><replaceable>level</replaceable></arg>
  64. </group>
  65. <arg><option>--[no-]full</option></arg>
  66. <arg><option>--[no-]meta</option></arg>
  67. <arg><option>--meta-closes=bug-close-tags</option></arg>
  68. <arg><option>--meta-closes-bugnum=bug-number-format</option></arg>
  69. <arg><option>--snapshot-number=</option><replaceable>expression</replaceable></arg>
  70. <arg><option>--id-length=</option><replaceable>number</replaceable></arg>
  71. <arg><option>--git-log=</option><replaceable>git-log-options</replaceable></arg>
  72. <arg><option>--[no-]git-author</option></arg>
  73. <arg><option>--[no-]multimaint</option></arg>
  74. <arg><option>--[no-]multimaint-merge</option></arg>
  75. <arg><option>--spawn-editor=[always|never|snapshot|release]</option></arg>
  76. <arg><option>--commit-msg=</option><replaceable>msg-format</replaceable></arg>
  77. <group>
  78. <arg><option>-c</option></arg>
  79. <arg><option>--commit</option></arg>
  80. </group>
  81. <arg><option>--customizations=</option><replaceable>customization-file</replaceable></arg>
  82. <arg><option>--verbose</option></arg>
  83. <arg choice="plain"><replaceable>[path1 path2]</replaceable></arg>
  84. </cmdsynopsis>
  85. </refsynopsisdiv>
  86. <refsect1>
  87. <title>DESCRIPTION</title>
  88. <para>
  89. &gbp-dch; reads git commit messages and generates the &debian;
  90. changelog from it. If no arguments are given, &gbp-dch; starts
  91. from the commit corresponding to the last tagged Debian package
  92. version up to the current tip of the current branch. If the
  93. distribution of the topmost section in
  94. <filename>debian/changelog</filename>
  95. is <emphasis>UNRELEASED</emphasis>, the changelog entries will be
  96. inserted into this section. Otherwise, a new section will be
  97. created.
  98. </para>
  99. <para>
  100. If <option>--auto</option> is given &gbp-dch;, tries to guess the
  101. last &git; commit documented in the changelog - this only works in snapshot
  102. mode. Otherwise, <option>--since</option> can be used to tell &gbp-dch;
  103. at which point it should start in the &git; history.
  104. </para>
  105. <para>
  106. The additional path arguments can be used to restrict the repository paths
  107. &gbp-dch; looks at. Setting <replaceable>path</replaceable> to
  108. <emphasis>debian/</emphasis> is a good choice if upstream uses &git; and
  109. all Debian packaging changes are restricted to the
  110. <replaceable>debian/</replaceable> subdir. In more sophisticated cases
  111. (like backports), you can use <option>--git-log</option> to restrict the
  112. generated changelog entries further, e.g. by using
  113. <option>--git-log=</option><replaceable>"--author=Foo Bar"</replaceable>.
  114. </para>
  115. <para>
  116. The above relies on the <option>debian-branch</option> option
  117. pointing to the current branch
  118. and <option>upstream-branch</option> pointing to the
  119. corresponding upstream branch in order to find the right merge
  120. points of these branches. Furthermore &gbp-dch; must be able to
  121. identify git tags from upstream and Debian version numbers. If
  122. you're not using the defaults check
  123. the <option>upstream-tag</option>
  124. and <option>debian-tag</option> options.
  125. </para>
  126. </refsect1>
  127. <refsect1>
  128. <title>OPTIONS</title>
  129. <variablelist>
  130. &man.common.options.description;
  131. <varlistentry>
  132. <term><option>--debian-branch</option>=<replaceable>branch_name</replaceable>
  133. </term>
  134. <listitem>
  135. <para>
  136. The branch in the Git repository the Debian package is being
  137. developed on, default is <replaceable>master</replaceable>.
  138. </para>
  139. </listitem>
  140. </varlistentry>
  141. <varlistentry>
  142. <term><option>--upstream-branch</option>=<replaceable>branch_name</replaceable>
  143. </term>
  144. <listitem>
  145. <para>
  146. Branch to determine the upstream version from.
  147. Default is <replaceable>upstream</replaceable>.
  148. </para>
  149. </listitem>
  150. </varlistentry>
  151. <varlistentry>
  152. <term><option>--git-upstream-tag=</option><replaceable>TAG-FORMAT</replaceable>
  153. </term>
  154. <listitem>
  155. <para>
  156. use this tag format when looking for tags of upstream versions,
  157. default is <replaceable>upstream/%(version)s</replaceable>.
  158. </para>
  159. </listitem>
  160. </varlistentry>
  161. <varlistentry>
  162. <term><option>--ignore-branch</option>
  163. </term>
  164. <listitem>
  165. <para>
  166. Don't check if the current branch matches
  167. <replaceable>debian-branch</replaceable>.
  168. </para>
  169. </listitem>
  170. </varlistentry>
  171. <varlistentry>
  172. <term><option>--debian-tag=</option><replaceable>tag-format</replaceable>
  173. </term>
  174. <listitem>
  175. <para>
  176. tag format used, when tagging debian versions,
  177. default is <replaceable>debian/%(version)s</replaceable>
  178. </para>
  179. </listitem>
  180. </varlistentry>
  181. <varlistentry>
  182. <term><option>--since=</option><replaceable>committish</replaceable>
  183. </term>
  184. <listitem>
  185. <para>
  186. Start reading commit messages at
  187. <replaceable>committish</replaceable>.
  188. This option can't be set via &gbp.conf;.
  189. </para>
  190. </listitem>
  191. </varlistentry>
  192. <varlistentry>
  193. <term><option>--auto</option>,
  194. <option>-a</option></term>
  195. <listitem>
  196. <para>
  197. Guess the last commit documented in the changelog from the
  198. snapshot banner (or from the last tag if no snapshot banner exists).
  199. This option can't be set via &gbp.conf;.
  200. </para>
  201. </listitem>
  202. </varlistentry>
  203. <varlistentry>
  204. <term><option>--[no-]meta</option></term>
  205. <listitem>
  206. <para>
  207. Parse meta tags like <option>Closes:</option>,
  208. <option>Thanks:</option> and <option>Gbp-Dch:</option>. See META TAGS
  209. below.
  210. </para>
  211. </listitem>
  212. </varlistentry>
  213. <varlistentry>
  214. <term><option>--meta-closes=</option><replaceable>bug-close-tags</replaceable>
  215. </term>
  216. <listitem>
  217. <para>
  218. What meta tags to look for to generate bug-closing changelog entries.
  219. The default is <literal>'Closes|LP'</literal> to support Debian and Launchpad.
  220. </para>
  221. </listitem>
  222. </varlistentry>
  223. <varlistentry>
  224. <term><option>--meta-closes-bugnum=</option><replaceable>bug-number-format</replaceable>
  225. </term>
  226. <listitem>
  227. <para>
  228. What regular expression should be used to parse out the bug number.
  229. The default is <literal>'(?:bug|issue)?\#?\s?\d+'</literal>. Note: the regex should
  230. suppress all portions of the bug number that are not wanted using
  231. <literal>"(?:)"</literal>, see Python regex manual for details.
  232. </para>
  233. <para>
  234. Example:
  235. <option>--meta-closes-bugnum=</option><literal>"(?:bug)?\s*ex-\d+"</literal>
  236. would match all of the following:
  237. <screen>
  238. Possible Txt Match? Result
  239. ------------ ------ ------
  240. bug EX-12345 Y EX-12345
  241. ex-01273 Y ex-01273
  242. bug ex-1ab Y ex-1
  243. EX--12345 N</screen>
  244. </para>
  245. </listitem>
  246. </varlistentry>
  247. <varlistentry>
  248. <term><option>--[no-]full</option>
  249. </term>
  250. <listitem>
  251. <para>
  252. Include the full commit message in the changelog output.
  253. </para>
  254. </listitem>
  255. </varlistentry>
  256. <varlistentry>
  257. <term><option>--snapshot</option>,
  258. <option>-S</option></term>
  259. <listitem>
  260. <para>
  261. Create a snapshot release entry. This adds a snapshot release
  262. number and a warning banner to the changelog entry. The release
  263. version number is being auto incremented with every new snapshot
  264. release to avoid packages downgrades during snapshot testing.
  265. </para>
  266. </listitem>
  267. </varlistentry>
  268. <varlistentry>
  269. <term><option>--snapshot-number=</option><replaceable>expression</replaceable>
  270. </term>
  271. <listitem>
  272. <para>
  273. Python expression that gets eval()ed to the new snapshot number.
  274. </para>
  275. </listitem>
  276. </varlistentry>
  277. <varlistentry>
  278. <term><option>--release</option>,
  279. <option>-R</option></term>
  280. <listitem>
  281. <para>
  282. Remove any snapshot release banners and version suffixes, set
  283. the current distribution to <replaceable>unstable</replaceable>, and
  284. open the changelog for final tweaking.
  285. This option can't be set via &gbp.conf;.
  286. </para>
  287. </listitem>
  288. </varlistentry>
  289. <varlistentry>
  290. <term><option>--new-version=</option><replaceable>version</replaceable>,
  291. <option>-N</option> <replaceable>version</replaceable>
  292. </term>
  293. <listitem>
  294. <para>
  295. Add a new changelog section with version
  296. <replaceable>newversion</replaceable>. Together with
  297. <option>--snapshot</option>, the snapshot number will be appended to
  298. <replaceable>newversion</replaceable>.
  299. This option can't be set via &gbp.conf;.
  300. </para>
  301. </listitem>
  302. </varlistentry>
  303. <varlistentry>
  304. <term><option>--team</option>
  305. </term>
  306. <listitem>
  307. <para>
  308. Create a Team upload changelog entry.
  309. This option can't be set via &gbp.conf;.
  310. </para>
  311. </listitem>
  312. </varlistentry>
  313. <varlistentry>
  314. <term><option>--bpo</option>
  315. </term>
  316. <listitem>
  317. <para>
  318. Increment the Debian release number for an upload to backports, and
  319. add a backport upload changelog comment.
  320. This option can't be set via &gbp.conf;.
  321. </para>
  322. </listitem>
  323. </varlistentry>
  324. <varlistentry>
  325. <term><option>--nmu</option>
  326. </term>
  327. <listitem>
  328. <para>
  329. Increment the Debian release number for a non-maintainer upload.
  330. This option can't be set via &gbp.conf;.
  331. </para>
  332. </listitem>
  333. </varlistentry>
  334. <varlistentry>
  335. <term><option>--qa</option>
  336. </term>
  337. <listitem>
  338. <para>
  339. Increment the Debian release number for a Debian QA Team upload, and
  340. add a QA upload changelog comment.
  341. This option can't be set via &gbp.conf;.
  342. </para>
  343. </listitem>
  344. </varlistentry>
  345. <varlistentry>
  346. <term><option>--security</option>
  347. </term>
  348. <listitem>
  349. <para>
  350. Increment the Debian release number for a Debian Security
  351. Team non-maintainer upload, and add a "Security Team
  352. upload" changelog comment.
  353. This option can't be set via &gbp.conf;.
  354. </para>
  355. </listitem>
  356. </varlistentry>
  357. <varlistentry>
  358. <term><option>--distribution=</option><replaceable>name</replaceable>
  359. </term>
  360. <listitem>
  361. <para>
  362. Set the distribution field to <replaceable>name</replaceable>.
  363. This option can't be set via &gbp.conf;.
  364. </para>
  365. </listitem>
  366. </varlistentry>
  367. <varlistentry>
  368. <term><option>--force-distribution</option>
  369. </term>
  370. <listitem>
  371. <para>
  372. Force the distribution specified with <option>--distribution</option>
  373. to be used, even if it doesn't match the list of known distributions.
  374. This option can't be set via &gbp.conf;.
  375. </para>
  376. </listitem>
  377. </varlistentry>
  378. <varlistentry>
  379. <term><option>--urgency=</option><replaceable>level</replaceable>
  380. </term>
  381. <listitem>
  382. <para>
  383. Set the urgency field to <replaceable>level</replaceable>.
  384. </para>
  385. </listitem>
  386. </varlistentry>
  387. <varlistentry>
  388. <term><option>--git-log=</option><replaceable>git-log-options</replaceable>
  389. </term>
  390. <listitem>
  391. <para>
  392. Options passed on verbatim to git-log(1).
  393. </para>
  394. </listitem>
  395. </varlistentry>
  396. <varlistentry>
  397. <term><option>--id-length=</option><replaceable>N</replaceable>
  398. </term>
  399. <listitem>
  400. <para>
  401. Include <replaceable>N</replaceable> digits of the commit id in the
  402. changelog entry. Default is to not include any commit ids at all.
  403. </para>
  404. </listitem>
  405. </varlistentry>
  406. <varlistentry>
  407. <term><option>--ignore-regex=</option><replaceable>regex</replaceable>
  408. </term>
  409. <listitem>
  410. <para>
  411. Ignore commit lines matching <replaceable>regex</replaceable>
  412. when generating the changelog.
  413. </para>
  414. </listitem>
  415. </varlistentry>
  416. <varlistentry>
  417. <term><option>--git-author</option>
  418. </term>
  419. <listitem>
  420. <para>
  421. Use user.name and user.email from
  422. <application>git-config</application>(1) for changelog trailer.
  423. </para>
  424. </listitem>
  425. </varlistentry>
  426. <varlistentry>
  427. <term><option>--[no-]multimaint-merge</option>
  428. </term>
  429. <listitem>
  430. <para>
  431. Merge commits by maintainer.
  432. </para>
  433. </listitem>
  434. </varlistentry>
  435. <varlistentry>
  436. <term><option>--spawn-editor=<replaceable>[always|never|snapshot|release]</replaceable></option>
  437. </term>
  438. <listitem>
  439. <para>
  440. Whether to spawn an editor: always, never, when doing snapshots or when
  441. doing a release.
  442. </para>
  443. </listitem>
  444. </varlistentry>
  445. <varlistentry>
  446. <term><option>--commit-msg=</option><replaceable>msg-format</replaceable>
  447. </term>
  448. <listitem>
  449. <para>
  450. use this format string for the commit message when committing the
  451. generated changelog file (when <option>--commit</option> is given).
  452. Default is
  453. <replaceable>Update changelog for %(version)s release</replaceable>
  454. </para>
  455. </listitem>
  456. </varlistentry>
  457. <varlistentry>
  458. <term><option>--commit</option>
  459. </term>
  460. <listitem>
  461. <para>
  462. Commit the generated changelog.
  463. </para>
  464. </listitem>
  465. </varlistentry>
  466. <varlistentry>
  467. <term><option>--customizations=</option><replaceable>customization-file</replaceable>
  468. </term>
  469. <listitem>
  470. <para>
  471. Load Python code from <replaceable>customization-file</replaceable>.
  472. At the moment, the only useful thing the code can do is define a
  473. custom format_changelog_entry() function.
  474. </para>
  475. </listitem>
  476. </varlistentry>
  477. </variablelist>
  478. </refsect1>
  479. <refsect1>
  480. <title>Snapshot mode</title>
  481. <para>
  482. Snapshot mode can be used for quick test and install cycles without
  483. having to worry about version numbers or changelog entries.
  484. </para>
  485. <para>
  486. When using <option>--snapshot</option> or <option>-S</option>, &gbp-dch;
  487. uses a pseudo header in the Debian changelog to remember the last git
  488. commit it added a changelog entry for. It also sets a version number
  489. ending in
  490. <replaceable>~&lt;snaspshotnumber&gt;.gbp&lt;commitid&gt;</replaceable>.
  491. It automatically increments the snapshot number on subsequent invocations
  492. of &gbp-dch; <option>-S</option> so that later snapshots automatically
  493. have a higher version number. To leave snapshot mode, invoke &gbp-dch;
  494. with the <option>--release</option> option. This removes the pseudo
  495. header and unmangles the version number so the released version has a
  496. higher version number than the snapshots.
  497. </para>
  498. </refsect1>
  499. <refsect1>
  500. <title>META TAGS</title>
  501. <para>
  502. Additional to the above options, the formatting of the commit message
  503. in <filename>debian/changelog</filename> can be modified by special tags
  504. (called Meta Tags)
  505. given in the git commit message. Meta Tag processing can be activated via
  506. the <option>--meta</option> option. The tags must start at the first column of
  507. a commit message but can appear on any line.
  508. They are of the form <option>Tagname</option>:
  509. <replaceable>value</replaceable>. Valid Meta Tags are:
  510. </para>
  511. <variablelist>
  512. <varlistentry>
  513. <term>
  514. <option>Gbp-Dch</option>: <replaceable>action</replaceable>
  515. </term>
  516. <listitem>
  517. <para>
  518. Supported actions are: <replaceable>Ignore</replaceable>
  519. which will ignore this commit when
  520. generating <filename>debian/changelog</filename>,
  521. <replaceable>Short</replaceable> which will only use the
  522. description (the first line) of the commit message when
  523. generating the changelog entry (useful
  524. when <option>--full</option> is given), and
  525. <replaceable>Full</replaceable> which will use the full
  526. commit message when generating the changelog entry (useful
  527. when <option>--full</option> is not given).
  528. </para>
  529. <para>
  530. In addition to <option>Gbp-Dch</option>, the
  531. deprecated <option>Git-Dch</option> is still supported.
  532. </para>
  533. </listitem>
  534. </varlistentry>
  535. <varlistentry>
  536. <term><option>Thanks</option>: <replaceable>msg</replaceable>
  537. </term>
  538. <listitem>
  539. <para>
  540. Add a thanks message after the commit message.
  541. </para>
  542. </listitem>
  543. </varlistentry>
  544. <varlistentry>
  545. <term><option>Closes</option>: <replaceable>bugnumber</replaceable>
  546. </term>
  547. <listitem>
  548. <para>
  549. Indicate in the <filename>debian/changelog</filename> that the bug
  550. was closed by this commit. See the <option>--meta-closes</option> on
  551. how to extend this for other bugtrackers.
  552. </para>
  553. </listitem>
  554. </varlistentry>
  555. </variablelist>
  556. <para>
  557. The following git commit message:
  558. </para>
  559. <screen>
  560. Document meta tags
  561. so one doesn't have to consult the manual
  562. Gbp-Dch: Short
  563. Closes: #636088
  564. Thanks: Raphaël Hertzog for the suggestion
  565. </screen>
  566. <para>
  567. Results in this <filename>debian/changelog</filename> entry:
  568. </para>
  569. <screen>
  570. * Document meta tags.
  571. Thanks to Raphaël Hertzog for the suggestion (Closes: #636088)
  572. </screen>
  573. </refsect1>
  574. <refsect1>
  575. &man.gbp.config-files;
  576. </refsect1>
  577. <refsect1>
  578. <title>SEE ALSO</title>
  579. <para>
  580. <xref linkend="man.gbp.buildpackage"/>,
  581. <xref linkend="man.gbp.import.dsc"/>,
  582. <xref linkend="man.gbp.import.dscs"/>,
  583. <xref linkend="man.gbp.import.orig"/>,
  584. <xref linkend="man.gbp.conf"/>,
  585. &man.seealso.common;
  586. <ulink url="https://honk.sigxcpu.org/cl2vcs">
  587. <citetitle>Cl2vcs</citetitle></ulink>,
  588. </para>
  589. </refsect1>
  590. <refsect1>
  591. <title>AUTHOR</title>
  592. <para>
  593. &dhusername; &dhemail;
  594. </para>
  595. </refsect1>
  596. </refentry>