golang/go · error
unrecognized VCS tool output
Error message
unrecognized VCS tool output
What it means
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.
Source
Thrown at src/cmd/go/internal/vcs/vcs.go:199
if err != nil {
return Status{}, err
}
uncommitted := len(out) > 0
return Status{
Revision: rev,
CommitTime: commitTime,
Uncommitted: uncommitted,
}, nil
}
// parseRevTime parses commit details in "revision:seconds" format.
func parseRevTime(out []byte) (string, time.Time, error) {
buf := string(bytes.TrimSpace(out))
i := strings.IndexByte(buf, ':')
if i < 1 {
return "", time.Time{}, errors.New("unrecognized VCS tool output")
}
rev := buf[:i]
secs, err := strconv.ParseInt(buf[i+1:], 10, 64)
if err != nil {
return "", time.Time{}, fmt.Errorf("unrecognized VCS tool output: %v", err)
}
return rev, time.Unix(secs, 0), nil
}
// vcsGit describes how to use Git.
var vcsGit = &Cmd{
Name: "Git",
Cmd: "git",
Roots: []isVCSRoot{
vcsGitRoot{},
},View on GitHub (pinned to b6b368adc5)
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.
Example fix
# before $ LC_ALL=de_DE.UTF-8 go get -v example.com/lib # localized hg output # after $ LC_ALL=C go get -v example.com/lib
Defensive patterns
Strategy: validation
Validate before calling
// Verify the VCS tool and locale before fetching non-git modules.
func vcsEnvOK() error {
if _, err := exec.LookPath("hg"); err == nil { // example for hg
if os.Getenv("LC_ALL") != "C" {
return errors.New("set LC_ALL=C for deterministic VCS output")
}
}
return nil
} Type guard
null
Try / catch
null
Prevention
- 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.
When it happens
Trigger: 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.
Common situations: Old Mercurial/Subversion/Fossil versions; non-C locale altering output formatting; damaged checkouts.
Related errors
- unable to parse output of svn info: %v
- unable to parse output of fossil info: %v
- unable to parse output of fossil info
- no lookupRef
- vcs %s: CheckReuse: %w
AI-assisted analysis of golang/go@b6b368adc5 (2026-08-12).
Data as JSON: /api/errors/a9bab24c717d3e69.
Report an issue: GitHub.