{"record":{"id":"9230f7dd45177f2d","repo":"pcottle/learnGitBranching","slug":"hey-those-commits-don-t-exist-in-the-set","errorCode":null,"errorMessage":"Hey those commits don't exist in the set!","messagePattern":"Hey those commits don't exist in the set!","errorType":"validation","errorClass":"GitError","httpStatus":null,"severity":"error","filePath":"src/js/git/index.js","lineNumber":2386,"sourceCode":"    // in the rebase dialog and hit confirm\n    rebaseOrder = toRebase;\n  } else {\n    // Get the list and order of commits specified\n    var idsToRebase = options['interactiveTest'][0].split(',');\n\n    // Verify each chosen commit exists in the list of commits given to the user\n    var extraCommits = [];\n    rebaseOrder = [];\n    idsToRebase.forEach(function (id) {\n      if (id in rebaseMap) {\n        rebaseOrder.push(rebaseMap[id]);\n      } else {\n        extraCommits.push(id);\n      }\n    });\n\n    if (extraCommits.length > 0) {\n      throw new GitError({\n        msg: intl.todo('Hey those commits don\\'t exist in the set!')\n      });\n    }\n  }\n\n  this.rebaseFinish(rebaseOrder, {}, targetSource, currentLocation);\n};\n\nGitEngine.prototype.rebaseInteractive = function(targetSource, currentLocation, options) {\n  options = options || {};\n\n  // there are a reduced set of checks now, so we can't exactly use parts of the rebase function\n  // but it will look similar.\n  var toRebase = this.getInteractiveRebaseCommits(targetSource, currentLocation);\n\n  // now do stuff :D since all our validation checks have passed, we are going to defer animation\n  // and actually launch the dialog\n  this.animationQueue.set('defer', true);","sourceCodeStart":2368,"sourceCodeEnd":2404,"githubUrl":"https://github.com/pcottle/learnGitBranching/blob/5b09d0ff9678cad164f5a7488a279a44f90d7256/src/js/git/index.js#L2368-L2404","documentation":"Interactive rebase validation: after the user picks commits, every chosen id must exist in the prepared rebase set (rebaseMap). An id outside that set means the user invented or hand-edited a commit hash that was never offered, so the engine refuses.","triggerScenarios":"Calling rebase in interactive mode where the user-specified commit list contains an id not present in rebaseMap — e.g. typing a hash from another branch or a typo'd/truncated hash in the rebase dialog.","commonSituations":"Hand-editing the interactive rebase todo list; pasting hashes from the wrong level; solution scripts referencing stale commit ids.","solutions":["Use only the commit ids shown in the rebase prompt/dialog","Re-run and copy the hashes exactly as offered","If scripting, derive ids from the engine's commit set, not hard-coded values"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"ids.forEach(function(id){ if (!rebaseMap[id]) throw new Error('id not in rebase set'); });","typeGuard":"function allIdsInRebaseSet(ids, rebaseMap) { return ids.every(function(id){ return !!rebaseMap[id]; }); }","tryCatchPattern":null,"preventionTips":["Only use ids shown in the rebase dialog","Never hand-edit hashes in the todo list"],"tags":["git","rebase","interactive","commit-id-validation"],"backgroundTag":"git-bad-commit-hash","analyzedSha":"5b09d0ff9678cad164f5a7488a279a44f90d7256","analyzedAt":"2026-08-27T13:53:49.057Z","schemaVersion":2},"datasetVersion":"2026-08-27T19:17:21.184Z"}