Abstract: You can now create Understand Comparison Projects directly from git.
If you have been keeping up with the blog, articles such as these might have given you a hint that Git Comparison Projects were coming:
- How Hard is it? – using Understand to find all the places in our codebase we need to update to support reading files from git
- As-Built Documentation – using Understand to update the C++ strict parser to read files from Git.
- Getting Git: Scanning Directories – how watched directory projects had to be updated
- Getting Git: Submodules – how to seamlessly handle submodules
Git Comparison Projects are finally here! So what are they?
Regular Comparison Projects have been available in Understand for a while. With a comparison project set, you can:
- Compare the entities in your current project to the entities in the comparison project with the Changed Entities Locator.
- Use the “Compare” variant of most graphs to visualize what has changed.
I am reluctant to admit it, but Kevin already wrote a great article describing these features: Visualizing Change.
The limitation with comparison projects was that you had to create a complete copy of your source tree for the second project. Git comparison projects overcome this limitation by reading files directly from Git.
To set one up, use the “Compare Menu” to access the soon-to-be-named “Comparison Projects” option (this might be named “Compare Projects” in your current build). This opens a panel with your comparison projects:
The toolbar options from left to right are:
- Create a new comparison project from Git.
- Open a project on disk to use as a comparison project.
- Close the open comparison project. This may be necessary to analyze the comparison project in another instance of Understand or from the command line.
- Analyze the comparison project.
- Remove the comparison project from the list of comparison projects.
Clicking Create will bring up this dialog:
The new project will use the current project’s settings except that files will be read from Git instead of from disk. You can also create multiple comparison databases and switch between them with a double-click. The list is most-recently-used order:
Git comparison projects are complete Understand projects. In addition to the comparison features available, you can also open the projects directly to browse the code at that point in history with all the “Understand Goodness.”
I’ll freely admit that like “De-Mystifying Dependencies” this article is more of a support article on the existence of a feature than a true blog post. To find out why I wrote it anyway, check out this article about our friendly competition. And, for more technical articles on Git, try: