Skip to content

feat: per-file git status display #7

@relmer

Description

@relmer

Summary

Show inline git status indicators (modified, staged, untracked, ignored, etc.) next to each file in directory listings, similar to eza and lsd.

Details

Display

  • Add a git status column showing indicators like M (modified), A (staged/added), ? (untracked), ! (ignored), etc.
  • Color-code indicators (e.g., green for staged, red for modified, grey for ignored)
  • Column should appear when inside a git repository and a /Git switch is active (or auto-detected)

Implementation Options

  • libgit2 (via git2 crate for RCDir, or C bindings for TCDir): Full programmatic access, no subprocess overhead
  • Shell out to git status: Simpler but slower for large repos; git status --porcelain=v2 gives machine-readable output
  • Hybrid: Use git rev-parse --show-toplevel to detect repos, then git status for status

Considerations

  • Performance: git status can be slow on large repos — may need caching or lazy evaluation
  • Nested repos: handle submodules and nested git roots
  • Non-git directories: gracefully degrade (no git column shown)
  • This is the biggest gap vs eza/lsd

Switches

  • /Git or --Git: enable git status display
  • TCDIR=Git / RCDIR=Git: env var default
  • /Git-: explicit disable

Prior Art

  • eza: shows git status per file with staged/unstaged indicators
  • lsd: shows git status with color-coded indicators
  • Neither TCDir nor RCDir currently has any git integration

Notes

  • Implement in TCDir first, then port to RCDir
  • This is the most impactful missing feature compared to eza/lsd
  • Consider starting with a minimal viable version (just modified/untracked) before full status support

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions