{"record":{"id":"d3d2f8e108b49720","repo":"jesseduffield/lazygit","slug":"todo-s-not-found-in-git-rebase-todo","errorCode":null,"errorMessage":"Todo %s not found in git-rebase-todo","messagePattern":"Todo (.+?) not found in git-rebase-todo","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/utils/rebase_todo.go","lineNumber":137,"sourceCode":"func DeleteTodos(fileName string, todosToDelete []Todo, commentChar byte) ([]byte, error) {\n\ttodos, err := ReadRebaseTodoFile(fileName, commentChar)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\trearrangedTodos, err := deleteTodos(todos, todosToDelete)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn todosToString(rearrangedTodos, commentChar)\n}\n\nfunc deleteTodos(todos []todo.Todo, todosToDelete []Todo) ([]todo.Todo, error) {\n\tfor _, todoToDelete := range todosToDelete {\n\t\tidx, ok := findTodo(todos, todoToDelete)\n\n\t\tif !ok {\n\t\t\t// Should never happen\n\t\t\treturn []todo.Todo{}, fmt.Errorf(\"Todo %s not found in git-rebase-todo\", todoToDelete.Hash)\n\t\t}\n\n\t\ttodos = Remove(todos, idx)\n\t}\n\n\treturn todos, nil\n}\n\nfunc MoveTodosDown(fileName string, todosToMove []Todo, isInRebase bool, commentChar byte) error {\n\treturn MoveTodos(fileName, todosToMove, isInRebase, 1, commentChar)\n}\n\nfunc MoveTodosUp(fileName string, todosToMove []Todo, isInRebase bool, commentChar byte) error {\n\treturn MoveTodos(fileName, todosToMove, isInRebase, -1, commentChar)\n}\n\nfunc MoveTodos(fileName string, todosToMove []Todo, isInRebase bool, offset int, commentChar byte) error {\n\ttodos, err := ReadRebaseTodoFile(fileName, commentChar)","sourceCodeStart":119,"sourceCodeEnd":155,"githubUrl":"https://github.com/jesseduffield/lazygit/blob/c477a2959b229fbf3284be0d4d2904ab61ec3c94/pkg/utils/rebase_todo.go#L119-L155","documentation":"An internal 'Should never happen' error from deleteTodos in pkg/utils/rebase_todo.go: while deleting todos (dropped commits) from .git-rebase-todo, a commit passed by the caller was not found in the parsed todo list. It means lazygit's in-memory commit model has diverged from the on-disk todo file between reading it and mutating it.","triggerScenarios":"Dropping commits mid interactive rebase after the todo file changed underneath lazygit (another git process, manual edit of .git-rebase-todo, or a stale model after a conflict resolution). findTodo fails to match todoToDelete's hash among the file's todos.","commonSituations":"Running another git tool (editor, terminal git) against the same rebase while lazygit holds a stale view; racing the todo file after 'continue' operations; extremely rare hash-matching edge cases (abbreviated vs full hashes).","solutions":["Abort and restart the interactive rebase to rebuild a consistent todo file","Avoid editing .git-rebase-todo externally while lazygit is open on the same rebase","If reproducible, capture the todo file and report the issue to the lazygit repo with the reproduction steps"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":"Surface the error to the user with guidance to restart/abort the rebase; treat it as unrecoverable model divergence rather than retrying the delete.","preventionTips":["Do not edit .git-rebase-todo with other tools while lazygit is open on the same rebase","Let lazygit re-read the todo file (refresh) after every rebase step before dropping more commits"],"tags":["lazygit","rebase","git-rebase-todo","internal","race"],"backgroundTag":null,"analyzedSha":"c477a2959b229fbf3284be0d4d2904ab61ec3c94","analyzedAt":"2026-08-15T08:34:32.451Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}