[Pkg-puppet-devel] Cherry picking 865282a from upstream branch

Stig Sandbeck Mathisen ssm at debian.org
Tue Aug 3 00:26:11 UTC 2010


Mathias Gug <mathiaz at ubuntu.com> writes:

> While working on integrating puppetmaster with mod-passenger I ran
> into a bug that was fixed in the upstream git repository:
>
>   865282a Fixed example config.ru
>
> Which git commands should I run to cherry pick the fix from the
> upstream git repository into the debian git branch?

First, both the "master" and "upstream" branches are available from the
debian repo.  Add a remote, and fetch the two named branches:

git remote add -f -t master -t upstream -t pristine-tar debian \
               git://git.debian.org/pkg-puppet/puppet.git


(Hint: If you (install and) run "gitk &" in your working dir, you get a
nice gui which will show you what happens with your branches.
Incredibly helpful application, that.)

Then, you do:

##############################

Short version:

git checkout master
git cherry-pick 865282a

##############################

Not-so-short version, to go via a "next" branch, so you won't mess up
your master branch with tests:

git checkout -b next master
git cherry-pick 865282a
<test build, or test until build>
<commit a separate changelog entry>
git checkout master
git merge next

##############################

Even longer version, if you have several things to do, each in its own
topic branch, based on "master".

This is my workflow:

,----[ Fix two issues, each in its own topic branch ]
| git checkout -b bug/1234-something master
| <fix bug 1234>
| git commit -m 'Stuff that will end up in debian/changelog (Closes: #1234)'
| 
| git checkout -b feature/do-some-foo-bar-fix
| <fix foo bar>
| git commit -m 'More stuff for the changelog'
`----

If you have each fix in its own branch, you can do test cycles for each
bug like this:

,----[ Topic branch loop, until it works ]
| git clean -f -d; git reset --hard
| <edit some more>
| git commit --amend
| debuild -us -uc
`----
 
...and you will end up with just one commit for each fix.

,----[ Merge all topic branches into an integration branch ]
| # Make an integration branch called next
| git checkout -b next master
| git merge bug/1234-something master feature/do-some-foo-bar-fix
| 
| # If it complains about conflicts, run
| # "git mergetool"
| # and then
| # "git commit"
| 
| # Make the changelog, and commit that
| git-dch --debian-branch=next --since=master --new-version=2.1.3-4
| git add debian/changelog
| git commit -m 'Release 2.1.3-4'  # (Or just "update changelog, if it is
|                                  # not a release)
`----

,----[ Merge into next, build the final package, tag a release ]
| git checkout master
| git merge next
| 
| git-buildpackage -S -us -uc
| ( cd ..; sbuild puppet-<version>.dsc )
| git-buildpackage --git-tag-only --git-sign-tags
`----

This mail got longer than I intended it to be :)
-- 
Stig Sandbeck Mathisen
                      ooo, shiny!
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/pkg-puppet-devel/attachments/20100803/838b5bb7/attachment.pgp>


More information about the Pkg-puppet-devel mailing list