{"record":{"id":"1c9571d60801c8c7","repo":"golang/go","slug":"unrecognized-vcs-tool-output-v","errorCode":null,"errorMessage":"unrecognized VCS tool output: %v","messagePattern":"unrecognized VCS tool output: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/cmd/go/internal/vcs/vcs.go","lineNumber":205,"sourceCode":"\t\tRevision:    rev,\n\t\tCommitTime:  commitTime,\n\t\tUncommitted: uncommitted,\n\t}, nil\n}\n\n// parseRevTime parses commit details in \"revision:seconds\" format.\nfunc parseRevTime(out []byte) (string, time.Time, error) {\n\tbuf := string(bytes.TrimSpace(out))\n\n\ti := strings.IndexByte(buf, ':')\n\tif i < 1 {\n\t\treturn \"\", time.Time{}, errors.New(\"unrecognized VCS tool output\")\n\t}\n\trev := buf[:i]\n\n\tsecs, err := strconv.ParseInt(buf[i+1:], 10, 64)\n\tif err != nil {\n\t\treturn \"\", time.Time{}, fmt.Errorf(\"unrecognized VCS tool output: %v\", err)\n\t}\n\n\treturn rev, time.Unix(secs, 0), nil\n}\n\n// vcsGit describes how to use Git.\nvar vcsGit = &Cmd{\n\tName: \"Git\",\n\tCmd:  \"git\",\n\tRoots: []isVCSRoot{\n\t\tvcsGitRoot{},\n\t},\n\n\tScheme: []string{\"git\", \"https\", \"http\", \"git+ssh\", \"ssh\"},\n\n\t// Leave out the '--' separator in the ls-remote command: git 2.7.4 does not\n\t// support such a separator for that command, and this use should be safe\n\t// without it because the {scheme} value comes from the predefined list above.","sourceCodeStart":187,"sourceCodeEnd":223,"githubUrl":"https://github.com/golang/go/blob/b6b368adc57c96c3151d224d172029f233ead2c3/src/cmd/go/internal/vcs/vcs.go#L187-L223","documentation":"parseRevTime parses VCS command output in 'revision:seconds' format (a revision hash and a Unix timestamp). If the output lacks a colon at a valid position (i < 1) or the substring after the colon cannot be parsed as a base-10 int64, the parse fails.","triggerScenarios":"A VCS status command (git log, hg parent, etc.) returns output that doesn't match 'rev:seconds' — e.g., an error message instead of data, a localized format, a broken VCS install, or an empty/whitespace-only output.","commonSituations":"Corrupted VCS metadata in the repository; non-standard VCS plugin or wrapper that alters output; locale settings that change numeric formatting; VCS binary version mismatch producing different output format.","solutions":["Run the underlying VCS command manually to inspect its raw output","Check for a corrupted or incomplete VCS checkout (re-clone if necessary)","Verify the VCS binary is a standard unmodified install","Check locale/LC_ALL settings aren't interfering with output formatting"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"# Detect VCS parse failures and report actionable diagnostics\nERR=$(go build ./... 2>&1)\nif echo \"$ERR\" | grep -q 'unrecognized VCS tool output'; then\n  echo 'VCS output parse failure — check your VCS installation and repository integrity'\n  git log -1 --format='%H:%ct'  # verify expected format manually\nfi","preventionTips":["Keep VCS binaries (git, hg) at standard versions","Verify repository integrity with a fresh clone if output is unexpected","Avoid VCS wrappers or plugins that alter command output"],"tags":["vcs","parsing","git","hg"],"backgroundTag":null,"analyzedSha":"b6b368adc57c96c3151d224d172029f233ead2c3","analyzedAt":"2026-08-12T00:22:02.250Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}