gbp-dch.sgml 19 KB

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