Skip to content

fix(graph): show commits from unmerged local branches - #11

Merged
greenbugx merged 1 commit into
mainfrom
fix/graph-unmerged-branches
Aug 29, 2026
Merged

greenbugx merged 1 commit into
mainfrom
fix/graph-unmerged-branches

Conversation

@greenbugx

Copy link
Copy Markdown
Owner

Summary

Related Issue

Closes #4

Type of Change

  • feat — new feature
  • fix — bug fix
  • docs — documentation only
  • refactor — no change in behavior
  • test — tests only
  • chore / ci — tooling, dependencies, workflows
  • Breaking change — an existing keybinding, CLI flag, or output changes meaning

How This Was Tested

  • Automated:
  • By hand:
  • Tested on: OS [e.g. Windows 11 / Ubuntu 24.04 / macOS 15], terminal [e.g. Windows Terminal / Alacritty / Kitty]

Screenshots / Recordings

Checklist

  • cargo fmt — CI runs cargo fmt --check
  • cargo clippy --all-targets -- -D warnings is clean, unused imports included
  • cargo test passes
  • Commits follow Conventional Commits
  • Files are LF, not CRLF
  • Nothing used that is newer than the rust-version floor in Cargo.toml
  • A new module is listed in CONTRIBUTING.md's architecture overview
  • New keybinding added to ui::help::SECTIONS, to the key list in its test, and to the README table

Notes for the Reviewer

@greenbugx
greenbugx merged commit addf8a3 into main Aug 29, 2026
4 checks passed
@greenbugx
greenbugx deleted the fix/graph-unmerged-branches branch August 29, 2026 17:05

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread src/app/state.rs
// 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);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Comment thread src/app/state.rs
Comment on lines +727 to +729
if self.history == HistoryScope::AllBranches {
self.close_history();
return;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

@chatgpt-codex-connector

Copy link
Copy Markdown

💡 Codex Review

self.enter_scoped_history(HistoryScope::AllBranches, commits, graph_rows);

P2 Badge 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.


GitLoom/src/app/state.rs

Lines 727 to 729 in 2114e56

if self.history == HistoryScope::AllBranches {
self.close_history();
return;

P2 Badge 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.

ℹ️ 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".

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.

[BUG]: Commit graph does not display commits from unmerged branches

1 participant