Policy

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 (or git-rebase?)
/path/rep$ git checkout upstream+repack
/path/rep$ git merge upstream (or git-rebase?)
(=> Verify if "ours" merging keep new files or not!)
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/horde-sid
cd /path/<pkg>.git
cp -pr debian/ /tmp/
/usr/lib/git-core/git-merge-resolve upstream+repack
cp -pr /tmp/debian/ .