{"record":{"id":"af4e062e5d366fa9","repo":"pcottle/learnGitBranching","slug":"commit-getshowentry","errorCode":null,"errorMessage":"commit.getShowEntry()","messagePattern":"commit\\.getShowEntry\\(\\)","errorType":"exception","errorClass":"CommandResult","httpStatus":null,"severity":"info","filePath":"src/js/git/index.js","lineNumber":2972,"sourceCode":"\n  var willStartAuto = this.animationQueue.get('defer') ||\n    this.animationQueue.get('promiseBased');\n\n  // only add the refresh if we didn't do manual animations\n  if (!this.animationQueue.get('animations').length && !willStartAuto) {\n    this.animationFactory.refreshTree(this.animationQueue, this.gitVisuals);\n  }\n\n  // animation queue will call the callback when its done\n  if (!willStartAuto) {\n    this.animationQueue.start();\n  }\n};\n\nGitEngine.prototype.show = function(ref) {\n  var commit = this.getCommitFromRef(ref);\n\n  throw new CommandResult({\n    msg: commit.getShowEntry()\n  });\n};\n\n// --- simulated working-directory / staging helpers ------------------------\n// These operate on this.workingChanges (a { path: status } map). They are only\n// exercised while a level has the changes model engaged.\nGitEngine.prototype.getChangesWithStatus = function(status) {\n  return Object.keys(this.workingChanges).filter(function(path) {\n    return this.workingChanges[path] === status;\n  }, this);\n};\n\nGitEngine.prototype.getUnstagedChanges = function() {\n  return this.getChangesWithStatus('modified');\n};\n\nGitEngine.prototype.getStagedChanges = function() {","sourceCodeStart":2954,"sourceCodeEnd":2990,"githubUrl":"https://github.com/pcottle/learnGitBranching/blob/5b09d0ff9678cad164f5a7488a279a44f90d7256/src/js/git/index.js#L2954-L2990","documentation":"Not a failure: git show returns its output by throwing a CommandResult whose msg is commit.getShowEntry() — the formatted log entry (id, branches, tags, message, author, date) for the commit resolved from the ref. This is the standard control-flow output mechanism for read-only commands.","triggerScenarios":"Any successful git show <ref> — getCommitFromRef resolves the ref and the formatted entry is thrown as the result.","commonSituations":"Normal usage; only a problem for code that catches GitError but not CommandResult.","solutions":["No fix needed — expected output","Catch CommandResult to capture the message text"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try { engine.show(ref); } catch (e) { if (e instanceof CommandResult) { display(e.msg); } else throw e; }","preventionTips":["Treat CommandResult as return value","Ensure ref resolves to a commit via getCommitFromRef before calling"],"tags":["git","show","command-result","control-flow"],"backgroundTag":"command-result-output","analyzedSha":"5b09d0ff9678cad164f5a7488a279a44f90d7256","analyzedAt":"2026-08-27T13:53:49.057Z","schemaVersion":2},"datasetVersion":"2026-08-27T19:17:21.184Z"}