{"record":{"id":"6f3cb320d3b12d47","repo":"jesseduffield/lazygit","slug":"base-commit-is-not-in-current-view","errorCode":null,"errorMessage":"Base commit is not in current view","messagePattern":"Base commit is not in current view","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"pkg/gui/controllers/helpers/fixup_helper.go","lineNumber":103,"sourceCode":"\t)\n\n\t// Group the hashes into buckets by merged status\n\thashGroups := lo.GroupBy(hashes, func(hash string) int {\n\t\tcommit, _, ok := self.findCommit(commits, hash)\n\t\tif ok {\n\t\t\treturn lo.Ternary(commit.Status == models.StatusMerged, MERGED, NOT_MERGED)\n\t\t}\n\t\treturn lo.Ternary(notFoundMeansMerged, MERGED, CANNOT_TELL)\n\t})\n\n\tif len(hashGroups[CANNOT_TELL]) > 0 {\n\t\t// If we have any commits that we can't tell if they're merged, just\n\t\t// show the generic \"not in current view\" error. This can only happen if\n\t\t// a feature branch has more than 300 commits, or there is no main\n\t\t// branch. Both are so unlikely that we don't bother returning a more\n\t\t// detailed error message (e.g. we could say something about the commits\n\t\t// that *are* in the current branch, but it's not worth it).\n\t\treturn errors.New(self.c.Tr.BaseCommitIsNotInCurrentView)\n\t}\n\n\tif len(hashGroups[NOT_MERGED]) == 0 {\n\t\t// If all the commits are merged, show the \"already on main branch\"\n\t\t// error. It isn't worth doing a detailed report of which commits we\n\t\t// found.\n\t\treturn errors.New(self.c.Tr.BaseCommitIsAlreadyOnMainBranch)\n\t}\n\n\tfoundCommits := getCommitsForHashes(commits, hashGroups[NOT_MERGED])\n\t// If there are multiple commits that could be the base commit, remove all\n\t// those that are fixups for the last one.\n\tfoundCommits = removeFixupCommits(foundCommits)\n\n\tif len(foundCommits) > 1 {\n\t\t// If there are still multiple commits that could be the base commit, list\n\t\t// them in the error message. But only the candidates from the current\n\t\t// branch, not including any that are already merged.","sourceCodeStart":85,"sourceCodeEnd":121,"githubUrl":"https://github.com/jesseduffield/lazygit/blob/c477a2959b229fbf3284be0d4d2904ab61ec3c94/pkg/gui/controllers/helpers/fixup_helper.go#L85-L121","documentation":"Returned when candidate fixup base commits exist but their merged-status is CANNOT_TELL: the commit list loaded in the model is not enough to decide whether the base commits are already merged, which per the comment happens when a feature branch exceeds the ~300-commit model window or no main branch can be resolved. lazygit deliberately shows the generic message rather than a per-commit report because the case is rare.","triggerScenarios":"Invoking fixup on a change whose base commit falls outside the last 300 commits loaded into self.c.Model().Commits, or in a repo where the main branch cannot be determined so notFoundMeansMerged is false while commits are absent from the model.","commonSituations":"Very long-lived feature branches; monorepos with huge history; repos missing a master/main branch (e.g. only 'develop' or a custom default) so the merged heuristic has no anchor.","solutions":["Load more commits in the Commits panel (page down) so the base enters the model, then retry.","Ensure the repo has a resolvable main branch and lazygit knows it (check branch status markers).","Fall back to a manual 'git commit --fixup=<sha>' after finding the sha with git blame.","Consider rebasing/splitting the oversized branch."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep feature branches under the ~300-commit model window (rebase regularly)","Ensure a resolvable main branch exists so the merged heuristic works","Fall back to manual 'git commit --fixup=<sha>' via git blame when the model window is insufficient"],"tags":["git","fixup","commit-window","main-branch","limits"],"backgroundTag":null,"analyzedSha":"c477a2959b229fbf3284be0d4d2904ab61ec3c94","analyzedAt":"2026-08-15T08:34:32.451Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}