Differences between revisions 12 and 14 (spanning 2 versions)
Revision 12 as of 2009-04-26 16:17:48
Size: 3840
Comment:
Revision 14 as of 2009-04-26 17:28:00
Size: 5919
Comment:
Deletions are marked like this. Additions are marked like this.
Line 3: Line 3:
 * One Git repository for each package : /git/pkg-horde/DEB_PKGNAME.git on alioth (please use --bare repository)  * One Git repository for each package : /git/pkg-horde/DEBPKGNAME.git on alioth (please use bare repository)
Line 11: Line 11:
Init git repository on alioth:

{{{
/git/pkg-horde$ mkdir DEBPKGNAME.git
/git/pkg-horde$ cd DEBPKGNAME.git
/git/pkg-horde/DEBPKGNAME.git$ git --bare init
}}}

Note: please use a bare repository. We will have a clean Gitweb URL like http://git.debian.org/?p=pkg-horde/DEBPKGNAME.git
and not http://git.debian.org/?p=pkg-horde/DEBPKGNAME.git/.git with a non-bare repository

Configure the repository:

{{{
/git/pkg-horde/DEBPKGNAME.git$ echo "Debian Horde Packages repository: DEBPKGNAME package" > description
/git/pkg-horde/DEBPKGNAME.git$ git config --add hooks.mailinglist "pkg-horde-hackers@lists.alioth.debian.org"
/git/pkg-horde/DEBPKGNAME.git$ echo "exec /usr/local/bin/git-commit-notice" >> hooks/post-receive
/git/pkg-horde/DEBPKGNAME.git$ chmod +x hooks/post-receive
}}}

Init your own repository:
Line 15: Line 37:
/path$ mv upstream rep
/path$ cd rep

# init git repo and branches
/path/rep$ git init (Use --bar repos on alioth!)
/path/rep$ git add .
/path/rep$ git commit -m init
/path/rep$ git branch -m master upstream
/path/rep$ git branch upstream+patches upstream
/path/rep$ git branch upstream+repack upstream
/path$ mv upstream
/path$ cd rep DEBPKGNAME.git
# init Git repository
/path/DEBPKGNAME.git$ git init
/path/DEBPKGNAME.git$ git add .
/path/DEBPKGNAME.git$ git commit -m "Import PKGNAME VERSION"
# create branches
/path/DEBPKGNAME.git$ git branch -m master upstream
/path/DEBPKGNAME.git$ git branch upstream+patches upstream
/path/DEBPKGNAME.git$ git branch upstream+repack upstream (if needed!)
Line 27: Line 48:
/path/rep$ pristine-tar commit ../upstream.tar.gz /path/DEBPKGNAME.git$ pristine-tar commit ../upstream.tar.gz
Line 30: Line 51:
=== Repack upstream === Push all to alioth repository:

{{{
/path/DEBPKGNAME.git$ git remote origin ssh://LOGIN@git.debian.org/git/pkg-horde/DEBPKGNAME.git
# TODO: command to track all branches
/path/DEBPKGNAME.git$ git push --all
}}}

=== Repack upstream (if needed!) ===
Line 34: Line 63:
/path/rep$ git checkout upstream+repack
/path/rep$ sh cleanup-git.sh
/path/rep$ git commit -a -m repack
/path/rep$ tar --exclude .git -czf ../upstream+debian0.orig.tar.gz .
/path/rep$ pristine-tar commit ../upstream+debian0.orig.tar.gz upstream+repack
/path/DEBPKGNAME.git$ git checkout upstream+repack
/path/DEBPKGNAME.git$ sh cleanup-git.sh
/path/DEBPKGNAME.git$ git commit -a -m repack
/path/DEBPKGNAME.git$ tar --exclude .git -czf ../upstream+debian0.orig.tar.gz .
/path/DEBPKGNAME.git$ pristine-tar commit ../upstream+debian0.orig.tar.gz upstream+repack
Line 41: Line 70:
=== Debianization === If you don't need repack, don't forget to commit .orig.tar.gz:
Line 44: Line 73:
/path/rep$ git checkout -b debian-sid upstream+repack
/path/rep$ mkdir debian && hack hack....
/path/rep$ git add debian && git commit -m init
/path/DEBPKGNAME.git$ mv ../upstream.tar.gz ../DEBPKGNAME_VERSION.orig.tar.gz
/path/DEBPKGNAME.git$ pristine-tar commit ../DEBPKGNAME_VERSION.orig.tar.gz
}}}

=== First Debianization ===

{{{
/path/DEBPKGNAME.git$ git checkout -b debian-sid upstream+repack
/path/DEBPKGNAME.git$ mkdir debian && hack hack....
/path/DEBPKGNAME.git$ git add debian && git commit -m "First Debian packaging"
}}}

=== New upstream release ===

{{{
# Fetch new source
/path$ wget newupstream.tar.gz
/path$ tar -xvf newupstream.tar.gz
/path$ cd DEBPKGNAME.git
/path/DEBPKGNAME.git$ git checkout upstream
/path/DEBPKGNAME.git$ git_load_dirs -s 'Import new upstream sources' ../newupstream/
/path/DEBPKGNAME.git$ pristine-tar commit ../newupstream.tar.gz
# Merge new sources to upstream+patches branch
/path/DEBPKGNAME.git$ git checkout upstream+patches
/path/DEBPKGNAME.git$ git merge upstream
# Merge new sources to upstream+repack branch (if needed!)
/path/DEBPKGNAME.git$ git checkout upstream+repack
/path/DEBPKGNAME.git$ git merge upstream
hack... hack... if need of new repack
# Store .orig.tar.gz tarball
/path/DEBPKGNAME.git$ tar --exclude .git -czf ../newupstream+debian0.orig.tar.gz .
/path/DEBPKGNAME.git$ pristine-tar commit ../upstream+debian0.orig.tar.gz upstream+repack
Line 52: Line 110:
/path/rep$ git checkout debian-sid
/path/rep$ git merge upstream+repack
/path/rep$ dch && hack hack...
/path/rep
$ git commit -a -m hack
/path/DEBPKGNAME.git$ git checkout debian-sid
/path/DEBPKGNAME.git$ git merge upstream+repack
/path/DEBPKGNAME.git$ dch -v NEWVERSION
hack hack...
/path/DEBPKGNAME.git
$ git commit -a -m "New changelog"
hack hack...
Line 62: Line 122:
/path/rep$ dch && hack hack...
/path/rep$ git commit -a -m hack
/path/rep$ dch -v NEWVERSION
hack hack...
/path/rep$ git commit -a -m "New changelog"
hack hack...
Line 73: Line 135:
=== New upstream release === == Notes about migration from GNU Arch to Git ==
Line 75: Line 137:
{{{
/path$ wget newupstream.tar.gz
/path$ tar -xvf newupstream.tar.gz
/path$ cd rep
/path/rep$ git checkout upstream
/path/rep$ git_load_dirs -s 'Import new upstream sources' ../newupstream/
/path/rep$ pristine-tar commit ../newupstream.tar.gz
/path/rep$ git checkout upstream+patches
/path/rep$ git merge upstream
/path/rep$ git checkout upstream+repack
/path/rep$ git merge upstream
hack... hack... if needing of new repack
/path/rep$ tar --exclude .git -czf ../newupstream+debian0.orig.tar.gz .
/path/rep$ pristine-tar commit ../upstream+debian0.orig.tar.gz upstream+repack
}}}

== Notes about migration from GNU Arch to Git ==
Migration is done with git-archimport.
Line 96: Line 142:

# Fetch last upstream sources
/path$ wget upstream.tar.gz
/path$ tar -xvf upstream.tar.gz
/path$ mv upstream <pkg>.git
/path$ cd <pkg.git>

# Init git repo and branches
/path/<pkg>.git$ git init
/path/<pkg>.git$ git add .
/path/<pkg>.git$ git commit -m init
/path/<pkg>.git$ git branch -m master upstream
/path/<pkg>.git$ git branch upstream+patches upstream
/path/<pkg>.git$ git branch upstream+repack upstream

# pristine-tar upstream sources
/path/<pkg>.git$ pristine-tar commit ../upstream.tar.gz

# Create repack upstream sources
# (HERE IS IMPORT FROM ARCH)
cd /git/pkg-horde/archimport.git
git remote add imp4 /git/pkg-horde/imp4.git/
git push imp4 pkg-horde-hackers@lists.alioth.debian.org--2006,imp--sid--4:refs/heads/debian-sid
cd /path/<pkg>.git
git checkout debian-sid
cp -pr debian/ /tmp/
/usr/lib/git-core/git-merge-resolve upstream+repack (or git-merge-stupid)
cp -pr /tmp/debian/ .
git reset HEAD debian
# VERY IMPORTANT: GIVE ANCESTOR TO DEBIAN-SID FOR FUTURE MERGING!!
sh /tmp/git-merge-unrelated-branch . upstream+repack
Line 129: Line 144:
See http://wingolog.org/archives/2008/10/14/merging-in-unrelated-git-branches It's done in /git/pkg-horde/archimport.git on alioth.

Steps are :

1. Create a new repository (--bare repo on alioth with upstream branches)
   [SEE ABOVE]

2. Push GNU Arch branch to your new repository

{{{
~$ cd /git/pkg-horde/archimport.git
/git/pkg-horde/archimport.git$ git remote add DEBPKGNAME /git/pkg-horde/DEBPKGNAME.git/
/git/pkg-horde/archimport.git$ git push DEBPKGNAME pkg-horde-hackers@lists.alioth.debian.org--2006,PKGNAME--sid--VERSION:refs/heads/debian-sid
}}}

3. Merge upstream (or upstream-repack) to debian-sid branch

{{{
/path/DEBPKGNAME.git$ git pull
/path/DEBPKGNAME.git$ git checkout -b debian-sid origin/debian-sid
/path/DEBPKGNAME.git$ cp -pr debian/ /tmp/
/path/DEBPKGNAME.git$ /usr/lib/git-core/git-merge-resolve upstream+repack (or git-merge-stupid!)
/path/DEBPKGNAME.git$ cp -pr /tmp/debian/ .
/path/DEBPKGNAME.git$ git reset HEAD debian
}}}

Note: I'm aware it's a dirty way. Comments welcome!

4. VERY IMPORTANT: give ancestor to debian-sid branch for future merges

Download git-merge-unrelated-branch script from http://wingolog.org/archives/2008/10/14/merging-in-unrelated-git-branches

{{{
/path/DEBPKGNAME.git$ git checkout debian-sid
/path/DEBPKGNAME.git$ sh /tmp/git-merge-unrelated-branch . upstream+repack
}}}

Policy

  • One Git repository for each package : /git/pkg-horde/DEBPKGNAME.git on alioth (please use bare repository)
  • Branches: upstream, upstream+repack (if needed), upstream+patches, debian-sid, debian-etch, debian-lenny.
  • Use pristine-tar for upstream and Debian sources

Howto

New repo for new package

Init git repository on alioth:

/git/pkg-horde$ mkdir DEBPKGNAME.git
/git/pkg-horde$ cd DEBPKGNAME.git
/git/pkg-horde/DEBPKGNAME.git$ git --bare init

Note: please use a bare repository. We will have a clean Gitweb URL like http://git.debian.org/?p=pkg-horde/DEBPKGNAME.git and not http://git.debian.org/?p=pkg-horde/DEBPKGNAME.git/.git with a non-bare repository

Configure the repository:

/git/pkg-horde/DEBPKGNAME.git$ echo "Debian Horde Packages repository: DEBPKGNAME package" > description
/git/pkg-horde/DEBPKGNAME.git$ git config --add hooks.mailinglist "pkg-horde-hackers@lists.alioth.debian.org"
/git/pkg-horde/DEBPKGNAME.git$ echo "exec /usr/local/bin/git-commit-notice" >> hooks/post-receive
/git/pkg-horde/DEBPKGNAME.git$ chmod +x hooks/post-receive

Init your own repository:

# fetch upstream sources
/path$ wget upstream.tar.gz 
/path$ tar -xvf upstream.tar.gz
/path$ mv upstream 
/path$ cd rep DEBPKGNAME.git
# init Git repository
/path/DEBPKGNAME.git$ git init
/path/DEBPKGNAME.git$ git add .
/path/DEBPKGNAME.git$ git commit -m "Import PKGNAME VERSION" 
# create branches
/path/DEBPKGNAME.git$ git branch -m master upstream
/path/DEBPKGNAME.git$ git branch upstream+patches upstream
/path/DEBPKGNAME.git$ git branch upstream+repack upstream (if needed!)
# pristine-tar upstream sources
/path/DEBPKGNAME.git$ pristine-tar commit ../upstream.tar.gz

Push all to alioth repository:

/path/DEBPKGNAME.git$ git remote origin ssh://LOGIN@git.debian.org/git/pkg-horde/DEBPKGNAME.git
# TODO: command to track all branches
/path/DEBPKGNAME.git$ git push --all 

Repack upstream (if needed!)

# repack upstream
/path/DEBPKGNAME.git$ git checkout upstream+repack
/path/DEBPKGNAME.git$ sh cleanup-git.sh
/path/DEBPKGNAME.git$ git commit -a -m repack
/path/DEBPKGNAME.git$ tar --exclude .git -czf ../upstream+debian0.orig.tar.gz .
/path/DEBPKGNAME.git$ pristine-tar commit ../upstream+debian0.orig.tar.gz upstream+repack

If you don't need repack, don't forget to commit .orig.tar.gz:

/path/DEBPKGNAME.git$ mv ../upstream.tar.gz ../DEBPKGNAME_VERSION.orig.tar.gz
/path/DEBPKGNAME.git$ pristine-tar commit ../DEBPKGNAME_VERSION.orig.tar.gz

First Debianization

/path/DEBPKGNAME.git$ git checkout -b debian-sid upstream+repack
/path/DEBPKGNAME.git$ mkdir debian && hack hack....
/path/DEBPKGNAME.git$ git add debian && git commit -m "First Debian packaging"

New upstream release

# Fetch new source
/path$ wget newupstream.tar.gz
/path$ tar -xvf newupstream.tar.gz
/path$ cd DEBPKGNAME.git
/path/DEBPKGNAME.git$ git checkout upstream
/path/DEBPKGNAME.git$ git_load_dirs -s 'Import new upstream sources' ../newupstream/
/path/DEBPKGNAME.git$ pristine-tar commit ../newupstream.tar.gz
# Merge new sources to upstream+patches branch
/path/DEBPKGNAME.git$ git checkout upstream+patches
/path/DEBPKGNAME.git$ git merge upstream
# Merge new sources to upstream+repack branch (if needed!)
/path/DEBPKGNAME.git$ git checkout upstream+repack
/path/DEBPKGNAME.git$ git merge upstream
hack... hack... if need of new repack
# Store .orig.tar.gz tarball
/path/DEBPKGNAME.git$ tar --exclude .git -czf ../newupstream+debian0.orig.tar.gz .
/path/DEBPKGNAME.git$ pristine-tar commit ../upstream+debian0.orig.tar.gz upstream+repack

New Debian package with new upstream

/path/DEBPKGNAME.git$ git checkout debian-sid
/path/DEBPKGNAME.git$ git merge upstream+repack
/path/DEBPKGNAME.git$ dch -v NEWVERSION
hack hack...
/path/DEBPKGNAME.git$ git commit -a -m "New changelog"
hack hack...

New Debian package

/path/rep$ git checkout debian-sid
/path/rep$ dch -v NEWVERSION
hack hack...
/path/rep$ git commit -a -m "New changelog"
hack hack...

Build Debian package

/path/rep$ git checkout debian-sid
/path/rep$ git-buildpackage -us -uc --git-pristine-tar --git-upstream-branch=upstream+repack --git-debian-branch=debian-sid

Notes about migration from GNU Arch to Git

Migration is done with git-archimport.

# Migration of all GNU Arch repo 
git-archimport -v pkg-horde-hackers@lists.alioth.debian.org--2006

It's done in /git/pkg-horde/archimport.git on alioth.

Steps are :

1. Create a new repository (--bare repo on alioth with upstream branches)

  • [SEE ABOVE]

2. Push GNU Arch branch to your new repository

~$ cd /git/pkg-horde/archimport.git
/git/pkg-horde/archimport.git$ git remote add DEBPKGNAME /git/pkg-horde/DEBPKGNAME.git/
/git/pkg-horde/archimport.git$ git push DEBPKGNAME pkg-horde-hackers@lists.alioth.debian.org--2006,PKGNAME--sid--VERSION:refs/heads/debian-sid

3. Merge upstream (or upstream-repack) to debian-sid branch

/path/DEBPKGNAME.git$ git pull
/path/DEBPKGNAME.git$ git checkout -b debian-sid origin/debian-sid
/path/DEBPKGNAME.git$ cp -pr debian/ /tmp/
/path/DEBPKGNAME.git$ /usr/lib/git-core/git-merge-resolve upstream+repack (or git-merge-stupid!)
/path/DEBPKGNAME.git$ cp -pr /tmp/debian/ .
/path/DEBPKGNAME.git$ git reset HEAD debian

Note: I'm aware it's a dirty way. Comments welcome!

4. VERY IMPORTANT: give ancestor to debian-sid branch for future merges

Download git-merge-unrelated-branch script from http://wingolog.org/archives/2008/10/14/merging-in-unrelated-git-branches

/path/DEBPKGNAME.git$ git checkout debian-sid
/path/DEBPKGNAME.git$ sh /tmp/git-merge-unrelated-branch . upstream+repack