Differences between revisions 8 and 10 (spanning 2 versions)
Revision 8 as of 2009-04-21 01:31:21
Size: 3701
Comment:
Revision 10 as of 2009-04-25 23:50:54
Size: 3727
Comment:
Deletions are marked like this. Additions are marked like this.
Line 118: Line 118:
git push imp4 pkg-horde-hackers@lists.alioth.debian.org--2006,imp--sid--4:refs/heads/horde-sid git push imp4 pkg-horde-hackers@lists.alioth.debian.org--2006,imp--sid--4:refs/heads/debian-sid
Line 120: Line 120:
git checkout debian-sid

Policy

  • One Git repository for each package
  • Branches: upstream, upstream+repack, upstream+patches, debian-sid, debian-etch, debian-lenny...
  • Use pristine-tar for upstream and Debian sources

Howto

New repo for new package

# fetch upstream sources
/path$ wget upstream.tar.gz 
/path$ tar -xvf upstream.tar.gz
/path$ mv upstream rep
/path$ cd rep

# init git repo and branches
/path/rep$ git init
/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

# pristine-tar upstream sources
/path/rep$ pristine-tar commit ../upstream.tar.gz

Repack upstream

# repack upstream
/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

Debianization

/path/rep$ git checkout -b debian-sid upstream+repack
/path/rep$ mkdir debian && hack hack....
/path/rep$ git add debian && git commit -m init

New Debian package with new upstream

/path/rep$ git checkout debian-sid
/path/rep$ git merge upstream+repack
/path/rep$ dch && hack hack...
/path/rep$ git commit -a -m hack

New Debian package

/path/rep$ git checkout debian-sid
/path/rep$ dch && hack hack...
/path/rep$ git commit -a -m 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

New upstream release

/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 of all GNU Arch repo 
git-archimport -v pkg-horde-hackers@lists.alioth.debian.org--2006

# 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

See http://wingolog.org/archives/2008/10/14/merging-in-unrelated-git-branches