pcottle/learnGitBranching · info · CommandResult
commit.getShowEntry()
Error message
commit.getShowEntry()
What it means
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.
Source
Thrown at src/js/git/index.js:2972
var willStartAuto = this.animationQueue.get('defer') ||
this.animationQueue.get('promiseBased');
// only add the refresh if we didn't do manual animations
if (!this.animationQueue.get('animations').length && !willStartAuto) {
this.animationFactory.refreshTree(this.animationQueue, this.gitVisuals);
}
// animation queue will call the callback when its done
if (!willStartAuto) {
this.animationQueue.start();
}
};
GitEngine.prototype.show = function(ref) {
var commit = this.getCommitFromRef(ref);
throw new CommandResult({
msg: commit.getShowEntry()
});
};
// --- simulated working-directory / staging helpers ------------------------
// These operate on this.workingChanges (a { path: status } map). They are only
// exercised while a level has the changes model engaged.
GitEngine.prototype.getChangesWithStatus = function(status) {
return Object.keys(this.workingChanges).filter(function(path) {
return this.workingChanges[path] === status;
}, this);
};
GitEngine.prototype.getUnstagedChanges = function() {
return this.getChangesWithStatus('modified');
};
GitEngine.prototype.getStagedChanges = function() {View on GitHub (pinned to 5b09d0ff96)
Solutions
- No fix needed — expected output
- Catch CommandResult to capture the message text
Defensive patterns
Strategy: try-catch
Try / catch
try { engine.show(ref); } catch (e) { if (e instanceof CommandResult) { display(e.msg); } else throw e; } Prevention
- Treat CommandResult as return value
- Ensure ref resolves to a commit via getCommitFromRef before calling
When it happens
Trigger: Any successful git show <ref> — getCommitFromRef resolves the ref and the formatted entry is thrown as the result.
Common situations: Normal usage; only a problem for code that catches GitError but not CommandResult.
Related errors
- <dynamic describe output: foundTag>
- <dynamic branch listing>
- <dynamic tag listing>
- <dynamic remote listing>
- <dynamic describe output: foundTag-N-g<id>>
AI-assisted analysis of pcottle/learnGitBranching@5b09d0ff96 (2026-08-27).
Data as JSON: /api/errors/af4e062e5d366fa9.
Report an issue: GitHub.