Analyse local changes
--local-changes analyses only the files that differ from the remote tracking branch: committed but not pushed,
staged, unstaged and untracked. On a large project that gives you the metrics of your work in progress in seconds.
Deleted files are included with empty metrics, so they can show as absent in the map.
The Unified Parser and the Raw Text Parser support the flag. The Dependency Parser rejects it, because the dependency graph needs every file of the project, and the Domain Language Parser accepts it without effect.
Quick start
Section titled “Quick start”ccsh unifiedparser . -o changes.cc.json --local-changesccsh rawtextparser . -o changes.cc.json --local-changesThe flag combines with other options such as --exclude, --file-extensions or --bypass-gitignore, but not with
--commit.
What it analyses
Section titled “What it analyses”| File state | In the output |
|---|---|
| Changed (staged, unstaged, untracked, committed but not pushed) | analysed with full metrics |
| Deleted | included with empty metrics {} |
| Unchanged | left out |
The parser finds the upstream branch with git rev-parse --abbrev-ref @{upstream}. Without one it stops with an
error that tells you how to set it, for example git branch --set-upstream-to=<remote>/<branch>.
Combine with a full analysis
Section titled “Combine with a full analysis”ccsh unifiedparser . -o full.cc.json # full analysis, run once or now and thenccsh unifiedparser . -o changes.cc.json --local-changes # only your changesccsh merge full.cc.json.gz changes.cc.json.gz -o merged.cc.jsonOutput is gzip-compressed by default, so the merge reads the .gz files and writes merged.cc.json.gz.
Requirements
Section titled “Requirements”- The project folder is inside a git repository.
gitis on thePATH.