fix(graph): show commits from unmerged local branches - #11
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2114e56cbe
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| // commit's real parents (nothing was filtered out commit-by-commit), | ||
| // so the ordinary graph layout applies, merges and all. | ||
| let graph_rows = GraphEngine::build(&commits); | ||
| self.enter_scoped_history(HistoryScope::AllBranches, commits, graph_rows); |
There was a problem hiding this comment.
Keep file history scoped to all branches
When this all-branches scope is active, a user can select a commit that exists only on an unmerged local branch, open its changed files, and press l; that still sends a FileHistory request whose worker calls repo.file_history(), and that revwalk starts at HEAD only. For a path that only exists on the unmerged branch this returns an empty history and surfaces No commits in this history touched ..., even though the selected all-branches commit just changed that file. The file-history walk needs to use the current history scope, or otherwise start from local branches when opened from the all-branches graph.
Useful? React with 👍 / 👎.
| if self.history == HistoryScope::AllBranches { | ||
| self.close_history(); | ||
| return; |
There was a problem hiding this comment.
Make
a work after starting with --all
When the app is launched with --all, history starts as AllBranches but saved_history is still None. The first a press takes this branch, close_history() returns false because nothing is parked, and then the method returns without requesting/loading the HEAD-only history, so the documented HEAD/all-branches toggle is a no-op for --all sessions. This path should either load HEAD-only history or avoid swallowing the key.
Useful? React with 👍 / 👎.
💡 Codex ReviewLine 759 in 2114e56 When this all-branches scope is active, a user can select a commit that exists only on an unmerged local branch, open its changed files, and press Lines 727 to 729 in 2114e56 a work after starting with --all
When the app is launched with ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Summary
Related Issue
Closes #4
Type of Change
feat— new featurefix— bug fixdocs— documentation onlyrefactor— no change in behaviortest— tests onlychore/ci— tooling, dependencies, workflowsHow This Was Tested
Screenshots / Recordings
Checklist
cargo fmt— CI runscargo fmt --checkcargo clippy --all-targets -- -D warningsis clean, unused imports includedcargo testpassesrust-versionfloor inCargo.tomlui::help::SECTIONS, to the key list in its test, and to the README tableNotes for the Reviewer