{"record":{"id":"9a8ecc428cc145ba","repo":"pcottle/learnGitBranching","slug":"dynamic-describe-output-foundtag","errorCode":null,"errorMessage":"<dynamic describe output: foundTag>","messagePattern":"<dynamic describe output: foundTag>","errorType":"validation","errorClass":"CommandResult","httpStatus":null,"severity":"info","filePath":"src/js/git/index.js","lineNumber":2800,"sourceCode":"    }\n    // ok keep going\n    numAway.push(popped.get('id'));\n\n    var parents = popped.get('parents');\n    if (parents && parents.length) {\n      pQueue = pQueue.concat(parents);\n      pQueue.sort(this.dateSortFunc);\n    }\n  }\n\n  if (!foundTag) {\n    throw new GitError({\n      msg: intl.todo('Fatal: no tags found upstream')\n    });\n  }\n\n  if (numAway.length === 0) {\n    throw new CommandResult({\n      msg: foundTag\n    });\n  }\n\n  // then join\n  throw new CommandResult({\n    msg: foundTag + '-' + numAway.length + '-g' + startCommit.get('id')\n  });\n};\n\nGitEngine.prototype.renameBranch = function(oldName, newName, force) {\n  var target = this.resolveID(oldName);\n\n  if (!target || target.get('type') !== 'branch') {\n    throw new GitError({\n      msg: intl.todo('fatal: not a branch: ' + oldName)\n    });\n  }","sourceCodeStart":2782,"sourceCodeEnd":2818,"githubUrl":"https://github.com/pcottle/learnGitBranching/blob/5b09d0ff9678cad164f5a7488a279a44f90d7256/src/js/git/index.js#L2782-L2818","documentation":"Not a real failure: describe returns its result by throwing a CommandResult whose msg is exactly the nearest tag name (foundTag). This is the framework's control-flow mechanism for producing command output, used when the target commit is itself tagged (numAway is empty).","triggerScenarios":"Running describe on a commit that has a tag directly on it — the walk finds the tag immediately and there are zero commits between, so output is just the tag name.","commonSituations":"Any git describe on a tagged commit; expected, informational output.","solutions":["No fix needed — this is the successful describe output","Catch CommandResult (not GitError) in calling code to read the message"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try { engine.describe(ref); } catch (e) { if (e instanceof CommandResult) { display(e.msg); } else throw e; }","preventionTips":["Treat CommandResult as output, not failure","Catch CommandResult separately from GitError"],"tags":["git","describe","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"}