plandex-ai/plandex · error

no timestamp found in log

Error message

no timestamp found in log

What it means

GetGitLogTimestamp extracts a timestamp line from a git-log entry using GitLogTimestampRegex (format like 'Mon Jan 2, 2006 | 3:04:05pm UTC'). If the regex cannot find a timestamp capture group in the supplied log string, the library returns this error instead of a time value. It indicates the log text does not match the expected git log pretty format.

Source

Thrown at app/cli/lib/git.go:224

	res, err := exec.Command("git", "checkout", path).CombinedOutput()
	if err != nil {
		log.Println("Error checking out file:", string(res))

		return fmt.Errorf("error checking out file %s | err: %v, output: %s", path, err, string(res))
	}

	return nil
}

const GitLogTimestampFormat = "Mon Jan 2, 2006 | 3:04:05pm"

var GitLogTimestampRegex = regexp.MustCompile(`\w{3} \w{3} \d{1,2}, \d{4} \| \d{1,2}:\d{2}:\d{2}(am|pm) UTC`)

func GetGitLogTimestamp(log string) (time.Time, error) {
	matches := GitLogTimestampRegex.FindStringSubmatch(log)
	if len(matches) < 2 {
		return time.Time{}, fmt.Errorf("no timestamp found in log")
	}

	return time.Parse(GitLogTimestampFormat, strings.TrimSuffix(matches[0], " UTC"))
}

func parseConflictFiles(gitOutput string) []string {
	var conflictFiles []string
	lines := strings.Split(gitOutput, "\n")

	inFilesSection := false

	for _, line := range lines {
		if inFilesSection {
			file := strings.TrimSpace(line)
			if file == "" {
				continue
			}
			conflictFiles = append(conflictFiles, strings.TrimSpace(line))

View on GitHub (pinned to e2d772072e)

Solutions

  1. Verify the log string came from a git log invocation using the expected pretty format containing 'Mon Jan 2, 2006 | 3:04:05pm UTC' style timestamps.
  2. Ensure git runs with English locale (e.g. LC_ALL=C) so abbreviations match.
  3. Check the repo actually has commits (empty log output yields no match).
  4. Test the string against GitLogTimestampRegex directly to see which part of the format diverges.

Example fix

// before
t, err := GetGitLogTimestamp(rawLog)
// after
if !GitLogTimestampRegex.MatchString(rawLog) {
    return fmt.Errorf("log entry has no parseable timestamp: %q", rawLog)
}
t, err := GetGitLogTimestamp(rawLog)
Defensive patterns

Strategy: try-catch

Validate before calling

var tsRegex = regexp.MustCompile(`\w{3} \w{3} \d{1,2}, \d{4} \| \d{1,2}:\d{2}:\d{2}(am|pm) UTC`)
if !tsRegex.MatchString(logLine) {
    // skip entry or use a fallback timestamp
}

Try / catch

t, err := GetGitLogTimestamp(logLine)
if err != nil {
    log.Printf("timestamp missing, skipping entry: %v", err)
    return time.Time{}, nil // or skip the entry
}

Prevention

When it happens

Trigger: Calling GetGitLogTimestamp(log) with a string that lacks a matching timestamp: an empty log, a truncated entry, log output produced with a different pretty format, or a locale where abbreviated weekday/month names differ.

Common situations: Feeding raw `git log` output that wasn't formatted with the library's GitLogTimestampFormat, running under a non-English locale (LC_TIME) so 'Mon'/'Jan' become localized names, or parsing an empty result from `git log` in a repo with no commits.

Related errors


AI-assisted analysis of plandex-ai/plandex@e2d772072e (2026-09-05). Data as JSON: /api/errors/9641d51707f6d366. Report an issue: GitHub.