jesseduffield.lazygit/pkg/commands/git_commands
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
..
bisect.go Don't log the "git rev-list" call when marking bisect commits 2026-01-25 11:47:07 +01:00
bisect_info.go rename sha to hash 2 2024-04-12 08:33:47 +02:00
blame.go Add command to find base commit for creating a fixup 2024-01-10 09:11:40 +01:00
branch.go Add backward cycling support for all branches log view 2026-03-08 17:06:17 +01:00
branch_loader.go Show ? and ↓? in the branches list when the base is ambiguous 2026-07-03 19:37:37 +02:00
branch_loader_test.go Show ? and ↓? in the branches list when the base is ambiguous 2026-07-03 19:37:37 +02:00
branch_test.go Replace MergeOpts struct with MergeVariant enum 2025-10-19 21:24:28 +02:00
commit.go Tolerate trailing newlines in AddCoAuthorToDescription 2026-04-21 18:51:17 +02:00
commit_file_loader.go Rename Name to Path in File and CommitFile 2025-03-20 12:31:34 +01:00
commit_file_loader_test.go Rename Name to Path in File and CommitFile 2025-03-20 12:31:34 +01:00
commit_loader.go Add ActionFlag field to Commit 2026-01-28 10:15:45 +01:00
commit_loader_test.go Use a better approach for determining pushed and merge statuses 2025-07-31 15:50:53 +02:00
commit_loading_shared.go Fix showing diffs for renamed file when filtering by path 2025-07-27 12:05:41 +02:00
commit_test.go Tolerate trailing newlines in AddCoAuthorToDescription 2026-04-21 18:51:17 +02:00
common.go Remove go-git repo from GitCommon 2026-03-27 14:08:07 +01:00
config.go Add support for git flow using git-flow-next 2026-05-26 11:57:09 +02:00
config_test.go Add support for git flow using git-flow-next 2026-05-26 11:57:09 +02:00
custom.go Add runCommand function to Go template syntax 2025-04-09 10:44:36 +02:00
deps_test.go Add Status.RefsSnapshot 2026-06-19 18:07:48 +02:00
diff.go Don't log the GetDiff command 2025-11-15 18:15:24 +01:00
file.go Remove deprecated edit configs 2025-07-08 16:32:21 +02:00
file_loader.go Suppress optional locks by default again, except foreground refresh 2026-07-02 16:05:08 +02:00
file_loader_test.go Suppress optional locks by default again, except foreground refresh 2026-07-02 16:05:08 +02:00
file_test.go Remove deprecated edit configs 2025-07-08 16:32:21 +02:00
flow.go Add support for git flow using git-flow-next 2026-05-26 11:57:09 +02:00
flow_test.go Add support for git flow using git-flow-next 2026-05-26 11:57:09 +02:00
git_command_builder.go Revert "Add GlobalArg/GlobalArgIf to GitCommandBuilder" 2026-07-02 16:49:36 +02:00
git_command_builder_test.go Add runGitCmdOnPaths utility 2026-03-27 14:34:47 +01:00
github.go Remove now unused code 2026-05-10 15:28:14 +02:00
github_test.go Support GitHub Enterprise for the pull-requests feature 2026-05-10 15:28:14 +02:00
hosting_service.go Remove now unused code 2026-05-10 15:28:14 +02:00
main_branches.go Cleanup: remove the ignoringWarnings hack from GetMergeBase 2025-07-31 15:21:34 +02:00
patch.go Fix patch commands when git config has color=always 2026-03-30 10:42:26 +02:00
rebase.go Pass todo flag to EditRebaseTodo 2026-01-28 10:15:51 +01:00
rebase_test.go Fix dropping submodule changes from a commit 2025-10-10 12:55:58 +02:00
reflog_commit_loader.go Fix showing diffs for renamed file when filtering by path 2025-07-27 12:05:41 +02:00
reflog_commit_loader_test.go Fix showing diffs for renamed file when filtering by path 2025-07-27 12:05:41 +02:00
remote.go Copy gocui files into lazygit repo under pkg/gocui 2026-04-30 14:29:08 +02:00
remote_loader.go Add PushUrls field to models.Remote 2026-05-04 13:09:47 +02:00
remote_loader_test.go Add PushUrls field to models.Remote 2026-05-04 13:09:47 +02:00
repo_paths.go Remove git version specific code for versions we no longer support 2025-07-09 12:18:58 +02:00
repo_paths_test.go Remove git version specific code for versions we no longer support 2025-07-09 12:18:58 +02:00
stash.go Add PagerConfig 2025-10-14 12:17:13 +02:00
stash_loader.go Add hash field to models.StashEntry 2025-08-25 19:23:30 +02:00
stash_loader_test.go Add hash field to models.StashEntry 2025-08-25 19:23:30 +02:00
stash_test.go Replace paging config with an array of pagers 2025-10-14 12:17:13 +02:00
status.go Add Status.RefsSnapshot 2026-06-19 18:07:48 +02:00
status_test.go Add Status.RefsSnapshot 2026-06-19 18:07:48 +02:00
submodule.go Show per-side commit logs for submodule conflicts in the main view 2026-06-28 16:12:36 +02:00
submodule_test.go Show per-side commit logs for submodule conflicts in the main view 2026-06-28 16:12:36 +02:00
sync.go Copy gocui files into lazygit repo under pkg/gocui 2026-04-30 14:29:08 +02:00
sync_test.go Copy gocui files into lazygit repo under pkg/gocui 2026-04-30 14:29:08 +02:00
tag.go Copy gocui files into lazygit repo under pkg/gocui 2026-04-30 14:29:08 +02:00
tag_loader.go Revert "Add IsAnnotated field to models.Tag struct" 2025-07-28 10:53:51 +02:00
tag_loader_test.go Revert "Add IsAnnotated field to models.Tag struct" 2025-07-28 10:53:51 +02:00
version.go Add a method GitVersion.IsAtLeast 2024-01-10 09:18:38 +01:00
version_test.go Add a method GitVersion.IsAtLeast 2024-01-10 09:18:38 +01:00
working_tree.go Remove empty directories after discarding files 2026-03-30 17:50:28 +02:00
working_tree_test.go Remove empty directories after discarding files 2026-03-30 17:50:28 +02:00
worktree.go Centralise logic for obtaining repo paths 2023-07-30 18:35:24 +10:00
worktree_loader.go Show branch name and detached HEAD in worktrees tab 2026-03-08 12:51:46 +01:00
worktree_loader_test.go Show branch name and detached HEAD in worktrees tab 2026-03-08 12:51:46 +01:00