Managing project branches

You can manage your project branches in two ways; by using streams (the recommended method), or by using separate projects for each branch. See below for more details.

Using streams

You can manage your project branches using streams in Validate, allowing you to:

  • set up your configuration for your project and its branches, once

  • automatically sync known and/or cited issues which exist on different branches of your project, allowing you to only cite a defect once if it exists on multiple branches

  • identify which defects are unique to a branch of your project

  • identify how many individual defects exist in a branch and its branches, by using the consolidated list

  • identify issues which exist across streams in the Issue Details dialog

To set up streams for your project:

  1. Go to Validate and create a project for your repository's master branch.
  2. Load analysis results by analyzing your repository's master branch.
  3. Within Validate, create a stream for each branch of the project you want to track issues for.
  4. Load your analysis results by analyzing each relevant branch that you added a stream for.

Note that you can also create a stream within a stream to reflect tracking analysis results from a branch of another branch. Also, you do not need to load analysis results for all existing streams, or even the base project. You can create streams that mimic your repository's branch structure even if they are not loaded with analysis results.

Using separate projects

Alternatively, you can manage project branches using separate projects in Validate:

  • set up and analyze a Klocwork project for branched code
  • run kwxsync to synchronize issue status changes and comments across projects, so that developers need to investigate and cite detected issues only once for source code that is shared by multiple projects
  • run kwmatch to match issues across projects, so that Validate displays a list of other projects in which a particular issue appears

While kwxsync and kwmatch both help you to manage branched projects, they serve different purposes, and it is not necessary to run both tools. Cross-project issue synchronization with kwxsync saves time in citing issues that occur in multiple projects. Cross-project issue matching with kwmatch can help you prioritize when citing issues -- an issue that appears in multiple projects likely has a high priority.