Differences between revisions 4 and 17 (spanning 13 versions)
Revision 4 as of 2009-01-25 00:01:04
Size: 2178
Comment: Finished
Revision 17 as of 2012-07-25 18:19:45
Size: 4539
Editor: ThomasKoch
Comment:
Deletions are marked like this. Additions are marked like this.
Line 11: Line 11:
<!> '''Note our repo has not yet been picked up by cron job. This means it is not yet available on git.debian.org. For now only those who are project members can clone the repo using alioth.''' === Preparation ===
 
If you have SSH access, please setup {{{~/.ssh/config}}} as per [[Alioth/Git]]. Optionally generate and upload SSH key to alioth.
Line 13: Line 15:
=== Preporation ===
 
Read through [Alioth/SSH]. It tells you how to avoid hardcoding your username everywhere as well as how to install SSH on alioth. This guide assumes you have at least created {{{~/.ssh/config}}} as explained on that page.

Also you will need at least these packages in addition to the build requirements
Also everyone will need at least these packages:
Line 20: Line 18:
sudo apt-get install git-core git-buildpackage pristine-tar $ sudo apt-get install git-core git-buildpackage pristine-tar
Line 25: Line 23:
Let's create a derictory for all our packaging and change into it: Let's create a directory for all our packaging and change into it:
Line 31: Line 29:
Currently we only have sword package. So we are going to clone it: Currently we only have a sword package. So we are going to clone, if you have ssh access:
Line 34: Line 32:
$ git clone ssh+git://alioth.debian.org/git/pkg-crosswire/sword.git
$ cd sword
$ git clone ssh://git.debian.org/git/pkg-crosswire/sword.git
Line 38: Line 35:
Now let's setup the tracking branches: and if you don't
Line 40: Line 38:
$ git branch --track upstream origin/upstream # to create a tracking branch
$ git branch --track pristine-tar origin/pristine-tar # to track pristine-tar brack
$ git clone git://git.debian.org/git/pkg-crosswire/sword.git
Line 44: Line 41:
Now after typing next command, you should see output as displayed:
Now create a branch to work on
Line 46: Line 45:
$ git branch
* master
  pristine-tar
  upstream
$ git checkout -b whizbang
Line 52: Line 48:
=== Building from the repo ===

Building from the repo is easy
Commit, commit, commit. You hear there were some commits on the origin/master branch. Here is what you do
Line 58: Line 52:
git buildpackage --pristine-tar $ git pull
Line 61: Line 55:
This will export the tree to {{{../build-area}}}, generate pristine tarball (with identical checksums as upstream), and envoke {{{debuild -uc -us}}} there. Sit back, relax and watch it build. You inspect what's available. Once you get back to whizbang pull the fetched changes
{{{
$ git checkout whizbang
$ git pull . master # dot means local repo
}}}
Line 63: Line 61:
For more information about git-buildpackage see [/usr/share/doc/git-buildpackage/manual-html/index.html] Once your branch is ready, push for a review (give a sensible branch name eg. updated-manual-pages):
{{{
$ git push origin whizbang:updated-manual-pages
}}}
Line 65: Line 66:
I will add more info hear in due course. And advertise it on the mailing list. Next time anyone runs {{{git fetch}}} or {{{git pull}}} they will receive your branch as {{{origin/updated-manual-pages}}}.

If you don't have ssh access, you can push to github.com or repo.or.cz, both are free git hosting services. Or you can generate patch series and email them:

{{{
$ git fetch
$ git format-patch master
}}}

This will make 0001-*.patch, 0002-*.patch .... 000X-*.patch which can be easily applied with {{{git am}}}

=== Building from the git repo ===

Before you push your whizbang (erhhh I mean update-manual-pages branch ;-) ) you should build it and test it. You can easily do it with {{{git-buildpackage}}}.

Let's first peek at all remote branches
{{{
$ git branch -r
  origin/HEAD
  origin/master
  origin/pristine-tar
  origin/upstream
}}}

{{{origin/upstream}}} holds upstream code and {{{origin/pristine-tar}}} holds small binary deltas. Using these two branches it is possible to regenerate upsteam tarball with identical checksum. You can look at them and see what they store:
{{{
$ git checkout origin/pristine-tar
$ ls
}}}

You'll get a warning after first command, it's fine that's expected. Anyways let's go back to building the package.
{{{
$ git checkout master
}}}

First you need to do a small setup of git-buildpackage
{{{
$ cp /etc/git-buildpackage/gbp.conf .git/
$ nano .git/gbp.conf
}}}

This file is commented and mostly self-explanatory. For now just comment out one line:
{{{
#pristine-tar = True
    change to
pristine-tar = True
}}}

and save. This tells git-buildpackage that it can use pristine-tar to generate orig.tar.gz. So now if you envoke this:

{{{
$ git buildpackage
}}}

It should start building master branch in the {{{../build-area}}}. Sit back, relax and watch it do it's magic. If on the other hand you want to build your whizbang branch you have two options, either run:
{{{
$ git buildpackage --git-debian-branch=whizbang
}}}

or edit one line in the .git/gbp.conf:

{{{
#debian-branch = master
    change to
debian-branch = whizbang
}}}

and then run {{{git buildpackage}}}

For more information about git-buildpackage see it's documentation, which is located here {{{/usr/share/doc/git-buildpackage/manual-html/index.html}}}.

If you want to use pbuilder you will need to do this
{{{
$ cp /usr/share/doc/git-buildpackage/examples/git-pbuilder ~/bin/
$ chmod +x ~bin/git-pbuilder
$ nano .git/gbp.conf

#builder = debuild -i\.git/ -I.git
    change to
builder = ~/bin/git-pbuilder
}}}

This will make {{{git buildpackage}}} use pbuilder.

On a side note any parameters that you pass to {{{git buildpackage}}} which do '''not''' start with {{{--git-}}} will be passed to your builder script, so that you can fine tune options per build.

----
CategoryGit

Team Repo Guide

This guide will guide you through cloning team repo, building packages from it and making changes, pushing changes back.

Preparation

If you have SSH access, please setup ~/.ssh/config as per ?Alioth/Git. Optionally generate and upload SSH key to alioth.

Also everyone will need at least these packages:

$ sudo apt-get install git-core git-buildpackage pristine-tar

Cloning the repo

Let's create a directory for all our packaging and change into it:

$ mkdir ~/pkg-crosswire
$ cd ~/pkg-crosswire

Currently we only have a sword package. So we are going to clone, if you have ssh access:

$ git clone ssh://git.debian.org/git/pkg-crosswire/sword.git

and if you don't

$ git clone git://git.debian.org/git/pkg-crosswire/sword.git

Now create a branch to work on

$ git checkout -b whizbang

Commit, commit, commit. You hear there were some commits on the origin/master branch. Here is what you do

$ git checkout master
$ git pull

You inspect what's available. Once you get back to whizbang pull the fetched changes

$ git checkout whizbang
$ git pull . master  # dot means local repo

Once your branch is ready, push for a review (give a sensible branch name eg. updated-manual-pages):

$ git push origin whizbang:updated-manual-pages

And advertise it on the mailing list. Next time anyone runs git fetch or git pull they will receive your branch as origin/updated-manual-pages.

If you don't have ssh access, you can push to github.com or repo.or.cz, both are free git hosting services. Or you can generate patch series and email them:

$ git fetch
$ git format-patch master

This will make 0001-*.patch, 0002-*.patch .... 000X-*.patch which can be easily applied with git am

Building from the git repo

Before you push your whizbang (erhhh I mean update-manual-pages branch ;-) ) you should build it and test it. You can easily do it with git-buildpackage.

Let's first peek at all remote branches

$ git branch -r
  origin/HEAD
  origin/master
  origin/pristine-tar
  origin/upstream

origin/upstream holds upstream code and origin/pristine-tar holds small binary deltas. Using these two branches it is possible to regenerate upsteam tarball with identical checksum. You can look at them and see what they store:

$ git checkout origin/pristine-tar
$ ls

You'll get a warning after first command, it's fine that's expected. Anyways let's go back to building the package.

$ git checkout master

First you need to do a small setup of git-buildpackage

$ cp /etc/git-buildpackage/gbp.conf .git/
$ nano .git/gbp.conf

This file is commented and mostly self-explanatory. For now just comment out one line:

#pristine-tar = True
    change to
pristine-tar = True

and save. This tells git-buildpackage that it can use pristine-tar to generate orig.tar.gz. So now if you envoke this:

$ git buildpackage

It should start building master branch in the ../build-area. Sit back, relax and watch it do it's magic. If on the other hand you want to build your whizbang branch you have two options, either run:

$ git buildpackage --git-debian-branch=whizbang

or edit one line in the .git/gbp.conf:

#debian-branch = master
    change to
debian-branch = whizbang

and then run git buildpackage

For more information about git-buildpackage see it's documentation, which is located here /usr/share/doc/git-buildpackage/manual-html/index.html.

If you want to use pbuilder you will need to do this

$ cp /usr/share/doc/git-buildpackage/examples/git-pbuilder ~/bin/
$ chmod +x ~bin/git-pbuilder
$ nano .git/gbp.conf

#builder = debuild -i\.git/ -I.git
    change to
builder = ~/bin/git-pbuilder

This will make git buildpackage use pbuilder.

On a side note any parameters that you pass to git buildpackage which do not start with --git- will be passed to your builder script, so that you can fine tune options per build.


CategoryGit