Git Diff Risk Analyzer
Rank Git diff files by churn and repository risk signals, with transparent scores that guide owner review without claiming merge safety.{{ summaryHeading }}
Review decision
{{ decisionSummary }}
- {{ action }}
Requested format: {{ requestedFormatLabel }} → {{ resolvedFormatLabel }}. Risk points are a repository-authored triage index, not an official Git, security, or merge-safety standard.
| Path | Delta | Score | Level | Risk signals | Review note | Copy |
|---|---|---|---|---|---|---|
| {{ row.path }} | +{{ row.additions }} / −{{ row.deletions }} | {{ row.score }} | {{ row.level }} | {{ row.signals }} | {{ row.review_note }} |
| Focus | Evidence | Severity | Recommended action | Copy |
|---|---|---|---|---|
| {{ row.focus }} | {{ row.evidence }} | {{ row.severity }} | {{ row.recommended_action }} |
{{ chartError }}
Review attention is limited, and a change summary can help spend it where mistakes would be costly. The largest file is not always the most important one: a small authorization change may need a specialist, while hundreds of generated lines may need provenance checks more than line-by-line reading.
Git summaries describe the shape of a change before the full patch is opened. Numstat gives additions and deletions for each path. Diffstat gives a changed-line total and may include plus and minus marks from which the split can only be estimated. Binary rows identify a changed path but provide no line counts.
| Signal | What it can reveal | What still needs review |
|---|---|---|
| Text churn | Files that require more reading or broader tests | Whether the changed behavior is correct |
| Sensitive path | Repository areas that need an owner or domain specialist | Whether a substring accurately represents ownership |
| Deletion share | Behavior, data, or compatibility that may have been removed | Whether removal was intentional and reversible |
| Generated or binary path | Files whose ordinary line review is weak or unavailable | The source change, build provenance, file preview, and size impact |
A review policy should reflect the repository. Terms such as authentication, migration, payment, infrastructure, or lockfile are meaningful only when they correspond to real ownership and failure costs. A generic term that happens to appear in many paths can inflate scores without improving review.
Churn is also an imperfect proxy. Renames, formatting, vendored updates, and generated artifacts can create large totals with little semantic change. Conversely, one deleted condition or changed default can alter production behavior with almost no volume. Triage should determine reading order and reviewer assignment, never substitute for the patch, tests, ownership rules, and deployment plan.
How to Use This Tool:
Supply the strongest available per-file summary and tune its signals to the repository's actual review policy.
- Paste the Git diff summary. Prefer numstat when exact addition and deletion counts matter. Pin Source format if automatic parsing resolves ambiguous rows incorrectly.
- Set Change threshold. A file at this changed-line count receives 25 churn points. The same number also triggers the wide-diff queue rule when the parsed file count reaches it.
- Enter Risk path terms and Generated or lockfile terms. Matching is case-insensitive substring matching. Set Deletion pressure to zero when deletion share should contribute no file or aggregate signal.
- Read the File risk ledger before the Review queue. Inspect the listed signals for each high score, then assign owners and checks from the queue. A positive Queue score floor adds file-routing rows without changing scores.
Interpreting Results:
Critical and High mean “review earlier under these settings,” not “unsafe.” Low means only that the configured signals found less pressure; it cannot clear a change for merge.
- Read the score with its signal list so churn, path matches, deletions, generated content, and binary status remain visible.
- Diffstat line splits are estimates. Use numstat or the full patch when exact additions and deletions affect a decision.
- Generated and binary rows need source-to-artifact, preview, provenance, and size checks because ordinary text evidence is limited.
- Open the full patch and tests before acting on any queue recommendation; the model does not inspect code semantics.
Technical Details:
The review index converts accepted file rows into additions, deletions, changed lines, deletion share, path matches, and two file-type flags. It then produces a deterministic score from 0 to 100 and sorts files by score, changed lines, and path name.
Formula Core
Churn is rounded to a whole-point contribution before path and file-shape points are added. Only the final total is capped.
| Term | Meaning | Rule |
|---|---|---|
| S | File review score | 0 to 100 points |
| C | Additions plus deletions | Changed lines |
| T | Selected change threshold | 1 to 1,000 lines |
| R | Distinct risk terms found in the lowercased path | 22 points each |
| D | Deletion share reaches an enabled threshold | 18 points when true |
| G | Any generated or lockfile term matches | 8 points when true |
| B | Numstat or path-first row uses a dash for either count | 10 points when true; line counts become zero |
Deletion share is deletions ÷ changed lines × 100, or 0% for a zero-line row. Its threshold uses the unrounded share with share ≥ selected percentage; zero disables the signal. Churn is nonnegative, so a half-point rounds upward to the next integer. For example, 1 addition and 1 deletion at a 12-line threshold yield 4 churn points. One risk-path match and an enabled 35% deletion boundary add 22 and 18 points, producing 44 and a Medium level.
| Level | Score boundary | Review route |
|---|---|---|
| Low | S < 22 | Normal patch review |
| Medium | 22 ≤ S < 45 | Focused tests within the normal checklist |
| High | 45 ≤ S < 70 | Domain reviewer |
| Critical | 70 ≤ S ≤ 100 | Focused owner review before merge |
Transformation Core
The selected row grammar determines how text becomes file-level evidence.
| Format | Accepted shape | Transformation |
|---|---|---|
| Numstat | Additions, deletions, path | Use both counts directly; a dash marks binary content and contributes zero lines. |
| Path first | Path, additions, deletions | Use the trailing counts with the same binary rule. |
| Diffstat | Path, pipe, changed-line count, optional mark bar | Estimate additions from the share of plus marks, round that estimate, and assign the remainder to deletions. With no marks, all lines become additions. |
| Auto detect | Any supported row | Try diffstat, numstat, then path first on each line; accepted mixed shapes report a mixed source. |
Blank lines and a final “files changed” summary are skipped. Other unmatched rows increase the ignored count. Input accepts up to 200,000 characters and 500 parsed file rows.
Rule Core
Queue rules are additive and run after every file has been scored.
| Condition | Result |
|---|---|
| Any file has S ≥ 45 | Add owner review; mark it Critical when any file has S ≥ 70. |
| File count ≥ T | Add a wide-diff split or subsystem-review action. |
| Aggregate deletion share reaches an enabled threshold | Add behavior-removal, data-impact, test, and rollback checks. |
| Any generated path matches | Add a source-to-generated-artifact consistency check. |
| Any binary row exists | Add file-aware preview, provenance, and size checks. |
| Queue floor > 0 and a file has S ≥ the floor | Add a routing row for that file without changing its score. |
Overall review state follows the strongest file band. Aggregate deletion share uses total deletions divided by total changed lines, so it may create a queue action even when no single file is High.
Privacy Notes:
Diff summaries and selected files are scored in the browser. Source text is excluded from shared settings and is not restored after reload. Paths and branch labels may still reveal private project structure, so provide only the summary needed for triage and never paste secrets or a full patch when a summary will do.
References:
- git-diff documentation, Git.
- How to compare two Git branches with diff, Simplified Guide.