pcottle/learnGitBranching · warning · CommandProcessError

No documentation found for "{}"; run `show commands` to see

Error message

No documentation found for "{}"; run `show commands` to see all available commands

What it means

showHelpForCommand() in sandbox/commands.js backs both `help {command}` and `git help {command}`. It calls getCommandHelpLines(target); if no documentation lines are registered for that command name, it throws CommandProcessError with an untranslated todo message pointing the user to `show commands`.

Source

Thrown at src/js/sandbox/commands.js:294

  Object.keys(mRegexMap).forEach(function(vcs) {
    var map = mRegexMap[vcs];
    Object.keys(map).forEach(function(method) {
      var regex = map[method];
      allCommands[vcs + ' ' + method] = regex;
    });
  });
  toDelete.forEach(function(key) {
    delete allCommands[key];
  });

  return allCommands;
};

// shared handler for `help {command}` and `git help {command}`
var showHelpForCommand = function(target) {
  var lines = getCommandHelpLines(target);
  if (!lines) {
    throw new CommandProcessError({
      msg: intl.todo(
        'No documentation found for "' + target + '"; ' +
        'run `show commands` to see all available commands'
      )
    });
  }

  throw new CommandResult({
    msg: lines.join('\n')
  });
};

// builds the documentation lines for `help {command}`; returns null
// if we have nothing to say about the given command
var getCommandHelpLines = function(target) {
  var vcsRegexMap = Commands.commands.getRegexMap();
  var descriptionMap = Commands.commands.getDescriptionMap();
  var optionMap = Commands.commands.getOptionMap();

View on GitHub (pinned to 5b09d0ff96)

Solutions

  1. Run `show commands` to see documented commands and re-run help with the exact name
  2. Fix the typo in the command name
  3. If extending the sandbox, register help lines for any new command so getCommandHelpLines returns them

Example fix

// before
help comit
// after
help commit
Defensive patterns

Strategy: type-guard

Validate before calling

if (!getCommandHelpLines(target)) { inform(`no docs for ${target}; try \`show commands\``); } else { showHelpForCommand(target); }

Type guard

function hasDocs(name) {
  return Boolean(getCommandHelpLines(name));
}

Try / catch

try { showHelpForCommand(target); } catch (e) { if (e instanceof CommandProcessError) { listCommands(); } else throw e; }

Prevention

When it happens

Trigger: Running `help <name>` or `git help <name>` where <name> is not a key in the command documentation table — misspelled names, aliases, or commands with no help entry.

Common situations: Typos like `help comit`; asking for help on internal/aliased commands that lack documentation entries; new commands registered without corresponding help lines.

Related errors


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