Cherry-Picking With Git, For Fun And For Profit
(This is more as a reminder to myself in the future, rather than a full-fledged posting.)
As I learn more about Git and how we use it in Fedora packaging, I keep discovering cool new things about it that I love. One particular aspect that I’m quickly growing to adore is the feature to cherry-pick between commits in related branches. Suppose I’m currently working on the master branch of a package which is kept in sync with f16 and f17 branches.
Now, a new version comes up or I make a patch to fix a bug. After committing the changes to master, I can easily copy those commits to the release branches with a simple cherry-pick operation:
$ fedpkg switch-branch f17 $ git cherry-pick master
This copies the most recent commit from the master branch into the current one. (See the Git documentation for more information on specifying commit IDs.) Compare this to CVS, where we had to manually diff the devel/ branch directory and apply that to each branch by hand…it’s so much nicer with Git. 🙂
Then it’s a simple matter to push the changes to the Fedora repository and run builds for them through Koji, by running fedpkg push and fedpkg build in each branch. Sweet!
Also, the fullscreen mode of WordPress’ new post editor is fantastic – I owe someone a beverage for that.
Now to get some sleep, so I can finish this Algorithm Analysis project tomorrow. Ta for now!