These are Jonas' small convenience scripts to 1) initiate a local packaging environment based on upstream Git, and 2) push the locally prepared packaging into a new Git at Alioth.

You will want to modify them, as they use Jonas' account name on alioth :-)

init

#!/bin/sh

user=js

set -e

pkg=$1
shift

upstream_pkg=${1:-$pkg}

mkdir $pkg
cd $pkg
git init
git remote add origin ssh://$user@git.debian.org/git/collab-maint/$pkg
git config branch.master.merge refs/heads/master
git remote add -t master -m master upstream-repo git://dev.laptop.org/$upstream_pkg
git fetch upstream-repo
git checkout -b upstream upstream-repo/master
git checkout -b master
cd ..

push

#!/bin/sh

user=js

set -e

pkg=$1
shift

ssh $user@git.debian.org "cd /git/collab-maint && ./setup-repository $pkg $pkg Debian packaging"
cd $pkg
git push --all
git push --tags
cd ..

sync

#!/bin/sh

set -e

upstreamversion="$1"

exit1() {
        echo "ERROR: $1"
        exit 1
}

#[ -z "$(git-diff --cached HEAD)" ] || exit1 "Unclean Git."
git status | tail -n 1 | grep '^nothing to commit (working directory clean)$' || exit1 "Unclean Git."

git checkout upstream-git && git fetch --tags && git pull; git checkout master

[ -n "$upstreamversion" ] || upstreamversion="$(git tag -l 'v*' | perl -ne 's/^v(\d+(\.\d+)*)$/$1/ && print $_' | sort -t. -g | tail -n 1)"
[ -n "$upstreamversion" ] || exit1 "Unable to resolve upstream version from Git tags and none provided"

git checkout upstream && git merge v$upstreamversion; git checkout master
git merge v$upstreamversion

dch -v $upstreamversion-0 -D UNRELEASED "New upstream release (interim changelog entry)."
sed -i -e 's/^\(DEB_UPSTREAM_TARBALL_MD5\b\)/#\1/' debian/rules
debian/rules get-orig-source
git reset --hard HEAD

#git-import-orig --pristine-tar --sign-tags --no-dch
#dch -v $upstreamversion-1 -D UNRELEASED "New upstream release."
#FIXME: grab md5sum from get-orig-source above
#sed -i -e '/^DEB_UPSTREAM_TARBALL_MD5\b/ s/\s*=\s*.*/ = '$md5sum'/' debian/rules
#git add debian/changelog debian/rules
#debcommit

prerelease

#!/bin/sh

set -e

localdistro=jones

# optionally override the "microversion" (default is 1)
localversion="$1"

components="${2:-lenny etch+src}"

exit1() {
        echo "ERROR: $1"
        exit 1
}

#[ -z "$(git-diff --cached HEAD)" ] || exit1 "Unclean Git."
git status | tail -n 1 | grep '^nothing to commit (working directory clean)$' || exit1 "Unclean Git."

dch_opts="-D $localdistro --force-distribution"
if [ -n "$localversion" ]; then
        version="$(dpkg-parsechangelog --show-field=Version)"
        dch_opts="$dch_opts -v $version~0$localdistro$localversion --force-bad-version"
else
        dch_opts="$dch_opts -l ~0jones"
fi
dch $dch_opts "Unofficial build based on Debian Sid packaging."

localcowbuilder-update $components
localgitcowdebuild $components --git-ignore-new

git reset --hard HEAD