wiki:StartModMaint

Version 8 (modified by Beman Dawes, 9 years ago) ( diff )

--

Getting Started with Modular Boost Library Maintenance

This page describes the mechanics of maintaining a Boost library using Git and Modular Boost. The intended audience is developers involved in the maintenance of existing Boost libraries.

The Big Picture

Library maintenance occurs in the context of how Boost repositories are organized. Please study the Modular Boost Overview before continuing, since a Boost developer needs to be familiar with how Boost organizes its repositories.

The examples given on this page follow Boost recommended workflow practices, but avoid discussion of workflow rationale to keep this introductory level page simple. If you feel you need to understand workflow rationale before continuing, feel free to read Modular Boost Library Workflow Overview.

Prerequisites

Checking out the branch

cd modular-boost/libs/mylib
git branch

Will tell you what branch your local repo working copy is on. To change to develop for a really simple bug fix do this:

cd modular-boost/libs/mylib
git checkout develop

You only have to do that once; your local repo working copy will sit on that branch until it is explicitly changed by a command you give.

If there is any possibility the branch in the public upstream repo has changed, you also will want to:

git pull

Verify Tests Working

Before making any changes to you library, which we will call mylib, be sure the test suite is working in the modular Boost environment:

cd test
b2

Fix a simple bug

These commands could be used for any Git project, modular or not, so hopefully you are already somewhat familiar with them:

cd modular-boost/libs/mylib
# make edits
# test as above
git commit -a -m "my bug fix"
git push

Start work on a new feature

Simple bugs are usually fixed on the develop branch, at least in smaller projects. There is usually no need to first create a bug-fix branch. But git developers usually create a (possibly private) branch to work on new features, since development of new features on the development branch might leave it unstable for longer that expected.

... to be supplied ...

Merging to Master for the First Time

When you are ready to merge either the develop branch (or better a release branch that's forked off from develop), there's a bit of housekeeping to be done the first time (assuming your library was originally in SVN) so that future merges proceed smoothly. We're going to create a merge point between the develop and master branches so that Git knows the last point the two branches were in synch. Once we've done that Git will perform a merge by replaying the commits on develop on top of master, starting from the last known merge: in other words Git will perform the tricky stuff of figuring out what to merge for us.

Begin by navigating to the history for your library on Github, starting with branch master, for example the Config library can be seen here. Looking down through the commit history we can see that the last merge (In SVN land) was on October 25th 2013: make a note of that date. Now use the dropdown box to change the history to point to the develop branch, Config library can be seen here. As you can see there have been several commits since the date above, the last before that date was on Oct 21st, click on the commit message for that change to take you to the actual diff for that change, in our example here. The SHA1 for that commit is shown below and to the right of the commit message, in this case it's 67f6b934f161dc5da2039004986a14d9217afae4.

Now we'll create a merge to the specific commit, begin by changing your library to the master branch:

git checkout master

Now create a merge to the specific commit above: since we don't really want to actually change the master branch we'll use the -s ours option to avoid any conflicts:

git merge --no-ff --no-commit -s ours 67f6b934f161dc5da2039004986a14d9217afae4

You can now use git status and git diff to check for modifications, in this case there are none. Now make the commit:

git commit -am "Create first merge point for Git"

And finish off by pushing your changes to Github

git push

Then navigate to your libraries history again, and check that the merge shows up, our config example is here. You're now ready for "routine" merges to proceed as per Gitflow (or whatever other strategy you wish to use).

Note: See TracWiki for help on using the wiki.