pcottle/learnGitBranching · error · GitError

Hey those commits don't exist in the set!

Error message

Hey those commits don't exist in the set!

What it means

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.

Source

Thrown at src/js/git/index.js:2386

    // in the rebase dialog and hit confirm
    rebaseOrder = toRebase;
  } else {
    // Get the list and order of commits specified
    var idsToRebase = options['interactiveTest'][0].split(',');

    // Verify each chosen commit exists in the list of commits given to the user
    var extraCommits = [];
    rebaseOrder = [];
    idsToRebase.forEach(function (id) {
      if (id in rebaseMap) {
        rebaseOrder.push(rebaseMap[id]);
      } else {
        extraCommits.push(id);
      }
    });

    if (extraCommits.length > 0) {
      throw new GitError({
        msg: intl.todo('Hey those commits don\'t exist in the set!')
      });
    }
  }

  this.rebaseFinish(rebaseOrder, {}, targetSource, currentLocation);
};

GitEngine.prototype.rebaseInteractive = function(targetSource, currentLocation, options) {
  options = options || {};

  // there are a reduced set of checks now, so we can't exactly use parts of the rebase function
  // but it will look similar.
  var toRebase = this.getInteractiveRebaseCommits(targetSource, currentLocation);

  // now do stuff :D since all our validation checks have passed, we are going to defer animation
  // and actually launch the dialog
  this.animationQueue.set('defer', true);

View on GitHub (pinned to 5b09d0ff96)

Solutions

  1. Use only the commit ids shown in the rebase prompt/dialog
  2. Re-run and copy the hashes exactly as offered
  3. If scripting, derive ids from the engine's commit set, not hard-coded values
Defensive patterns

Strategy: validation

Validate before calling

ids.forEach(function(id){ if (!rebaseMap[id]) throw new Error('id not in rebase set'); });

Type guard

function allIdsInRebaseSet(ids, rebaseMap) { return ids.every(function(id){ return !!rebaseMap[id]; }); }

Prevention

When it happens

Trigger: 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.

Common situations: Hand-editing the interactive rebase todo list; pasting hashes from the wrong level; solution scripts referencing stale commit ids.

Related errors


AI-assisted analysis of pcottle/learnGitBranching@5b09d0ff96 (2026-08-27). Data as JSON: /api/errors/9230f7dd45177f2d. Report an issue: GitHub.