Repository navigation
feat: add --commits cli flag and Ctrl+G dual-diff toggle between files and head - #34
Conversation
Integrate current main and Blankeos#36 filter hints. Preserve active commit filters using a separate HEAD history view when HEAD is outside the loaded list. Select HEAD after startup streaming without overriding navigation, and honor remapped/disabled shortcuts. Add regression coverage for branches, filtering, detached/unborn HEAD, refresh and startup.
|
Fixed and validated in 809417f: select the actual checked-out HEAD by hash (not index zero); preserve filters with a separate HEAD history view when filters/pagination exclude HEAD; honor remapped and disabled shortcuts; resolve integration with #36; and select startup HEAD after history arrives without overriding user navigation. Added regression tests for another branch ahead of HEAD, path/author/branch filters, detached and unborn HEAD, refresh, and startup. All 284 tests pass, cargo fmt --check passes, and the binary builds. |
Blankeos
left a comment
There was a problem hiding this comment.
Reviewed updated implementation and validated against current main: 284 tests pass, formatting passes, and binary builds. HEAD/filter semantics and key remapping issues are addressed.
Hi @felipecm-br I merged this PR, but I kinda went back to this particular change... I noticed this behavior actually isn't in the original lazygit. Also, I don't see how this makes it more convenient than just pressing Edit: I decided to remove the ctrl-G, we already have ctrl-G for "generating commit message" afterall. |
Overview
This PR introduces a convenient dual-diff toggle shortcut and a CLI startup flag that improves the workflow when navigating between uncommitted local changes and the most recent commit on HEAD.
Key Features
--commitsCLI flag:lazygitrsfocused directly on the Commits panel at HEAD (selection index 0).alias lglog='lazygitrs --commits') or editor integrations specifically aimed at inspecting commit history.Dual-diff toggle (
Ctrl+G):Ctrl+Gswitches immediately to Commits at HEAD.Ctrl+Gswitches directly back to Files.keybinding.universal.toggleWorkingTreeAndHeadinconfig.yml(defaults to"<c-g>").Status Bar Hints & Command Palette:
ctrl+g headwhen in Files andctrl+g fileswhen in Commits/CommitFiles.?) under Universal commands and Diff view commands.Test Coverage
--commitsCLI flag parsing.Ctrl+Gkey event handling both in sidebar and diff-focused modes.