Review a Commit’s Files
Use the Source Tree page to review the files -- new, deleted, or modified -- associated with a specific commit. Clicking a text file displays its contents in a file viewer. The contents of binary files (graphics and executables, for example) cannot be displayed.
The ability to view file contents can help developers troubleshoot problems. For example, imagine that a customer using version 6.2.1 of your software reports an error, referencing the following log message:
2014-07-07 17:27:47,858 ERROR LoginForm:83 gerrit.canonicalWebUrl must be set in gerrit.config
You could locate the v6.2.1 tag in the Source Tree page, navigate the directory path, and open
LoginForm.java to view line 83.
The Source Tree page represents a snapshot of the repository at the time of the selected commit. Each row on the Source Tree page represents a directory or file in the source code. You can start from either the Commits or Source Tree page as described in the following sections.
Starting from the Commits Page
To review the files in a commit from the Commits page:
1. Click the Commits tab to display the Commits page.
The Repo and Branch fields retain their last values, even if they were set on the Source Tree or Branches pages.
2. Select the repository from the Repo drop-down menu.
If available, the master branch for the repository you choose is selected by default in the Branch field. Otherwise, GitCentric displays the first branch in the repository based on an alphanumeric sort.
3. Optionally, use the Branch drop-down menu to choose a branch other than Master or a tag.
Tip: The list in the drop-down menu includes only branches by default. You can also include (or restrict the list to)
tags, which are often used to mark important milestones like release points (v2.0, for example). If you choose a tag, GitCentric changes the
Branch icon and label to
Tag:
.
GitCentric refreshes the Commits page to update the starting point of the history. Each row represents a single commit, starting with the most recent. Scroll the page to reach the origin of the commit graph.
4. Locate the commit whose files you want to review and click the Source Tree link.
Tip: If you want to review the files for the first commit in the current branch or tag, click the Source Tree tab.
5. Click the folders associated with the gravatar of the user whose commit you are reviewing. GitCentric updates the path displayed in Current Directory field as you navigate the source tree.
Tip: The name of this field changes to Current File when you select a file for viewing.
Starting from the Source Tree Page
To review the files in a commit from the Source Tree page:
1. Click the Source Tree tab to display the Source Tree page.
The Repo and Branch fields retain their last values, even if they were set on the Commits or Branches pages.
2. Select the repository from the Repo drop-down menu.
If available, the master branch for the repository you choose is selected by default in the Branch field. Otherwise, GitCentric displays the first branch in the repository based on an alphanumeric sort.
3. Optionally, use the Branch drop-down menu to choose a branch other than Master or a tag.
Tip: The list includes only branches by default. You can also include (or restrict the list to) tags, which are often used to mark important milestones like release points (v2.0, for example).
4. Click the folders associated with the gravatar of the user whose commit you are reviewing. GitCentric updates the path displayed in Current Directory field as you navigate the source tree.
Tip: The name of this field changes to Current File when you select a file for viewing.
Information Displayed on the Source Tree Page
As shown in this example, the Source Tree page provides several features that make it easy to locate new, deleted, and modified files in a commit: