intro.sgml 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. <chapter id="gbp.intro">
  2. <title>Introduction</title>
  3. <para>
  4. Welcome to &gbp;, a system that integrates the
  5. <ulink url="http://www.debian.org/">Debian</ulink> package build
  6. system with <ulink url="http://git.or.cz/">Git</ulink>. The current version of this manual can be found
  7. <ulink url="https://honk.sigxcpu.org/piki/projects/git-buildpackage">here</ulink>.
  8. </para>
  9. <para>
  10. What can these tools do for you:
  11. <itemizedlist>
  12. <listitem><para>Import an existing &debian; package into &git;</para></listitem>
  13. <listitem><para>Import new upstream versions, NMUs etc. with optional filters</para></listitem>
  14. <listitem><para>Automatic upstream tarball generation</para></listitem>
  15. <listitem><para>Maintain a consistent branch and tag naming across
  16. repositories or across a team of developers</para></listitem>
  17. <listitem><para>Automatically sign tags</para></listitem>
  18. <listitem><para>Automatically push changes to remote repositories</para></listitem>
  19. <listitem><para>Make sure you have committed all changes to the right
  20. branch before releasing</para></listitem>
  21. <listitem><para>Export to a clean build area before building</para></listitem>
  22. <listitem><para>Automatic debian/changelog generation</para></listitem>
  23. <listitem><para>Automatic generation of snapshot releases for local testing</para></listitem>
  24. <listitem><para>Simple patch management</para></listitem>
  25. </itemizedlist>
  26. All of this is (hopefully) being done without restricting the user to certain usage patterns.
  27. </para>
  28. <sect1 id="gbp.repository">
  29. <title>Repository Layout and Terminology</title>
  30. <para>It is recommended to have the &debian; packaging on a separate
  31. branch than the upstream source <footnote><para>this, of course, has
  32. no meaning for &debian; native packages</para></footnote>.
  33. This is necessary to be able to import
  34. and merge in new upstream versions via &gbp-import-orig;.
  35. To distinguish these two branches, the following terminology
  36. <footnote><para>corresponding to the command
  37. line and config file options</para></footnote> is used:
  38. </para>
  39. <itemizedlist>
  40. <listitem><para>The <option>debian-branch</option> (the default branch
  41. name used in the &git; repository is <emphasis>master</emphasis>) holds
  42. your current development work. That's the branch you usually cut your
  43. releases from and the default branch new upstream releases are merged
  44. onto.</para></listitem>
  45. <listitem><para> The <option>upstream-branch</option> (the default
  46. branch name used in the &git; repository is
  47. <emphasis>upstream</emphasis>) holds the upstream releases. This can
  48. either be a branch you import to or a branch of an upstream repository
  49. you pull from.</para></listitem>
  50. <listitem><para> The <option>pristine-tar branch</option> (the default
  51. branch name used in the &git; repository is
  52. <emphasis>pristine-tar</emphasis>) holds the necessary additional
  53. information to recreate the original tarball from the
  54. <option>upstream-branch</option>. In order to use this feature, you need
  55. to install the &pristine-tar; package.</para></listitem>
  56. <listitem><para> There can be one or more <option>patch-queue
  57. branches</option>. Every patch-queue branch is related to a
  58. <option>debian-branch</option>. If the <option>debian-branch</option> is called
  59. <emphasis>master</emphasis>, the corresponding patch-queue branch is
  60. called <emphasis>patch-queue/master</emphasis>. The patch-queue branch is
  61. the &debian; branch plus the contents of
  62. <emphasis>debian/patches</emphasis> applied. These branches are managed
  63. with &gbp-pq;.
  64. </para></listitem>
  65. </itemizedlist>
  66. <para>You're completely
  67. free to pick any repository layout; the branch names above are only
  68. &gbp;'s defaults. They can be changed at any point in time,
  69. and you can work with an arbitrary number of branches.
  70. For example, branches like <emphasis>nmu</emphasis>,
  71. <emphasis>backports</emphasis> or <emphasis>stable</emphasis> might
  72. (temporarily or permanently) become your <option>debian-branch</option>,
  73. and branches like <emphasis>dfsg</emphasis> or
  74. <emphasis>snapshots</emphasis> might become your
  75. <option>upstream-branch</option>&mdash;it doesn't matter if these branches
  76. are maintained with &gbp-import-orig; or not.</para>
  77. <para>
  78. A recommended branch layout is described in <xref linkend="gbp.branch.naming"/>.
  79. </para>
  80. <para>Since &gbp-buildpackage; only works with local &git;-repositories,
  81. you have to use <command>git push</command> in order to publish your
  82. changes to remote repositories like <ulink
  83. url="http://git.debian.org/">git.debian.org</ulink>; this can also be
  84. automatized with &gbp-buildpackage;'s <option>post-tag</option>
  85. hook.</para>
  86. </sect1>
  87. <sect1 id="gbp.workflow">
  88. <title>Workflow</title>
  89. <para>
  90. A typical, simple workflow consists of the following steps:
  91. </para>
  92. <orderedlist>
  93. <listitem><para>Import a new &debian; package via &gbp-import-dsc;. This
  94. imports the &debian; Package on the <option>debian-branch</option>
  95. and the upstream sources on the <option>upstream-branch</option>.</para></listitem>
  96. <listitem><para>Develop, test, commit changes. During this time, you can
  97. always build the package with &gbp-buildpackage;. In case you have
  98. uncommitted changes in your source tree, you can use the
  99. <option>--git-ignore-new</option> option.</para></listitem>
  100. <listitem><para>Optionally you can create the &debian; changelog entries
  101. using &gbp-dch; and create snapshot releases for testing using its
  102. <option>--snapshot</option> option.</para></listitem>
  103. <listitem><para>Once satisfied, you can build the final package with
  104. &gbp-buildpackage; <option>--git-tag</option>. This additionally
  105. creates a tag within &git; so you can switch back to that version later
  106. at any time. The format of the tags can be specified; tags can
  107. be &gpg; signed.</para></listitem>
  108. <listitem><para>When a new upstream version is released and upstream
  109. isn't using &git;, you can import the new version via &gbp-import-orig;
  110. onto the <option>upstream-branch</option>. &gbp-import-orig; will
  111. by default try to merge the new upstream version onto the
  112. <option>debian-branch</option>. You can skip the merge with
  113. <option>--no-merge</option>. After resolving any potential conflicts,
  114. go back to the second step.</para></listitem>
  115. </orderedlist>
  116. <para>These steps will be explained in more details in the following sections.</para>
  117. </sect1>
  118. </chapter>