Skip to content

feat(yazi): add git-commit-browser plugin#179

Draft
rrvsh wants to merge 2 commits intoprimefrom
feat/yazi-git-commit-browser
Draft

feat(yazi): add git-commit-browser plugin#179
rrvsh wants to merge 2 commits intoprimefrom
feat/yazi-git-commit-browser

Conversation

@rrvsh
Copy link
Owner

@rrvsh rrvsh commented Feb 16, 2026

Summary

A Yazi plugin that enables browsing git repository history through temporary worktrees, with seamless navigation between commits and automatic cleanup.

Features

  • Navigate commits: Use ] to go to older commits, [ to go to newer commits
  • Interactive picker: Press g] to open fzf and select any commit
  • Return to HEAD: Press g[ to return to the original working directory
  • Status line integration: Publishes commit info via DDS for custom status line display
  • Automatic cleanup: Worktrees are cleaned up when returning to HEAD or quitting Yazi

Implementation

Files Added

  • yazi/plugins/git-commit-browser.yazi/main.lua - Core plugin logic (~250 lines)
  • yazi/plugins/git-commit-browser.yazi/README.md - Usage documentation
  • yazi/plugins/git-commit-browser.yazi/LICENSE - MIT License

Files Modified

  • nix/modules/yazi.nix - Added plugin derivation and keybindings

Keybindings

Key Action Description
] next Go to older commit
[ prev Go to newer commit
g[ head Return to HEAD/original directory
g] select Interactive commit picker (fzf)

Testing

  • Test navigation in original repo
  • Test resuming from temp worktree
  • Test cleanup on g[ at HEAD
  • Test interactive picker
  • Test status line integration

Future Improvements

  • Add support for viewing diffs between commits
  • Add branch creation from historical commits
  • Add cleanup of orphaned worktrees (24h+ old)

Add a Yazi plugin that enables browsing git repository history through
temporary worktrees. Supports navigation between commits with keybindings,
interactive commit selection via fzf, and automatic cleanup.

Key features:
- Navigate commits with ] (older) and [ (newer)
- Interactive picker with g]
- Return to HEAD with g[
- Status line integration via DDS
- Nix module integration with keybindings

Includes:
- yazi/plugins/git-commit-browser.yazi/main.lua (~250 lines)
- README.md with usage documentation
- MIT LICENSE
- Updated nix/modules/yazi.nix with plugin config
- Replace ya.cwd() with Command('pwd') to avoid nil error
- Reorder functions so they're defined before use (Lua requirement)
- Add .luacheckrc for Yazi plugin globals
- Remove unused cleanup_orphaned function
- Format with stylua
@rrvsh rrvsh force-pushed the feat/yazi-git-commit-browser branch from 1f717d9 to efd1785 Compare February 16, 2026 05:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant