golang/go · error

unrecognized VCS tool output: %v

Error message

unrecognized VCS tool output: %v

What it means

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.

Source

Thrown at src/cmd/go/internal/vcs/vcs.go:205

		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{},
	},

	Scheme: []string{"git", "https", "http", "git+ssh", "ssh"},

	// Leave out the '--' separator in the ls-remote command: git 2.7.4 does not
	// support such a separator for that command, and this use should be safe
	// without it because the {scheme} value comes from the predefined list above.

View on GitHub (pinned to b6b368adc5)

Solutions

  1. Run the underlying VCS command manually to inspect its raw output
  2. Check for a corrupted or incomplete VCS checkout (re-clone if necessary)
  3. Verify the VCS binary is a standard unmodified install
  4. Check locale/LC_ALL settings aren't interfering with output formatting
Defensive patterns

Strategy: try-catch

Try / catch

# Detect VCS parse failures and report actionable diagnostics
ERR=$(go build ./... 2>&1)
if echo "$ERR" | grep -q 'unrecognized VCS tool output'; then
  echo 'VCS output parse failure — check your VCS installation and repository integrity'
  git log -1 --format='%H:%ct'  # verify expected format manually
fi

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of golang/go@b6b368adc5 (2026-08-12). Data as JSON: /api/errors/1c9571d60801c8c7. Report an issue: GitHub.