jesseduffield.lazygit/pkg/commands/models
Stefan Haller df138a4c72 Show ? and ↓? in the branches list when the base is ambiguous
When a branch's fork point is reachable from more than one configured
main branch and the candidates disagree on the behind count, the
branches column was silently showing the config-order first candidate's
number — confidently asserting something we don't actually know. Worse,
"nothing" in the column means "up to date with the base", which may or
may not be true under ambiguity.

Compute behind values for every candidate (the fast path already had
them; the legacy path now does too via baseBranchCandidatesAndBehinds),
then classify:

  - all candidates agree → show that number (or nothing if 0)
  - some candidates 0, others not → "?" (we can't say if up to date)
  - all non-zero but differing → "↓?" (definitely behind, unknown amount)

Two sentinel constants on the Branch model (BehindBaseAmbiguousMaybeUpToDate
and BehindBaseAmbiguousDefinitelyBehind) encode these states in the
existing atomic.Int32 field via negative values; the renderer switches
on them.
2026-07-03 19:37:37 +02:00
..
author.go Keep track of authors across local commits and branch commits for suggestions 2023-07-22 10:47:04 +10:00
branch.go Show ? and ↓? in the branches list when the base is ambiguous 2026-07-03 19:37:37 +02:00
commit.go Add HeadCommitIdx helper function 2026-06-22 09:16:57 +02:00
commit_file.go Rename Name to Path in File and CommitFile 2025-03-20 12:31:34 +01:00
commit_test.go Add HeadCommitIdx helper function 2026-06-22 09:16:57 +02:00
file.go Better main view display for conflicing files 2025-04-09 10:27:57 +02:00
github.go Add GitHub commands and model for fetching PR status 2026-04-01 09:13:55 +02:00
ref.go Move the Ref interface from gui/types to models 2025-07-31 15:21:34 +02:00
remote.go Add PushUrls field to models.Remote 2026-05-04 13:09:47 +02:00
remote_branch.go Add ShortRefName to Ref interface 2024-08-28 18:27:52 +02:00
stash_entry.go Add hash field to models.StashEntry 2025-08-25 19:23:30 +02:00
submodule_config.go Show all submodules recursively 2024-03-07 20:16:28 +01:00
tag.go Revert "Add IsAnnotated field to models.Tag struct" 2025-07-28 10:53:51 +02:00
working_tree_state.go Make WorkingTreeState a struct, and add cherry-picking and reverting states 2025-04-20 15:53:17 +02:00
worktree.go Show branch name and detached HEAD in worktrees tab 2026-03-08 12:51:46 +01:00