{"record":{"id":"7f745af4f975b536","repo":"pcottle/learnGitBranching","slug":"git-result-nothing-7f745a","errorCode":null,"errorMessage":"git-result-nothing","messagePattern":"git-result-nothing","errorType":"validation","errorClass":"CommandResult","httpStatus":null,"severity":"warning","filePath":"src/js/git/index.js","lineNumber":2441,"sourceCode":"    });\n  }\n\n  var promise = new Promise(function(resolve, reject) {\n    var InteractiveRebaseView = require('../views/rebaseView').InteractiveRebaseView;\n    // interactive rebase view will reject or resolve our promise\n    new InteractiveRebaseView({\n      deferred: { resolve: resolve, reject: reject },\n      toRebase: toRebase,\n      initialCommitOrdering: initialCommitOrdering,\n      aboveAll: options.aboveAll\n    });\n  }.bind(this));\n\n  promise\n  .then(function(userSpecifiedRebase) {\n    // first, they might have dropped everything (annoying)\n    if (!userSpecifiedRebase.length) {\n      throw new CommandResult({\n        msg: intl.str('git-result-nothing')\n      });\n    }\n\n    // finish the rebase crap and animate!\n    this.rebaseFinish(userSpecifiedRebase, {}, targetSource, currentLocation);\n  }.bind(this))\n  .catch(function(err) {\n    this.filterError(err);\n    this.command.set('error', err);\n    this.animationQueue.start();\n  }.bind(this));\n};\n\nGitEngine.prototype.filterRebaseCommits = function(\n  toRebaseRough,\n  stopSet,\n  options","sourceCodeStart":2423,"sourceCodeEnd":2459,"githubUrl":"https://github.com/pcottle/learnGitBranching/blob/5b09d0ff9678cad164f5a7488a279a44f90d7256/src/js/git/index.js#L2423-L2459","documentation":"After the interactive rebase dialog resolves, if the user dropped every commit (submitted an empty selection), there is nothing left to replay and a CommandResult 'nothing' is thrown. Analogous to aborting with an empty todo list.","triggerScenarios":"Running git rebase -i and deleting/deselecting all commits in the resulting dialog, so userSpecifiedRebase.length === 0.","commonSituations":"Users trying to 'squash away' an entire branch by dropping all lines; accidentally submitting an empty todo list in the UI.","solutions":["Keep at least one commit, or use git reset / branch -d if the goal is to discard the branch entirely","Use squash on the last commit rather than dropping everything","Catch the CommandResult if an empty rebase is an expected user action"],"exampleFix":"// before\n// rebase -i dialog with all commits dropped\n// after\ngit reset --hard main","handlingStrategy":"fallback","validationCode":"if (!userSpecifiedRebase.length) { /* user dropped everything; reset instead of rebase */ }","typeGuard":null,"tryCatchPattern":"try { interactiveRebase(); } catch (e) { if (e instanceof CommandResult) return; throw e; }","preventionTips":["Keep at least one commit in the todo list","Use reset to discard a whole branch"],"tags":["git","rebase","interactive","empty-selection"],"backgroundTag":"git-empty-rebase-plan","analyzedSha":"5b09d0ff9678cad164f5a7488a279a44f90d7256","analyzedAt":"2026-08-27T13:53:49.057Z","schemaVersion":2},"datasetVersion":"2026-08-27T19:17:21.184Z"}