{"record":{"id":"a9bab24c717d3e69","repo":"golang/go","slug":"unrecognized-vcs-tool-output","errorCode":null,"errorMessage":"unrecognized VCS tool output","messagePattern":"unrecognized VCS tool output","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/cmd/go/internal/vcs/vcs.go","lineNumber":199,"sourceCode":"\tif err != nil {\n\t\treturn Status{}, err\n\t}\n\tuncommitted := len(out) > 0\n\n\treturn Status{\n\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},","sourceCodeStart":181,"sourceCodeEnd":217,"githubUrl":"https://github.com/golang/go/blob/b6b368adc57c96c3151d224d172029f233ead2c3/src/cmd/go/internal/vcs/vcs.go#L181-L217","documentation":"parseRevTime expects VCS info output shaped `revision:seconds`. It fails if there is no colon at index >= 1, or if the substring after the colon is not a base-10 integer (in which case it wraps the strconv error with the same message). This affects non-git VCS tools (hg, svn, fossil) whose log/info output is parsed this way.","triggerScenarios":"A VCS command returns output that doesn't match the `revision:seconds` contract — e.g. due to an unsupported/old VCS version, localized output, or a corrupt repository.","commonSituations":"Old Mercurial/Subversion/Fossil versions; non-C locale altering output formatting; damaged checkouts.","solutions":["Upgrade the VCS tool to a version the go command supports.","Force the C locale (LC_ALL=C) so output formatting matches expectations.","Verify repository integrity (e.g. hg/svn checkout is valid).","Prefer a git-backed module if you control the source."],"exampleFix":"# before\n$ LC_ALL=de_DE.UTF-8 go get -v example.com/lib  # localized hg output\n\n# after\n$ LC_ALL=C go get -v example.com/lib","handlingStrategy":"validation","validationCode":"// Verify the VCS tool and locale before fetching non-git modules.\nfunc vcsEnvOK() error {\n    if _, err := exec.LookPath(\"hg\"); err == nil { // example for hg\n        if os.Getenv(\"LC_ALL\") != \"C\" {\n            return errors.New(\"set LC_ALL=C for deterministic VCS output\")\n        }\n    }\n    return nil\n}","typeGuard":"null","tryCatchPattern":"null","preventionTips":["Use a supported VCS version in CI.","Pin LC_ALL=C to avoid locale-dependent output.","Prefer git-backed modules where you control the source."],"tags":["vcs","parsing","hg","svn","fossil","locale"],"backgroundTag":null,"analyzedSha":"b6b368adc57c96c3151d224d172029f233ead2c3","analyzedAt":"2026-08-12T00:22:02.250Z","schemaVersion":2},"datasetVersion":"2026-08-12T12:31:55.035Z"}