[med-svn] r4323 - trunk/community/website/docs

David Paleino hanska-guest at alioth.debian.org
Sun Nov 8 08:44:41 UTC 2009


Author: hanska-guest
Date: 2009-11-08 08:44:41 +0000 (Sun, 08 Nov 2009)
New Revision: 4323

Modified:
   trunk/community/website/docs/policy.xml
Log:
Added Git policy


Modified: trunk/community/website/docs/policy.xml
===================================================================
--- trunk/community/website/docs/policy.xml	2009-11-07 20:34:38 UTC (rev 4322)
+++ trunk/community/website/docs/policy.xml	2009-11-08 08:44:41 UTC (rev 4323)
@@ -330,6 +330,8 @@
 
 		<sect2>
 			<title>Injecting a new package</title>
+            <sect3>
+			<title>Subversion</title>
 			<para>To inject a new package to the SVN repository, you must have
 			write access to it; i.e. you must be a member of the <emphasis>debian-med</emphasis> group on Alioth.</para>
 			<para>You can inject a new package only after successfully building
@@ -350,9 +352,118 @@
 			debian-med Blend package in SVN. Normally maintainer watch the changes in
 			the Debian Med packaging pool but it helps if the maintainer of a
 			certain package verifies that everything is in the right place.</para>
-		</sect2>
-		<sect2>
+		</sect3>
+		<sect3>
+                <title>Git</title>
+                <sect4>
+                    <title>Creating a local repository</title>
+                    <para>Just a few instructions to get you started:</para>
+                    <blockquote>
+                        <para><userinput>
+                            <command>mkdir</command>
+                            <filename class="directory">package</filename>
+                        </userinput></para>
+                        <para><userinput>
+                            <command>cd</command>
+                            <filename class="directory">package</filename>
+                        </userinput></para>
+                        <para><userinput>
+                            <command>git</command>
+                            <option>init</option>
+                        </userinput></para>
+                        <para><userinput>
+                            <command>git import-orig</command>
+                            <filename>/path/to/package_version.orig.tar.gz</filename>
+                        </userinput></para>
+                        <para><userinput>
+                            <command>dh_make</command>
+                            <option>-p package_x.y.z</option>
+                        </userinput></para>
+                    </blockquote>
+                    <para>The above steps will create a repository with the appropriate layout for
+                    <command>git-buildpackage</command>, with three branches: <filename>master</filename>
+                    (where the Debian development will happen), <filename>pristine-tar</filename>,
+                    used by the <command>pristine-tar</command> tool during the package build process
+                    to recreate the original tarball, and <filename>upstream</filename>, which will
+                    contain the upstream source.</para>
+                    <para>To display your name and more nicely in the Git log, you should instruct
+                    Git to do so (the <option>--global</option> option is to say Git these are the
+                    default parameters for every Git repository you commit to, without it the settings
+                    will be per-repository only):</para>
+                    <blockquote>
+                    	<para><userinput>
+                    		<command>git config</command>
+                    		<option>[--global]</option>
+                    		<option>user.name "$DEBFULLNAME"</option>
+                    	</userinput></para>
+                    	<para><userinput>
+                    		<command>git config</command>
+                    		<option>[--global]</option>
+                    		<option>user.email "$DEBEMAIL"</option>
+                    	</userinput></para>
+                    </blockquote>
+                    <para>After you create your <filename class="directory">debian/</filename> (be sure
+                    to commit it!), you should add a <quote>remote</quote> to the repository. A remote is
+                    where the commits will be pushed to, and the default remote is called <quote>origin</quote>.</para>
+                    <para>If you are going to push to our Alioth repository, please do the following inside your
+                    local repository:</para>
+                    <blockquote>
+                        <para><userinput>
+                            <command>git remote add origin</command>
+                            <filename class="directory">git+ssh://alioth.debian.org/git/debian-med/package.git</filename>
+                        </userinput></para>
+                    </blockquote>
+                    <para>The next step is to create the remote repository on Alioth.</para>
+                </sect4>
+                <sect4>
+                    <title>Creating the remote repository</title>
+                    <blockquote>
+                        <para><userinput>
+                            <command>ssh</command>
+                            <filename class="directory">alioth.debian.org</filename>
+                        </userinput></para>
+                        <para><userinput>
+                            <command>cd</command>
+                            <filename class="directory">/git/debian-med</filename>
+                        </userinput></para>
+                        <para><userinput>
+                            <command>./setup-repository</command>
+                            <option>packagename</option>
+                            <option>"Description of the package"</option>
+                        </userinput></para>
+                    </blockquote>
+                    <para>This will create a <filename class="directory">packagename.git</filename> repository on
+                    Alioth, with the proper hooks set up for our team.</para>
+                </sect4>
+                <sect4>
+                    <title>Pushing the package</title>
+                    <para>To push the package (make sure you've added the alioth remote!), do the following:</para>
+                    <blockquote>
+                        <para><userinput>
+                            <command>git push origin master</command>
+                        </userinput></para>
+                        <para><userinput>
+                            <command>git push</command>
+                            <option>--all</option>
+                        </userinput></para>
+                        <para><userinput>
+                            <command>git push</command>
+                            <option>--tags</option>
+                        </userinput></para>
+                    </blockquote>
+                    <para>For the first push, it's necessary to specify <quote>origin master</quote>. The next time
+                    you will push, a <command>git push</command> will suffice. Remember that this will only push the
+                    <quote>master</quote> branch (and the other two only if master is somehow related to the new
+                    branches), so be sure to also do a run with <option>--all</option>, and one with
+                    <option>--tags</option> (if you obviously changed anything in the other branches/tags).</para>
+                </sect4>
+            </sect3>
+        </sect2>
+        <sect2>
+            <sect3>
 			<title>Building the packages</title>
+            <sect4>
+            <title>Subversion</title>
 			<para>To build the package, just use the tools that <command>svn-buildpackage</command>
 			carries. First of all, we suggest you to define some aliases for the
 			most common commands:</para>
@@ -390,9 +501,48 @@
 			section), or send the result of svn diff to the
 			<ulink url="mailto:debian-med at lists.debian.org">mailing list</ulink>
 			(<command>gzip -9</command> it, if it's too large).</para>
+            </sect4>
+            <sect4>
+                <title>Git</title>
+                <para>You should use <command>git-buildpackage</command> to build the
+                packages with git. Be sure to run it from the <quote>master</quote>
+                branch.</para>
+                <para>Unfortunately, by default <command>git-buildpackage</command>
+                builds the package without using any chroot (the same as
+                <command>svn-buildpackage</command>), but it's configurable to run
+                it inside a chroot.</para>
+                <para>You can use this configuration file, <filename>~/.gbp.conf</filename>:</para>
+                <blockquote>
+                    <programlisting>[DEFAULT]
+builder = ~/bin/git-pbuilder
+cleaner = fakeroot debian/rules clean
+pristine-tar = True
+
+[git-buildpackage]
+# use this for more svn-buildpackage like behaviour:
+export-dir = ../build-area/
+tarball-dir = ../tarballs/</programlisting>
+                </blockquote>
+                <para>With this configuration file you're specifying that
+                <command>git-buildpackage</command> will use <filename>~/bin/git-pbuilder</filename>
+                as the builder script. This is an example script you can use:</para>
+                <blockquote>
+                    <programlisting>#!/bin/sh
+set -e
+
+pdebuild --pbuilder cowbuilder --debbuildopts "-i\.git -I.git $*"
+rm ../*_source.changes</programlisting>
+                </blockquote>
+                <para>This will build the package inside the default cowbuilder chroot, while
+                passing any more parameters directly do <command>dpkg-buildpackage</command>.</para>
+            </sect4>
+            </sect3>
 		</sect2>
 		<sect2>
+            <sect3>
 			<title>Tagging packages</title>
+            <sect4>
+            <title>Subversion</title>
 			<para>It may happen that a package version has been uploaded to Debian
 			repositories, and you forgot to tag the last build with</para>
 			<blockquote>
@@ -433,6 +583,32 @@
 				</userinput></para>
 			</blockquote>
 			<para>(--svn-no-autodch avoids <filename>debian/changelog</filename> to be marked as UNRELEASED).</para>
+            </sect4>
+                <sect4>
+                    <title>Git</title>
+                    <para>Tagging a release with git is pretty straightforward:</para>
+                    <blockquote>
+                        <para><userinput>
+                            <command>git tag</command>
+                            <option>tagname</option>
+                        </userinput></para>
+                    </blockquote>
+                    <para>The tag names usually follow the scheme <quote>debian/x.y-z</quote>,
+                    this will ensure compatibility with other tools as well (like
+                    <command>git import-dsc</command>).</para>
+                    <para>You can also easily retroactively make tags:</para>
+                    <blockquote>
+                        <para><userinput>
+                            <command>git checkout</command>
+                            <option>&lt;commit hash&gt;</option>
+                        </userinput></para>
+                    </blockquote>
+                    <para>You're now at the point in history when you released the package.
+                    Just tag it as you would normally do.</para>
+                    <para>After tagging, be sure to <command>git push --tags</command>, so that
+                    other people can benefit from it too.</para>
+                </sect4>
+            </sect3>
 		</sect2>
 		<sect2>
 			<title>Handling patches</title>




More information about the debian-med-commit mailing list