# Maintainer documentation for initramfs-tools

## Table of Contents

- 1. Definitions
- 2. Preparations
- 3. Workflow for daily work
  - 3.1 Implement new features
  - 3.2 Merge branches
  - 3.3 Test specific branch
  - 3.4 Build snapshot version
- 4. Contribute
- 5. Release new version
- 6. Resources
- 7. Credits
- 8. License

NOTE: The most recent version of this document is available at docs/maintainer-notes.html in the the git repository or online at git.debian.org.

## 1. Definitions

`$mailaddress:` | mailaddress of the user
`$username:` | name of the alioth account
`$version:` | version string
`$yourname:` | your fullname

^

## 2. Preparations

1. Install required software (notice: git is named git-core on Debian/oldstable):

       # apt-get install git git-buildpackage dpkg-dev

2. Set environment variables (e.g. through your ~/.bashrc or ~/.zshrc) for devscripts (git dch):

       export DEBEMAIL=$mailaddress
       export DEBFULLNAME=$yourname

3. Set user name and email address for git (drop the --global option to use configuration per-repo basis):

       % git config --global user.name  "$yourname"
       % git config --global user.email "$mailaddress"

4. Checkout repository (anonymous):

       % git clone git://git.debian.org/git/kernel/initramfs-tools.git
       % cd initramfs-tools

5. Checkout repository (with developer access):

       % git clone ssh://$username@git.debian.org/git/kernel/initramfs-tools.git
       % cd initramfs-tools

^

## 3. Workflow for daily work

### 3.1 Implement new features

1. Checkout new branch and switch to it:

       % git checkout -b $username/short-descr-of-new-feature

2. Hack and commit work:

       % $EDITOR $somefile
       % git add $somefile
       % git commit -s

   NOTE: Use 'Closes: #BUGID' for closing a bugreport and 'Thanks: Fullname <`mailaddress`>' for giving credits in your commit message. git dch will use this information for generating the changelog using the --meta option later on.
3. Finally push your branch to alioth:

       % git push origin $username/short-descr-of-new-feature

### 3.2 Merge branches

1. Switch to the branch you want to merge:

       % git checkout $username/new-feature

2. Rebase to master:

       % git rebase master

3. Switch to master branch and merge:

       % git checkout master
       % git merge $username/new-feature

4. Push:

       % git push

5. After branch is merged delete branch on server and locally:

       % git push origin :$username/short-descr-of-new-feature
       % git branch -d $username/short-descr-of-new-feature

6. If a branch is removed from the server it will stay locally. You can get of any stale remote branches locally by executing:

       % git remote prune origin

### 3.3 Test specific branch

1. Checkout a specific branch iff branch is not already present locally:

       % git checkout -b somename/short-descr-of-new-feature origin/somename/short-descr-of-new-feature

2. Checkout a specific branch iff branch is already present locally:

       % git checkout -b somename/short-descr-of-new-feature

3. Adjust debian/changelog accordingly:

       % git dch --debian-branch="$(git branch | awk -F\*\   '/^* / { print $2}' )" \
         --since="v$(dpkg-parsechangelog | awk '/^Version:/ {print $2}')" -S --id-length=7 --meta --multimaint-merge

4. Build package:

       % git buildpackage --git-ignore-new --git-debian-branch="$(git branch | awk -F\*\  '/^* / { print $2}' )" -tc

^

### 3.4 Build snapshot version

1. Adjust debian/changelog accordingly:

       % git dch --debian-branch="$(git branch | awk -F\*\   '/^* / { print $2}' )" \
         --since="v$(dpkg-parsechangelog | awk '/^Version:/ {print $2}')" -S --id-length=7 --meta --multimaint-merge

2. Build package:

       % git buildpackage --git-debian-branch="$(git branch | awk -F\*\  '/^* / { print $2}' )" -tc [-us -uc]

^

## 4. Contribute

1. Create patch:

       % git format-patch -s -p origin/master

2. Send patch file(s) to maintainers via mail (requires Debian package git-email):

       % git send-email --to=initramfs-tools@packages.debian.org $PATCHFILE[S]

3. The development mailinglists are debian-kernel@lists.debian.org and initramfs@vger.kernel.org. Discussion of features, bugs and patches are more than welcome on one of these lists.

^

## 5. Release new version

1. Creating changelog:

       % git dch --debian-branch master --release --since HASH

   or more dynamically:

       % git dch --meta --release --since v$(dpkg-parsechangelog | awk '/^Version:/ {print $2}') --debian-branch="$(git branch | awk -F\*\  '/^* / { print $2}' )" --id-length=7 --meta --multimaint-merge

   NOTE: we do not use history based sorting for the changelog entries but sort them by author.
2. Releasing:

       % git commit -a -s -m "Releasing version $version."

3. Tagging:

       % git tag -s v"$version" -m "release $version"

4. Pushing:

       % git push
       % git push --tags

5. Build in chroot and upload to ftp-master.
6. Send mail announcing the new initramfs-tools version with subject "initramfs-tools $VERSION release" to initramfs@vger.kernel.org, debian-kernel@lists.debian.org + kernel-team@lists.ubuntu.com - including a shortlog (generated through "git shortlog $TAG..").

^

## 6. Resources

- initramfs-tools git web interface
- initramfs @ debian-wiki
- bugreports
- initramfs-tools @ PTS
- popcon graph
- bugcount for initramfs-tools
- bugreports @ ubuntu
- qa page @ ubuntu

^

## 7. Credits

- Thanks to Daniel Baumann for his "Debian Packaging with Git" which inspired this document.

^

## 8. License

- This document is licensed under GPL v2 or any later version.

^

-- Michael Prokop <mika@debian.org>