Inspection
Repository treemap
3 min read
The treemap draws the repository as nested rectangles: each folder is a rectangle, divided into the rectangles of its subfolders and files. The area is the size in bytes. The color shows how much each file changed in a period, or when it last changed.
This way you spot at a glance the large files, the parts of the code that change all the time (candidates for refactoring or for tests) and the ones that have been untouched for a long time.
- Repository tab menu: Contributors, activity and treemap, Treemap tab.
- Palette (Ctrl+P): "Repository treemap (size and changes by folder)".
- Open the treemap from the palette.
- Versora reads the sizes ("Reading sizes…") and then the changes in the history ("Reading changes in the history…"). Both readings have a progress bar and Cancel.
- Choose the Period of changes: 3 months, 1 year, 3 years or All.
- Choose the Color:
- How much it changed: how many commits touched each file in the period;
- Recent change: how long ago the last change was.
- Hover over a rectangle to see the name, how many files it has, the changes in the period and the date of the last change.
- Click a folder to go into it. The Repository › … trail at the top takes you back. Click a file to open it in the revision tree.
- Prefer numbers? Click View as list. The list has the Name, Size, Files, Commits and Last change columns. View as map goes back.
- To analyze another revision, change the Revision at the top of the screen.
| Item | What it does |
|---|---|
| Open folder (folder) or Open in tree (file) | Goes into the folder or opens the file in the tree. |
| Show in the revision tree | Opens the tree already on the folder or file. |
| History | Opens the file history, or the folder's, up to the revision. |
| Contributors | Opens the contributors for that item only. |
| Activity | Opens the activity for that item only. |
Items too small to show up are grouped into an "N more items" rectangle, which has no menu.
| Option | What it does | Default |
|---|---|---|
| Period of changes | Which commits count for the color: from the last 3 months, 1 year or 3 years, or All. | All |
| How much it changed | Color by the number of commits in the period, per file, from "none" to "most". | Selected |
| Recent change | Color by the date of the last change: "outside the period", "over 6 months ago", "within 6 months", "within 3 months" and "last month". | — |
| View as list | Replaces the map with a table. | Map |
Read only:
git ls-tree -r -l -z <revision> # size of each file
git log --no-merges --name-status -M -z --format=%x1e%at [--since=@<start>] <revision> # changes in the period
-M follows renames backward, and the changes to a renamed file count toward its current name.
The treemap doesn't change the repository. There's nothing to undo.
- "Partial: only the newest N commits were read": the reading of the changes was canceled midway. The colors only reflect those commits.
- "no commits in the period": nothing changed in the chosen period. Widen the period.
- "This folder doesn't exist in this revision.": the folder open in the trail doesn't exist in the chosen revision. Go back to Repository.
Tip
Large binary files that change a lot are good candidates for Git LFS. See also the diagnostics in Optimize the repository, which lists the largest files in the history.
The treemap has no preference of its own and no company policy key.