project-brain logoproject-brain

Diff Commands

brain diff show

Shows Git changes between two refs at file level and function level. The core diff command.

brain diff show [from_ref] [to_ref]
ArgumentTypeDefaultDescription
from_refstringHEAD~1Source Git reference
to_refstringHEADTarget Git reference
brain diff show
brain diff show
Visualizing semantic code changes at the function and file levels

Examples

brain diff show                      # HEAD~1 → HEAD (default)
brain diff show HEAD~5 HEAD          # last 5 commits
brain diff show main feature/auth    # branch comparison
brain diff show abc1234 def5678      # specific commit SHAs

Output

Files Changed: 3

── Modified Files ──
• src/api.py
• src/utils.py

── Added Files ──
• src/validators.py

── Deleted Files ──
• src/legacy.py

File: src/api.py
  Functions Added:    validate_user
  Functions Removed:  (none)
  Functions Modified: create_user, delete_user

Note

Function-level output only applies to Python files. Non-Python files receive file-level diff only. Mode can be changed to file in brain.yaml: diff.mode: file

Git ref reference

RefMeaning
HEADCurrent commit
HEAD~1Previous commit
HEAD~55 commits before HEAD
mainBranch tip
abc1234Specific commit SHA